1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00
comunicmobile/lib/ui/widgets/dialogs/confirm_dialog_button.dart

27 lines
605 B
Dart
Raw Permalink Normal View History

2020-05-02 13:30:19 +00:00
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,
2020-05-02 13:30:19 +00:00
this.enabled = true,
required this.value,
2022-03-11 15:40:56 +00:00
}) : super(key: key);
2020-05-02 13:30:19 +00:00
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: enabled ? () => Navigator.of(context).pop(value) : null,
child: Text(tr("Confirm")!.toUpperCase()),
2020-05-02 13:30:19 +00:00
textColor: Colors.green,
);
}
}