You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6KB

  1. import 'package:flutter/material.dart';
  2. class LoadingDialog {
  3. static void showLoadingDialog(BuildContext context) {
  4. showDialog(
  5. context: context,
  6. barrierDismissible: false,
  7. builder: (context) {
  8. return WillPopScope(
  9. onWillPop: () async => false,
  10. child: Opacity(
  11. opacity: 1,
  12. child: Stack(
  13. children: <Widget>[
  14. Align(
  15. alignment: Alignment.center,
  16. child: Container(
  17. decoration: new BoxDecoration(
  18. color: Colors.white,
  19. borderRadius:
  20. new BorderRadius.all(Radius.circular(16.0))),
  21. width: 80.0,
  22. height: 80.0),
  23. ),
  24. Container(
  25. alignment: Alignment.center,
  26. child: FlutterLogo(
  27. size: 25,
  28. ),
  29. ),
  30. Container(
  31. alignment: Alignment.center,
  32. child: SizedBox(
  33. child: CircularProgressIndicator(
  34. strokeWidth: 2.0,
  35. ),
  36. width: 60.0,
  37. height: 60.0,
  38. ),
  39. )
  40. ],
  41. )),
  42. );
  43. });
  44. }
  45. static void hideLoadingDialog(BuildContext context) {
  46. Navigator.pop(context, "");
  47. }
  48. }