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.

42 lines
974B

  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:loading_indicator/loading_indicator.dart';
  4. import 'const_color.dart';
  5. class UtilWidget {
  6. static void showLoading() {
  7. if (Get.isDialogOpen!) Get.back();
  8. Get.dialog(
  9. WillPopScope(
  10. onWillPop: () async => false,
  11. child: Center(
  12. child: Container(
  13. width: 60,
  14. height: 60,
  15. decoration: BoxDecoration(
  16. color: Colors.transparent,
  17. borderRadius: BorderRadius.circular(8),
  18. ),
  19. child: LoadingIndicator(
  20. indicatorType: Indicator.ballClipRotate,
  21. colors: [
  22. AppColors.BLUE,
  23. ],
  24. ),
  25. ),
  26. ),
  27. ),
  28. barrierDismissible: false,
  29. );
  30. }
  31. static void hideLoading() {
  32. if (Get.isDialogOpen!) Get.back();
  33. }
  34. static void hideDialog() {
  35. if (Get.isDialogOpen!) Get.back();
  36. }
  37. }