diff --git a/lib/common.dart b/lib/common.dart index 803cdb3c5..c2fdb0709 100644 --- a/lib/common.dart +++ b/lib/common.dart @@ -39,29 +39,32 @@ void showLoading(String text, BuildContext context) { return; } EasyLoading.showWidget( - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Center(child: CircularProgressIndicator()), - SizedBox(height: 20), - Center( - child: - Text(Translator.call(text), style: TextStyle(fontSize: 15))), - SizedBox(height: 20), - Center( - child: TextButton( - style: flatButtonStyle, - onPressed: () { - // with out loadingCancelCallback, we can see unexpected input password - // dialog shown in home, no clue why, so use this as workaround - // why no such issue on android? - if (loadingCancelCallback != null) loadingCancelCallback(); - Navigator.pop(context); - }, - child: Text(Translator.call('Cancel'), - style: TextStyle(color: MyTheme.accent)))) - ], - ), + Container( + constraints: BoxConstraints(maxWidth: 300), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center(child: CircularProgressIndicator()), + SizedBox(height: 20), + Center( + child: Text(Translator.call(text), + style: TextStyle(fontSize: 15))), + SizedBox(height: 20), + Center( + child: TextButton( + style: flatButtonStyle, + onPressed: () { + // with out loadingCancelCallback, we can see unexpected input password + // dialog shown in home, no clue why, so use this as workaround + // why no such issue on android? + if (loadingCancelCallback != null) + loadingCancelCallback(); + Navigator.pop(context); + }, + child: Text(Translator.call('Cancel'), + style: TextStyle(color: MyTheme.accent)))) + ], + )), maskType: EasyLoadingMaskType.black); } @@ -138,18 +141,20 @@ void msgbox(String type, String title, String text, BuildContext context, })); } EasyLoading.showWidget( - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(Translator.call(title), style: TextStyle(fontSize: 21)), - SizedBox(height: 20), - Text(Translator.call(text), style: TextStyle(fontSize: 15)), - SizedBox(height: 20), - Row( - children: buttons, - ) - ], - ), + Container( + constraints: BoxConstraints(maxWidth: 300), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(Translator.call(title), style: TextStyle(fontSize: 21)), + SizedBox(height: 20), + Text(Translator.call(text), style: TextStyle(fontSize: 15)), + SizedBox(height: 20), + Row( + children: buttons, + ) + ], + )), maskType: EasyLoadingMaskType.black); } diff --git a/lib/model.dart b/lib/model.dart index 6eb2c0e97..98a7f6bcd 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -695,7 +695,7 @@ void initializeCursorAndCanvas() async { } String translate(String name) { - if (name.startsWith('Failed') && name.contains(':')) { + if (name.startsWith('Failed to') && name.contains(': ')) { return name.split(': ').map((x) => translate(x)).join(': '); } var a = 'translate';