Blame view

lib/common/utils/show_star_reward_dialog.dart 813 Bytes
ae239ac7   吴启风   feat:星星动画封装(资源有点问题)
1
  import 'package:flutter/material.dart';
642081ad   吴启风   feat:lottie动画加载优化...
2
3
  
  import '../widgets/star_reward_widget.dart';
ae239ac7   吴启风   feat:星星动画封装(资源有点问题)
4
5
6
7
8
9
10
11
12
13
14
15
16
  
  void showStarRewardDialog(BuildContext context, {
    double width = 200,
    double height = 200,
    int starCount = 3,
  }) {
    showDialog(
      context: context,
      barrierDismissible: false, // 点击对话框外部不关闭对话框
      builder: (BuildContext context) {
        return Dialog(
          backgroundColor: Colors.transparent, // 设置对话框背景为透明
          insetPadding: const EdgeInsets.all(0), // 去除对话框的内边距
642081ad   吴启风   feat:lottie动画加载优化...
17
          child: StarRewardWidget(
ae239ac7   吴启风   feat:星星动画封装(资源有点问题)
18
19
20
21
22
23
24
25
26
27
28
29
            width: width,
            height: height,
            isPlaying: true,
            starCount: starCount,
            onAnimationEnd: () {
              Navigator.of(context).pop(); // 关闭对话框
            },
          ),
        );
      },
    );
  }