微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Flutter中自定义TimePicker小部件

如何解决如何在Flutter中自定义TimePicker小部件

enter image description here

如何从输入时间选择器小部件中更改Purple选择颜色,Purple边框颜色,时间文本颜色以及HourMinute颜色,似乎无法在{{ 1}}

解决方法

showTimePicker(
                  context: context,initialTime: TimeOfDay(hour: 10,minute: 47),builder: (context,child) {
                    return Theme(
                      data: ThemeData.light().copyWith(
                        colorScheme: ColorScheme.light(
                          // change the border color
                          primary: Colors.red,// change the text color
                          onSurface: Colors.purple,),// button colors 
                        buttonTheme: ButtonThemeData(
                          colorScheme: ColorScheme.light(
                            primary: Colors.green,child: child,);
                  },);

结果:

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。