photo_delete_finish_dialog.dart 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import 'package:clean/module/main/main_view.dart';
  2. import 'package:clean/resource/assets.gen.dart';
  3. import 'package:clean/resource/colors.gen.dart';
  4. import 'package:flutter/Material.dart';
  5. import 'package:flutter/cupertino.dart';
  6. import 'package:flutter_screenutil/flutter_screenutil.dart';
  7. import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
  8. import 'package:lottie/lottie.dart';
  9. import 'package:get/get.dart';
  10. import 'package:clean/router/app_pages.dart';
  11. void photoDeleteFinishDialog( { Function? onDismiss}) {
  12. const tag = 'photoDeleteFinishDialog';
  13. // 300ms后关闭弹窗
  14. Future.delayed(Duration(seconds: 3), () {
  15. SmartDialog.dismiss(tag: tag);
  16. if (onDismiss != null) {
  17. onDismiss();
  18. }
  19. // // 回到首页
  20. // Get.until((route) => Get. currentRoute ==RoutePath.mainTab);
  21. });
  22. SmartDialog.show(
  23. tag: tag,
  24. backType: SmartBackType.block,
  25. clickMaskDismiss: false,
  26. maskColor: ColorName.black,
  27. builder: (_) {
  28. return Container(
  29. height: double.infinity,
  30. width: double.infinity,
  31. child: Stack(
  32. children: [
  33. Positioned(
  34. left: 0,
  35. right: 0,
  36. child: Column(
  37. children: [
  38. Column(
  39. crossAxisAlignment: CrossAxisAlignment.center,
  40. mainAxisAlignment: MainAxisAlignment.center,
  41. children: [
  42. Lottie.asset(
  43. Assets.anim.animFireworks,
  44. height: 351.h,
  45. repeat: false,
  46. ),
  47. Text(
  48. 'Perfect!',
  49. textAlign: TextAlign.center,
  50. style: TextStyle(
  51. color: Colors.white,
  52. fontSize: 32.sp,
  53. fontWeight: FontWeight.w700,
  54. ),
  55. ),
  56. SizedBox(height: 16.h),
  57. SizedBox(
  58. child: Row(
  59. mainAxisAlignment: MainAxisAlignment.center,
  60. children: [
  61. Container(
  62. clipBehavior: Clip.antiAlias,
  63. decoration: BoxDecoration(),
  64. child: Assets
  65. .images.iconPreviewSwiperEndFirework
  66. .image(
  67. width: 40.w,
  68. height: 40.w,
  69. ),
  70. ),
  71. SizedBox(width: 4.w),
  72. Text(
  73. 'Photos Removed',
  74. textAlign: TextAlign.center,
  75. style: TextStyle(
  76. color: Colors.white.withValues(alpha: 0.8),
  77. fontSize: 16.sp,
  78. fontWeight: FontWeight.w400,
  79. ),
  80. ),
  81. SizedBox(width: 4.w),
  82. Container(
  83. clipBehavior: Clip.antiAlias,
  84. decoration: BoxDecoration(),
  85. child: Assets
  86. .images.iconPreviewSwiperEndFirework
  87. .image(
  88. width: 40.w,
  89. height: 40.w,
  90. ),
  91. ),
  92. ],
  93. ),
  94. ),
  95. ],
  96. ),
  97. ],
  98. )),
  99. IgnorePointer(
  100. child: Assets.images.bgPhotoSelectedPreviewFinish.image(
  101. width: 360.w,
  102. ),
  103. ),
  104. ],
  105. ),
  106. );
  107. });
  108. }