flutter控件之RadioButton
import 'package:flutter/material.dart';
class LearnRadioButton extends StatefulWidget{
@override
State<StatefulWidget> createState() {
return new _LearnRadioButton();
}
}
class _LearnRadioButton extends State<LearnRadioButton>{
int groupValue=;
@override
Widget build(BuildContext context) {
return new Scaffold(
body: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Radio(value: , groupValue: , onChanged: null),//onChanged为null表示按钮不可用
new Radio(
value: ,
groupValue: groupValue,//当value和groupValue一致的时候则选中
activeColor: Colors.red,
onChanged: (T){
updateGroupValue(T);
}
),
new Radio(
value: ,
groupValue: groupValue,
onChanged: (T){
updateGroupValue(T);
}
),
new Radio(
value: ,
groupValue: groupValue,
onChanged: (T){
updateGroupValue(T);
}
),
new Radio(
value: ,
groupValue: groupValue,
onChanged: (T){
updateGroupValue(T);
}
),
new Radio(
value: ,
groupValue: groupValue,
onChanged: (T){
updateGroupValue(T);
}
),
new Radio(
value: ,
groupValue: groupValue,
onChanged: (T){
updateGroupValue(T);
}
),
new RadioListTile(
value: ,
groupValue: groupValue,
title: new Text('小张'),
onChanged: (T){
updateGroupValue(T);
}),
new RadioListTile(
value: ,
groupValue: groupValue,
title: new Text('小林'),
onChanged: (T){
updateGroupValue(T);
}),
new RadioListTile(
value: ,
groupValue: groupValue,
title: new Text('小王'),
onChanged: (T){
updateGroupValue(T);
}),
new RadioListTile(
value: ,
groupValue: groupValue,
title: new Text('小红'),
onChanged: (T){
updateGroupValue(T);
})
],
),
);
} void updateGroupValue(int v){
setState(() {
groupValue=v;
});
} }
flutter控件之RadioButton的更多相关文章
- Android基础控件单选按钮RadioButton和Checkbox复选按钮的使用
1.相关简介 RadioButton需要和RadioGroup结合使用,在RadioGroup设置布局方式! Checkbox是单独使用,本文为了方便放在了RadioGroup中! 2.简单使用 方法 ...
- android学习日记03--常用控件checkbox/radiobutton
常用控件3.checkbox 复选框,确定是否勾选,点击一下勾选,点击第二下取消,当有一系列备选项时适合用checkbox控件,方便用户提交数据. 贴上例子Activity的java代码 packag ...
- 控件_RadioGroup&&RadioButton(单选按钮)和Toast
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&q ...
- flutter控件之ListView滚动布局
ListView即滚动列表控件,能将子控件组成可滚动的列表.当你需要排列的子控件超出容器大小,就需要用到滚动块. import 'package:flutter/material.dart'; cla ...
- Flutter 控件之 AppBar 和 SliverAppBar
AppBar 和 SliverAppBar 是纸墨设计中的 App Bar,也就是 Android 中的 Toolbar,关于 Toolbar 的设计指南请参考纸墨设计中 Toolbar 的内容. A ...
- C# 服务端控件 asp:RadioButton 选择选中值
1.服务端控件RadioButton <asp:RadioButton ID="rbNewUser" runat="server" GroupName=& ...
- flutter控件之ExpansionPanelList
import 'package:flutter/material.dart'; class LearnExpansionPanelList extends StatefulWidget{ @overr ...
- Flutter 控件之 Routes 和 Navigator. [PopupRoute]
一个 App 通常会有多个界面,每个界面实现不同的功能,并在多个界面之间跳转.在 Flutter 中多个界面的跳转是通过 Navigator 来实现的. 在 Flutter 中定义了一个 Overla ...
- flutter控件之CheckBox
import 'package:flutter/material.dart'; class LearnCheckBox extends StatefulWidget{ @override State& ...
随机推荐
- Andrew Ng机器学习第三章——线性回归回顾
一些概念: 向量:向量在矩阵中表示为只有一列的矩阵 n维向量:N行1列的矩阵. 利用矩阵计算可以快速实现多种结果的计算. 如下图,给出四个房子大小的样本,有四个假设函数对房子价格进行预测.构造下面的矩 ...
- 【HDU5126】 stars k-d树
题目大意:有$m$个操作,分两种:在指定三维坐标内加入一个点,询问指定空间内点的数量. 其中$m≤5*10^{4},1≤x,y,z≤10^9$ 这题几乎就是裸的$k-d$树啊.我们动态维护一棵$k-d ...
- POJ 2291
#include<iostream> #include<stdio.h> using namespace std; int compare(void const *,void ...
- POJ 2242
#include <iostream> #include <cmath> #include <iomanip> using namespace std; #defi ...
- System.Thread.TImer控件——http://www.360doc.com/content/11/0812/11/1039473_139824496.shtml
http://www.360doc.com/content/11/0812/11/1039473_139824496.shtml
- KBEngine 安装
其实这篇的内容官方文档都有, 但是既然打算记录一下学习笔记, 也就先从安装开始了. 一 下载源代码 进入github下载最新release的源码压缩包. windows选择zip, 下载完成之后右键解 ...
- CentOS 安装Scrapy
本文python版本是python3.5.3,关于升级python和安装pip请到:http://www.cnblogs.com/technologylife/p/6242115.html 安装相关包 ...
- (转) Linux(Centos7)yum安装最新mysql
原文:http://blog.csdn.net/gebitan505/article/details/54613549 环境 CentOS 7.1 (64-bit system) MySQL 5.6. ...
- pycharm 使用jupyter notebook 报错:'_xsrf' argument missing from POST
出问题的关键点就在: 我用cmd启动的jupyter notebook,然后用pycham新建了一个jupyter notebook 结果 一直报错'_xsrf' argument missing f ...
- 拦截并记录数据库操作-Logging and Intercepting Database Operations
原文:http://msdn.microsoft.com/zh-cn/data/dn469464 Logging and Intercepting Database Operations Starti ...