Enhanced UX and clean up
parent
7b2f4c0163
commit
e665f4adc3
@ -1,36 +0,0 @@
|
||||
import 'package:fluffychat/i18n/i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ConfirmDialog extends StatelessWidget {
|
||||
const ConfirmDialog(
|
||||
this.text,
|
||||
this.confirmText,
|
||||
this.onConfirmed,
|
||||
);
|
||||
final String text;
|
||||
final String confirmText;
|
||||
final Function(BuildContext) onConfirmed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(text),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(I18n.of(context).close.toUpperCase(),
|
||||
style: TextStyle(color: Colors.blueGrey)),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(
|
||||
confirmText.toUpperCase(),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
onConfirmed(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue