8

I have CupertinoDatePicker in my application to selected date and time with this code :

formatColumn(
widget: Consumer<MainCalendarProvider>(
 builder: (_, mcProvider, __) => SizedBox(
 height: sizes.height(context) / 3.5,
child: CupertinoDatePicker(
initialDateTime: result['dateRevision'],
 minimumDate: result['dateRevision'],
use24hFormat: true,
onDateTimeChanged: (dateChange) {
mcProvider.setSelectedDateFromCupertinoDatePicker(  dateChange, );},
                                      ),
                                    ),
                                  ),
                                  title: 'Date Activity'),

Everything is work , until i added feature dark mode in my application. In mode dark mode text color CupertinoDatePicker still black , i want change this to white. In CupertinoDatePicker , only have backgroundcolor property. I already try change to Red,Blue,Green etc but the text still black.

How can i change this ?

Thank's.

enter image description here

4

2 回答 2

21

我想CupertinoTheme不会被 normal 覆盖Theme,这里是如何应用暗模式CupertinoDatePicker

CupertinoTheme(
    data: CupertinoThemeData(
        brightness: Brightness.dark,
     ),
     child: CupertinoDatePicker(
          ...
于 2020-11-22T01:40:26.500 回答
3

我不知道您是否在 中缺少某些样式Theme,但其中一种解决方案可能会奏效!

于 2020-03-13T14:08:48.963 回答