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的更多相关文章

  1. Android基础控件单选按钮RadioButton和Checkbox复选按钮的使用

    1.相关简介 RadioButton需要和RadioGroup结合使用,在RadioGroup设置布局方式! Checkbox是单独使用,本文为了方便放在了RadioGroup中! 2.简单使用 方法 ...

  2. android学习日记03--常用控件checkbox/radiobutton

    常用控件3.checkbox 复选框,确定是否勾选,点击一下勾选,点击第二下取消,当有一系列备选项时适合用checkbox控件,方便用户提交数据. 贴上例子Activity的java代码 packag ...

  3. 控件_RadioGroup&&RadioButton(单选按钮)和Toast

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&q ...

  4. flutter控件之ListView滚动布局

    ListView即滚动列表控件,能将子控件组成可滚动的列表.当你需要排列的子控件超出容器大小,就需要用到滚动块. import 'package:flutter/material.dart'; cla ...

  5. Flutter 控件之 AppBar 和 SliverAppBar

    AppBar 和 SliverAppBar 是纸墨设计中的 App Bar,也就是 Android 中的 Toolbar,关于 Toolbar 的设计指南请参考纸墨设计中 Toolbar 的内容. A ...

  6. C# 服务端控件 asp:RadioButton 选择选中值

    1.服务端控件RadioButton <asp:RadioButton ID="rbNewUser" runat="server" GroupName=& ...

  7. flutter控件之ExpansionPanelList

    import 'package:flutter/material.dart'; class LearnExpansionPanelList extends StatefulWidget{ @overr ...

  8. Flutter 控件之 Routes 和 Navigator. [PopupRoute]

    一个 App 通常会有多个界面,每个界面实现不同的功能,并在多个界面之间跳转.在 Flutter 中多个界面的跳转是通过 Navigator 来实现的. 在 Flutter 中定义了一个 Overla ...

  9. flutter控件之CheckBox

    import 'package:flutter/material.dart'; class LearnCheckBox extends StatefulWidget{ @override State& ...

随机推荐

  1. 2019年北航OO第一次博客总结

    一.基于度量对程序结构的分析 1. 第一次作业 1.1 基于类的分析的度量 首先,基于类的属性个数,方法个数,每个方法的规模,每个方法的控制分支数目,类总代码规模等特征对本次作业的结构进行分析. 1. ...

  2. 维特比算法(Viterbi)-实例讲解(暴力破解+代码实现)

    1.简介 维特比算法是一个通用的求序列最短路径的动态规划算法,也可以用于很多其他问题,比如:文本挖掘.分词原理.既然是动态规划算法,那么就需要找到合适的局部状态,以及局部状态的递推公式.在HMM中,维 ...

  3. 【数组】4Sum

    题目: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = ...

  4. AttrContext

    info属性类型为AttrContext或AttrContextEnv.主要看AtrContext即可.定义了如下关键参数: /** Contains information specific to ...

  5. Chapter 3 Phenomenon——15

    "So, what's the verdict?" he asked me. “所以,你的结论是什么?”他问我. “那么,他们对你的判决是?”他问我. "There's ...

  6. CentOS7安装SaltStack的踩坑经历

    虚拟机镜像:centOS7 minion 版本 软件版本: salt-master-2017.7.2-1.el7.noarchsalt-minion-2017.7.2-1.el7.noarchsalt ...

  7. Nodejs学习笔记(一)—简介及安装Node.js开发环境

    一.简介 Node.js是让Javascript脱离浏览器运行在服务器的一个平台,不是语言: Node.js采用的Javascript引擎是来自Google Chrome的V8:运行在浏览器外不用考虑 ...

  8. CSS3设置Table奇数行和偶数行样式

    table:.myTable tr:nth-child(even){ //偶数行 background:#fff;}.myTable tr:nth-child(odd){ //奇数行 backgrou ...

  9. Socket编程 - 网络基础知识

    API编程部分:http://www.cnblogs.com/Jimmy1988/p/7895213.html 1. 协议简介 此处,我们主要介绍Linux编程常用的三种协议(TCP/UDP/IP), ...

  10. vue-cli中引入jquery

    vue-cli 在引入bootstrap时总是报找不到jquery.(模板用的webpack) 在webpack.base.conf.js里加入 var webpack = require(" ...