android – 日期/时间选择器颤振:OK / CANCEL按钮不可见

前端之家收集整理的这篇文章主要介绍了android – 日期/时间选择器颤振:OK / CANCEL按钮不可见前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
flutter中的日期选择器小部件以白色显示ok / cancel按钮,因此在白色背景中不可见.

_displayFromDate = await showDatePicker(
                    context: context,initialDate: now,firstDate: now,lastDate: now.add(new Duration(days: 30)),);

我尝试用主要的强调颜色更改页面主题为黑色.仍然不可见.按钮在那里,因为我可以点击它们,只是标题不可见.

[✓] Flutter (Channel master,v1.2.3-pre.67,on Mac OS X 10.13.6 17G5019,locale
    en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] Connected device (2 available)

enter image description here

解决方法

你需要覆盖 – buttonTheme:

theme: ThemeData(
            buttonTheme: ButtonThemeData(textTheme: ButtonTextTheme.accent),accentColor: Colors.black,primaryColor: Colors.black)

enter image description here

猜你在找的Flutter相关文章