fix on loading

This commit is contained in:
rustdesk 2022-01-27 01:28:32 +08:00
parent 16218a731b
commit 1d7933621d
2 changed files with 41 additions and 36 deletions

View File

@ -39,29 +39,32 @@ void showLoading(String text, BuildContext context) {
return; return;
} }
EasyLoading.showWidget( EasyLoading.showWidget(
Column( Container(
crossAxisAlignment: CrossAxisAlignment.start, constraints: BoxConstraints(maxWidth: 300),
children: [ child: Column(
Center(child: CircularProgressIndicator()), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox(height: 20), children: [
Center( Center(child: CircularProgressIndicator()),
child: SizedBox(height: 20),
Text(Translator.call(text), style: TextStyle(fontSize: 15))), Center(
SizedBox(height: 20), child: Text(Translator.call(text),
Center( style: TextStyle(fontSize: 15))),
child: TextButton( SizedBox(height: 20),
style: flatButtonStyle, Center(
onPressed: () { child: TextButton(
// with out loadingCancelCallback, we can see unexpected input password style: flatButtonStyle,
// dialog shown in home, no clue why, so use this as workaround onPressed: () {
// why no such issue on android? // with out loadingCancelCallback, we can see unexpected input password
if (loadingCancelCallback != null) loadingCancelCallback(); // dialog shown in home, no clue why, so use this as workaround
Navigator.pop(context); // why no such issue on android?
}, if (loadingCancelCallback != null)
child: Text(Translator.call('Cancel'), loadingCancelCallback();
style: TextStyle(color: MyTheme.accent)))) Navigator.pop(context);
], },
), child: Text(Translator.call('Cancel'),
style: TextStyle(color: MyTheme.accent))))
],
)),
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
} }
@ -138,18 +141,20 @@ void msgbox(String type, String title, String text, BuildContext context,
})); }));
} }
EasyLoading.showWidget( EasyLoading.showWidget(
Column( Container(
crossAxisAlignment: CrossAxisAlignment.start, constraints: BoxConstraints(maxWidth: 300),
children: [ child: Column(
Text(Translator.call(title), style: TextStyle(fontSize: 21)), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox(height: 20), children: [
Text(Translator.call(text), style: TextStyle(fontSize: 15)), Text(Translator.call(title), style: TextStyle(fontSize: 21)),
SizedBox(height: 20), SizedBox(height: 20),
Row( Text(Translator.call(text), style: TextStyle(fontSize: 15)),
children: buttons, SizedBox(height: 20),
) Row(
], children: buttons,
), )
],
)),
maskType: EasyLoadingMaskType.black); maskType: EasyLoadingMaskType.black);
} }

View File

@ -695,7 +695,7 @@ void initializeCursorAndCanvas() async {
} }
String translate(String name) { 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(': '); return name.split(': ').map((x) => translate(x)).join(': ');
} }
var a = 'translate'; var a = 'translate';