I am using CupertinoDatePicker in my application.
Container(
height: 200,
padding: const EdgeInsets.all(16.0),
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
minimumYear: DateTime.now().year,
onDateTimeChanged: (DateTime value) {
print(value);
},
)
The application is using the MaterialApp (MaterialTheme). Is there a way to change the background color of CupertinoDatePicker?
This is what I have tried (wrapping the CupertinoDatePicker around CupertinoTheme and set the color to black) and it's not working.
Container(
height: 200,
padding: const EdgeInsets.all(16.0),
child: CupertinoTheme(
data: CupertinoThemeData(
primaryColor: Colors.black),
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
minimumYear: DateTime.now().year,
onDateTimeChanged: (DateTime value) {
print(value);
},
),
),
)