I need to change the font size of CupertinoDatePicker so it looks more like native one. The font is small compared to ios datepicker.
For the height wrapping in a Container with height of MediaQuery.of(context).copyWith().size.height / 3
makes the height to be similar to native one.
Asked
Active
Viewed 8,218 times
8

cosinus
- 1,905
- 3
- 15
- 21
2 Answers
24
Another way to do this, is to wrap the CupertinoDatePicker
in CupertinoTheme
.
CupertinoTheme(
data: CupertinoThemeData(
textTheme: CupertinoTextThemeData(
dateTimePickerTextStyle: TextStyle(
fontSize: 16,
),
),
),
child: CupertinoDatePicker(
...

raffleberry
- 348
- 3
- 9
-
2if background doesn't change, you can add brightness. ```brightness: Theme.of(context).brightness,``` to CupertinoThemeData. – Paras khandelwal Jun 04 '20 at 12:55
-
https://stackoverflow.com/questions/72496007/change-text-color-of-cupertinotimerpicker how about this ? – Zuher Abud Said Jun 03 '22 at 23:32
4
Finally got it, works as expected.
DefaultTextStyle.merge(
style: TextStyle(fontSize: 20),
child: CupertinoDatePicker(....)
)

cosinus
- 1,905
- 3
- 15
- 21