mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
28 lines
638 B
Dart
28 lines
638 B
Dart
|
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,
|
||
|
);
|
||
|
}
|
||
|
}
|