android - 如何检查按钮当前是否在颤动中处于活动状态?
问题描述
如何检查按钮当前是否在颤动中处于活动状态?下面是我要创建的按钮的图像:
[ ]
解决方案
Flutter 在 v1.9.1 中添加了切换按钮,它由一组按钮组成,回调返回哪个被选中
您可以查看链接:https ://api.flutter.dev/flutter/material/ToggleButtons-class.html
一个小例子
ToggleButtons(
children: <Widget>[
Icon(Icons.add),
Icon(Icons.car),
Icon(Icons.menu),
],
onPressed: (int index) {
//returned the selected index user chose
},
isSelected: isSelected,// which is a List<bool> that to define the selected button
),
推荐阅读
- bash - Bash - Regex Expression
- bash - 有一个 bash“while”循环,要么从 STDIN 读取行,要么调用函数
- python - 如何在 XML 文件中返回字典的值
- flutter - 必须将非空字符串提供给文本小部件
- python - Databricks Koalas 无法导入镶木地板文件
- javascript - 使用图表 js 限制数据点
- web - 如何在完全静态的网站中建立一个可以交互的房间
- graphql - 如何通过自省获得 graphql 突变的参数和类型?
- reactjs - reactjs一个onclick绑定错误,我能做什么?
- flutter - 在flutter中安装应用程序后如何更改应用程序名称和应用程序图标?