add cancel button for showLoading
This commit is contained in:
		
							parent
							
								
									035934cd99
								
							
						
					
					
						commit
						795f97c2b6
					
				| @ -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() { | ||||
|  | ||||
| @ -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), | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user