From eccd08310dde752bf4e5dcfb2856d8db81c73e28 Mon Sep 17 00:00:00 2001 From: open-trade Date: Mon, 16 Nov 2020 22:14:29 +0800 Subject: [PATCH] showDialog --- flutter_hbb/lib/common.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flutter_hbb/lib/common.dart b/flutter_hbb/lib/common.dart index 21d3e1a40..46896f19f 100644 --- a/flutter_hbb/lib/common.dart +++ b/flutter_hbb/lib/common.dart @@ -121,10 +121,10 @@ void showSuccess(String text) { EasyLoading.showSuccess(text); } -AlertDialog enterPasswordDialog(String id, BuildContext context) { +void enterPasswordDialog(String id, BuildContext context) { var ffi = Provider.of(context); var remember = ffi.getByName("remember", arg: id) == "true"; - return AlertDialog( + var dialog = AlertDialog( title: Text('Please enter your password'), contentPadding: EdgeInsets.zero, content: Column( @@ -160,10 +160,11 @@ AlertDialog enterPasswordDialog(String id, BuildContext context) { ), ], ); + showDialog(context: context, builder: (context) => dialog); } -AlertDialog wrongPasswordDialog(String id, BuildContext context) { - return AlertDialog( +void wrongPasswordDialog(String id, BuildContext context) { + var dialog = AlertDialog( title: Text('Please enter your password'), contentPadding: EdgeInsets.zero, content: Text('Do you want to enter again?'), @@ -183,4 +184,5 @@ AlertDialog wrongPasswordDialog(String id, BuildContext context) { ), ], ); + showDialog(context: context, builder: (context) => dialog); }