add cancel button for showLoading

This commit is contained in:
rustdesk 2022-03-28 00:36:53 +08:00
parent 035934cd99
commit 795f97c2b6
2 changed files with 32 additions and 7 deletions

View File

@ -43,7 +43,28 @@ final ButtonStyle flatButtonStyle = TextButton.styleFrom(
void showLoading(String text) {
DialogManager.reset();
EasyLoading.dismiss();
EasyLoading.show(status: text, maskType: EasyLoadingMaskType.black);
EasyLoading.show(
indicator: Container(
constraints: BoxConstraints(maxWidth: 240),
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: () {
EasyLoading.dismiss();
backToHome();
},
child: Text(Translator.call('Cancel'),
style: TextStyle(color: MyTheme.accent))))
])),
maskType: EasyLoadingMaskType.black);
}
backToHome() {

View File

@ -306,12 +306,16 @@ class _RemotePageState extends State<RemotePage> {
onPressed: changeTouchMode,
)
]) +
<Widget>[
IconButton(
color: Colors.white,
icon: Icon(Icons.message),
onPressed: toggleChatOverlay,
),
(isWeb
? []
: <Widget>[
IconButton(
color: Colors.white,
icon: Icon(Icons.message),
onPressed: toggleChatOverlay,
)
]) +
[
IconButton(
color: Colors.white,
icon: Icon(Icons.more_vert),