Sonnat Project
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.

54 lines
1.5 KiB

  1. import 'dart:io';
  2. import 'package:flutter/foundation.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:loading_animations/loading_animations.dart';
  5. import 'package:lottie/lottie.dart';
  6. import 'package:sonnat/core/extensions/number_extension.dart';
  7. import 'package:sonnat/core/theme/app_colors.dart';
  8. class GlobalLoading extends StatelessWidget {
  9. final bool isSmallSize;
  10. const GlobalLoading({super.key, this.isSmallSize = false});
  11. @override
  12. Widget build(BuildContext context) {
  13. return SizedBox(
  14. height: isSmallSize ? 0.25.sw : 1.sh,
  15. child: Column(
  16. children: [
  17. if (!kIsWeb && Platform.isIOS && !isSmallSize)
  18. const Row(
  19. mainAxisAlignment: MainAxisAlignment.start,
  20. children: [
  21. BackButton(
  22. color: Colors.white,
  23. ),
  24. ],
  25. ),
  26. Expanded(
  27. child: Center(
  28. child: Column(
  29. mainAxisAlignment: MainAxisAlignment.center,
  30. children: [
  31. if (!isSmallSize)
  32. Lottie.asset(
  33. 'assets/images/loading.json',
  34. height: 0.25.sw,
  35. fit: BoxFit.scaleDown,
  36. ),
  37. if (isSmallSize)
  38. LoadingBumpingLine.circle(
  39. size: 30.h,
  40. backgroundColor: AppColors.gray,
  41. ),
  42. ],
  43. ),
  44. ),
  45. ),
  46. ],
  47. ),
  48. );
  49. }
  50. }