| ElevatedButton | 凸起的按钮 |
|---|---|
| TextButton | 扁平化的按钮 |
| OutlinedButton | 线框按钮 |
| IconButton | 图标按钮 |
| ButtonBar | 按钮组 |
| FloatingActionButton | 浮动按钮 |
| InkWell | 可点击容器 |
| Divider | 分割线 |
| Row | 行 |
| Column | 列 |
| Warp | 流 |
圆形图片
ClipOval(child: Image.network("https://img2020.cnblogs.com/blog/1338189/202012/1338189-20201208222047944-989579474.png",//Image.asset('images/aa.jpg')height: 100,width: 100,fit: BoxFit.cover,),),
输入框数据绑定
var _username=new TextEditingController();...TextField(decoration: InputDecoration(//hintText: 'hint提示',icon: Icon(Icons.account_circle),labelText: '标签标题',border: OutlineInputBorder(),),//maxLines: 4,//4行文本框//obscureText: true, //密码框,maxLines必须为1controller: _username,//数据绑定onChanged: (value){print(this._username.text);},),
勾选框数据绑定
bool _flag=false;...//基础单控件Checkbox(value: _flag,activeColor: Colors.red, onChanged: (value){setState(() {this._flag=value!;});}),//列表形式控件CheckboxListTile(value: _flag,activeColor: Colors.red,onChanged: (value){setState(() {this._flag=value!;});},title: Text('标题文字'),subtitle: Text('二级标题文字'),secondary: Icon(Icons.help),selected: _flag,//选中高亮),
单选框数据绑定
var _sex;...//基础单控件Row(children: [Radio(value: 1,groupValue: this._sex,onChanged: (value){setState(() {this._sex=value;});}),Radio(value: 2,groupValue: this._sex,onChanged: (value){setState(() {this._sex=value;});}),],)//列表形式控件RadioListTile(title: Text('标题'),subtitle: Text('次标题'),secondary: Icon(Icons.help),selected: this._sex==1,//选中高亮value: 1,groupValue: this._sex,onChanged: (value){setState(() {this._sex=value;});}),RadioListTile(title: Text('标题'),subtitle: Text('次标题'),secondary: Icon(Icons.help),selected: this._sex==2,value: 2,groupValue: this._sex,onChanged: (value){setState(() {this._sex=value;});}),
开关数据绑定
bool _flag=false;...Switch(value: _flag, onChanged: (value){setState(() {this._flag=value;});}),
