- 允许不支持空安全的插件
--no-sound-null-safety 日期选择框-第三方
//28行格式化日期需安装date_formatDateTime _date=DateTime.now();_showDatePicker2(){DatePicker.showDatePicker(context,showTitleActions: true,minTime: DateTime(1999,1,1),maxTime:DateTime(2050,12,31),onChanged: (result){//更改时触发setState(() {this._date=result;print('onChanged');});},onConfirm: (result){//确认后触发setState(() {this._date=result;print('onConfirm');});},currentTime: _date,//默认时间locale: LocaleType.zh,);}...InkWell(child: Row(mainAxisAlignment: MainAxisAlignment.center,children: [Text("${formatDate(_date, [yyyy,'年',mm,'月',dd,'日'])}"),Icon(Icons.arrow_drop_down),],),onTap: _showDatePicker2,),
时间选择框-第三方
//24行格式化日期需安装date_formatDateTime _date=DateTime.now();_showTimePicker2(){DatePicker.showTimePicker(context,showTitleActions: true,onChanged: (result){//更改时触发setState(() {this._date=result;});},onConfirm: (result){//确认后触发setState(() {this._date=result;});},currentTime: _date,//默认时间locale: LocaleType.zh,);}...InkWell(child: Row(mainAxisAlignment: MainAxisAlignment.center,children: [Text("${formatDate(_date, [HH, ':', nn])}"),Icon(Icons.arrow_drop_down),],),onTap: _showTimePicker2,),
第三方时间控件datetime_picker的坑
//color: theme.backgroundColor ?? Colors.white,flutter_datetime_picker.dart 文件中的改为color: theme.headerColor ?? theme.backgroundColor,
轮播图、启动引导图
import 'package:flutter_swiper/flutter_swiper.dart';...安装flutter_swiper: ^1.1.6...List<Map> imgList=[{'url':"https://www.itying.com/images/flutter/1.png",},{'url':"https://www.itying.com/images/flutter/2.png",},{'url':"https://www.itying.com/images/flutter/3.png",}];...Swiper(itemCount: 3,itemBuilder: (BuildContext content,int index){return new Image.network(imgList[index]['url'],fit:BoxFit.fill,);},pagination: new SwiperPagination(),controller: new SwiperController(),);用于该插件暂未支持空安全,运行需要执行 flutter run --no-sound-null-safety生成apk需执行 flutter build apk --no-sound-null-safety其他该插件相关信息:https://github.com/best-flutter/flutter_swiper/blob/master/README-ZH.md
