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