1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Create pick user dialog

This commit is contained in:
2020-05-02 15:30:19 +02:00
parent 1227ef283c
commit 804457c761
5 changed files with 153 additions and 15 deletions

View File

@ -0,0 +1,17 @@
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Render a cancel button for an alert dialog
///
/// @author Pierre HUBERT
class CancelDialogButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: () => Navigator.of(context).pop(),
child: Text(tr("Cancel").toUpperCase()),
textColor: Colors.red,
);
}
}

View File

@ -0,0 +1,27 @@
import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart';
/// Confirm dialog button
///
/// @author Pierre HUBERT
class ConfirmDialogButton<T> extends StatelessWidget {
final bool enabled;
final T value;
const ConfirmDialogButton({
Key key,
this.enabled = true,
@required this.value,
}) : assert(enabled != null),
super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: enabled ? () => Navigator.of(context).pop(value) : null,
child: Text(tr("Confirm").toUpperCase()),
textColor: Colors.green,
);
}
}