flutter 交互提示方式
交互提示方式dialog和snackbar
首先看看dialog的方式
new PopupMenuButton(
icon: new Icon(Icons.phone_iphone, color: Colors.blue,),
onSelected: (v){
showDialog<Null>(
context: context,
builder:(_){
return new AlertDialog(
content: new Text(v),
actions: <Widget>[
new FlatButton(
onPressed: () {
Navigator.of(_).pop();
},
child: new Text('确定')
)
]
);
}
);
}, itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
new PopupMenuItem<String>(
value: '选项一的值',
child: new Text('屏蔽这个问题')
),
new PopupMenuItem<String>(
value: '选项二的值',
child: new Text('取消关注')
),
new PopupMenuItem<String>(
value: '选项二的值',
child: new Text("举报")
)
] ),
snackbar
new PopupMenuButton(
icon: new Icon(Icons.phone_iphone, color: Colors.blue,),
//child: ImageIcon(AssetImage('images/wxzf.png'), size:20.0, color: Colors.blue,),
onSelected: (v){
final snackBar = new SnackBar(
content: new ListTile(leading: Icon(Icons.warning,color: Colors.red,),title: new Text(v),),
backgroundColor: Colors.blue,
duration: Duration(milliseconds: 2000),
); Scaffold.of(context).showSnackBar(snackBar);
}, itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
new PopupMenuItem<String>(
value: '选项一的值',
child: new Text('屏蔽这个问题')
),
new PopupMenuItem<String>(
value: '选项二的值',
child: new Text('取消关')
),
new PopupMenuItem<String>(
value: '选项二的值',
child: new Text("举报")
)
] ),
flutter 交互提示方式的更多相关文章
- 前端与后端数据交互的方式之ajax
前端与后端数据交互的方式之Ajax 对于前端学习而言,CSS+HTML+JavaScript的学习在自我学习的情况下掌握也不是很难,但是想要实现前后端的数据交互在没有指导的情况下学习会是一头雾水.接下 ...
- Ext表单提示方式:msgTarget
Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; Ext表单提示方式:msgTarget:有4中方式:qtip,t ...
- ansible 交互提示、tags和block
1.交互提示:使用关键字:vars_prompt 例:使用ansible的交互式功能创建用户和给定一个密码. --- - hosts: test50 remote_user: root vars_pr ...
- Flutter交互实战-即刻App探索页下拉&拖拽效果
前言 Flutter最近比较热门,但是Flutter成体系的文章并不多,前期避免不了踩坑:我这篇文章主要介绍如何使用Flutter实现一个比较复杂的手势交互,顺便分享一下我在使用Flutter过程中遇 ...
- rsync 远程同步 实时同步备份 两种免交互的方式实现实时备份
rsync 远程同步: 一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH.rsync主机同步 作用:做数据备份 备份方式: 完全备份 增量备份 ...
- SpringMVC之ajax+select下拉框交互常用方式
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 常用vue请求交互数据方式
几种 vue的数据交互形式 var that=this get请求 that.$http.get("1.txt").then(function(result){ console.l ...
- android ——悬浮按钮及可交互提示
一.悬浮按钮 FloatingActionButton是Design Support中的一个控件,它会默认colorAccent作为按钮的颜色,还可以给按钮一个图标. 这是没有图标的,这是有图标的. ...
- T100错误信息提示方式
例如: IF g_browser_cnt = THEN INITIALIZE g_errparam TO NULL LET g_errparam.extend = "" LET g ...
随机推荐
- 一图说明offsetTop、top、clientTop、scrollTop等
offsetParent:该属性返回一个对象的引用,这个对象是距离调用offsetParent的元素最近的(在包含层次中最靠近的),已进行过CSS定位的容器元素. 如果这个容器元素未进行CSS定位, ...
- Spark执行样例报警告:WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any resources
搭建Spark环境后,调测Spark样例时,出现下面的错误:WARN scheduler.TaskSchedulerImpl: Initial job has not accepted any res ...
- ubuntu scrapy 开发环境搭建
我的版本是14.04 1.更新系统 ##如果系统没有换国内下载路径需要换下系统的更新下载路径 http://www.cnblogs.com/seablog/p/7043798.html sudo a ...
- liunx系统环境下,爆出该错误"org.eclipse.wst.validation" has been removed解决办法
导出maven工程遇到的问题,"org.eclipse.wst.validation" has been removed,还以为是工程本身的问题,后来发现是eclipse的问题. ...
- PAT 1006 换个格式输出 C语言
让我们用字母B来表示“百”.字母S表示“十”,用“12...n”来表示个位数字n(<10),换个格式来输出任一个不超过3位的正整数.例如234应该被输出为BBSSS1234,因为它有2个“百”. ...
- Cockpit 服务化管理工具
Cockpit 是红帽开发的网页版图像化服务管理工具,优点是无需中间层,且可以管理多种服务. 根据其项目主站描述,Cockpit 有如下特点: 从易用性考虑设计,方便管理人员使用,而不是仅仅的终端命令 ...
- GCC用法
http://www.cnblogs.com/hibernate6/archive/2010/08/24/2522057.html
- HDU 1264 Counting Squares (线段树-扫描线-矩形面积并)
版权声明:欢迎关注我的博客.本文为博主[炒饭君]原创文章,未经博主同意不得转载 https://blog.csdn.net/a1061747415/article/details/25471349 P ...
- 系列文章--一步一步学Silverlight2
概述 由TerryLee编写的<Silverlight 2完美征程>一书,已经上市,在该系列文章的基础上补充了大量的内容,敬请关注.官方网站:http://www.dotneteye.cn ...
- Java变量类型之间的转换
int i; String s="134"; 1)String转换成int i=Integer.parseInt(s); 2)int转换成String(其他类型转String,都可 ...