fix msgbox hasCancel and home id editor focus problem

This commit is contained in:
open-trade
2020-11-24 11:25:56 +08:00
parent 23f1ce5da5
commit 982df980bd
4 changed files with 38 additions and 8 deletions

View File

@@ -61,19 +61,22 @@ Future<T> showAlertDialog<T>(BuildContext context, BuildAlertDailog build,
}
void msgbox(String type, String title, String text, BuildContext context,
[hasCancel = false]) {
[bool hasCancel]) {
if (hasCancel == null) {
hasCancel = type != 'error';
}
showAlertDialog(
context,
(_) => Tuple3(Text(title), Text(text), [
hasCancel
? Spacer()
: FlatButton(
? FlatButton(
textColor: MyTheme.accent,
onPressed: () {
Navigator.pop(context);
},
child: Text('Cancel'),
),
)
: Spacer(),
FlatButton(
textColor: MyTheme.accent,
onPressed: () {