8

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.

cosinus
  • 1,905
  • 3
  • 15
  • 21

2 Answers2

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
4

Finally got it, works as expected.

DefaultTextStyle.merge(
      style: TextStyle(fontSize: 20),
      child: CupertinoDatePicker(....)
)
cosinus
  • 1,905
  • 3
  • 15
  • 21