直播app源码,Flutter 弹窗组件

直播app源码,Flutter 弹窗组件实现的各种形式

弹窗系列组件

1
AlertDialog<br>showDialog(<br>    context: context,<br>    builder: (BuildContext context) {<br>        return AlertDialog(<br>            title: Text("提示"),<br>            content: Text("确定删除吗?"),<br>            actions: [<br>                FlatButton(onPressed: () {}, child: Text("取消")),<br>                FlatButton(onPressed: () {}, child: Text("确定")),<br>            ],<br>        );<br>    },<br>);

​AlertDialog 自定义样式

1
showDialog(<br>    context: context,<br>    builder: (BuildContext context) {<br>        return AlertDialog(<br>            title: Center(child: Text("提示")),<br>            titleTextStyle: TextStyle(<br>                fontWeight: FontWeight.bold,<br>                color: Colors.black,<br>                fontSize: 30,<br>            ),<br>            content: Center(heightFactor: 1, child: Text("确定删除吗?")),<br>            backgroundColor: Colors.yellowAccent,<br>            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),<br>            actionsAlignment: MainAxisAlignment.center,<br>            actions: [<br>                FlatButton(<br>                    onPressed: () {<br>                        Navigator.of(context).pop("no");<br>                    },<br>                    child: Text("取消"),<br>                ),<br>                FlatButton(<br>                    onPressed: () {<br>                        Navigator.of(context).pop("yes");<br>                    },<br>                    child: Text("确定"),<br>                ),<br>            ],<br>        );<br>    },<br>);

 CupertinoAlertDialog IOS风格

1
 showCupertinoDialog(<br>    //点击空白处取消<br>    barrierDismissible: true,<br>    context: context,<br>    builder: (context) {<br>        return CupertinoAlertDialog(<br>            title: Text("提示"),<br>            content: Text("确认删除吗?"),<br>            actions: [<br>                CupertinoDialogAction(<br>                    child: Text("取消"),<br>                    onPressed: () {<br>                        Navigator.of(context).pop();<br>                    },<br>                ),<br>                CupertinoDialogAction(<br>                    child: Text("确定"),<br>                    onPressed: () {},<br>                ),<br>            ],<br>        );<br>    },<br>);

以上就是直播app源码,Flutter 弹窗组件实现的各种形式, 更多内容欢迎关注之后的文章 

 

posted @   云豹科技-苏凌霄  阅读(119)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示