I tried to change the text color of CupertinoDatePicker
following this answer and it was successful but when i wanted to change the color of CupertinoTimerPicker
it did not change it i want the color of text to be white and the style to be same as the one below
showDialog(
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: const Color(0xff2e2e2e),
title: Column(
children: [
Text(
'Set Duration',
style: TextStyle(
color: Colors.white, fontSize: 16),
),
Divider(
height: 6,
color: Colors.white,
),
],
),
content: CupertinoTheme(
data: CupertinoThemeData(
brightness: Brightness.light,
textTheme: CupertinoTextThemeData(
dateTimePickerTextStyle: TextStyle(color: Colors.red),
),
),
child: CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.hms,
minuteInterval: 1,
secondInterval: 1,
initialTimerDuration: Duration(hours:0, minutes: 0, seconds: 0),
onTimerDurationChanged: (Duration changedTimer) {
setState(() {
initialTimer = changedTimer;
});
},
),
),
);
},
);
CupertinoTheme
– Inclose