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.

55 lines
1.8KB

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