zoukankan      html  css  js  c++  java
  • material_dialogs 动画弹框

    环境:
    material_dialogs: ^1.1.0
    链接:
    https://lottiefiles.com/featured 免费动画文件下载 需要注册
    https://pub.flutter-io.cn/packages/material_dialogs 文档
    动画文件引入:
    pubspec.yaml
    # animation
    - assets/sprinkles.json
    - assets/confetti-full-screen.json
    使用:
    import 'package:material_dialogs/material_dialogs.dart';
    import 'package:material_dialogs/widgets/buttons/icon_button.dart';
    import 'package:material_dialogs/widgets/buttons/icon_outline_button.dart';
    
    
    Dialogs.materialDialog(
                    msg: '真的要走么?',
                    title: "信息",
                    color: Colors.white,
                    context: context,
                    lottieBuilder: Lottie.asset(
                      'assets/confetti-full-screen.json',
                      fit: BoxFit.fitWidth,
                    ),
                    actions: [
                      IconsOutlineButton(
                        onPressed: () {
                          Navigator.pop(context);
                        },
                        text: '取消',
                        iconData: Icons.cancel_outlined,
                        textStyle: TextStyle(color: Colors.grey),
                        iconColor: Colors.grey,
    
                      ),
                      IconsButton(
                        onPressed: () {
                          Navigator.pop(context);
                          logout(context);
                        },
                        text: '确认',
                        iconData: Icons.check,
                        color: Colors.red,
                        textStyle: TextStyle(color: Colors.white),
                        iconColor: Colors.white,
                      ),
                    ]);

    效果:




    今ならできます。
  • 相关阅读:
    cmder
    navicat 查询保存的位置
    git使用
    怎么保证测试用例的覆盖率
    python3.7-初学篇-19-良好的习惯
    python基础篇-使用list和tuple
    python基础篇-字符串和编码
    python基础篇-输入和输出
    python3.7-初学篇-21
    python3.7-初学者-20
  • 原文地址:https://www.cnblogs.com/shuangzikun/p/flutter_material_dialogs.html
Copyright © 2011-2022 走看看