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.
 
 
 
 

31 lines
776 B

  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. class ProgressDialogUtils {
  4. static bool isProgressVisible = false;
  5. ///common method for showing progress dialog
  6. static void showProgressDialog({isCancellable = false}) async {
  7. if (!isProgressVisible) {
  8. Get.dialog(
  9. Center(
  10. child: CircularProgressIndicator.adaptive(
  11. strokeWidth: 4,
  12. valueColor: AlwaysStoppedAnimation<Color>(
  13. Colors.white,
  14. ),
  15. ),
  16. ),
  17. barrierDismissible: isCancellable,
  18. );
  19. isProgressVisible = true;
  20. }
  21. }
  22. ///common method for hiding progress dialog
  23. static void hideProgressDialog() {
  24. if (isProgressVisible) Get.back();
  25. isProgressVisible = false;
  26. }
  27. }