import 'package:flutter/material.dart'; import 'package:doctor/common/settings.dart'; class Dialogs { static Future showLoadingDialog(BuildContext context, GlobalKey key) async { return showDialog( context: context, barrierDismissible: false, builder: (BuildContext context) { return new WillPopScope( onWillPop: () async => false, child: SimpleDialog( key: key, backgroundColor: Colors.white, children: [ Center( child: Column(children: [ CircularProgressIndicator( valueColor: new AlwaysStoppedAnimation(AppBarGradient_1), ), SizedBox( height: 10, ), Text( AppSettings.preloadText, style: PreloaderText(), ), ]), ) ])); }); } }