摘要: SimpleDialog和AlertDialog本身都是一个Widget,使用时需要通过showDialog方法来展示 // 展示SimpleDialog showDialog( //展示Dialog的方法 context: context, builder: (context) { return 阅读全文
posted @ 2020-03-13 15:54 lai1322 阅读(553) 评论(0) 推荐(0)
摘要: CupertinoPicker( backgroundColor: Colors.white, //选择器背景色 itemExtent: 30, //item的高度 onSelectedItemChanged: (index) { //选中item的位置索引 print("index = $inde 阅读全文
posted @ 2020-03-13 15:53 lai1322 阅读(3266) 评论(0) 推荐(0)
摘要: CupertinoTimerPicker( mode: CupertinoTimerPickerMode.hms, //可以设置时分、时分秒和分秒三种模式 initialTimerDuration: Duration(hours: 1, minutes: 35, seconds: 50), // 默 阅读全文
posted @ 2020-03-13 15:51 lai1322 阅读(1076) 评论(0) 推荐(0)
摘要: CupertinoDatePicker( mode: CupertinoDatePickerMode.date, //日期时间模式,此处为日期模式 onDateTimeChanged: (dateTime) { //日期改变时调用的方法 if (dateTime == null) { return; 阅读全文
posted @ 2020-03-13 15:50 lai1322 阅读(2160) 评论(0) 推荐(0)
摘要: showTimePicker( context: context, initialTime: TimeOfDay.now(), //初始化显示时间 ).then((timeOfDay) { //选择时间后点击OK拿到的时间结果 if(timeOfDay == null) { return; } pr 阅读全文
posted @ 2020-03-13 15:49 lai1322 阅读(501) 评论(0) 推荐(0)
摘要: showDatePicker( context: context, initialDate: DateTime.parse("20181209"), //初始选中日期 firstDate: DateTime.parse("20181109"), //可选日期范围第一个日期 lastDate: Dat 阅读全文
posted @ 2020-03-13 15:47 lai1322 阅读(548) 评论(0) 推荐(0)
摘要: Map<String, Text> map = {'apple': Text('Apple'), 'orange': Text('Orange'), 'banana': Text('Banana')}; String _fruit = 'apple'; CupertinoSegmentedContr 阅读全文
posted @ 2020-03-13 15:44 lai1322 阅读(787) 评论(0) 推荐(0)
摘要: CupertinoSlider( value: _sliderValue, // 当前滑块定位到的值 onChanged: (val) { // 滑动监听 setState(() { // 通过setState设置当前值 _sliderValue = val; }); }, onChangeStar 阅读全文
posted @ 2020-03-13 15:43 lai1322 阅读(181) 评论(0) 推荐(0)
摘要: bool _switchChecked = true; CupertinoSwitch( value: true, //开关值 ), CupertinoSwitch( value: false, ), CupertinoSwitch( value: _switchChecked, onChanged 阅读全文
posted @ 2020-03-13 15:42 lai1322 阅读(225) 评论(0) 推荐(0)
摘要: double _sliderValue = 0.3; Slider( value: _sliderValue, // 当前滑块定位到的值 onChanged: (val) { // 滑动监听 setState(() { // 通过setState设置当前值 _sliderValue = val; } 阅读全文
posted @ 2020-03-13 15:41 lai1322 阅读(181) 评论(0) 推荐(0)