Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font size for CupertinoDatePicker in Flutter?

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.

like image 376
cosinus Avatar asked Mar 07 '19 18:03

cosinus


People also ask

How do I change font size in appbar flutter?

You can change the font size of text in a Text Widget using style property. Create a TextStyle object with fontSize and specify this object as style for Text Widget.


1 Answers

Another way to do this, is to wrap the CupertinoDatePicker in CupertinoTheme.

CupertinoTheme(
    data: CupertinoThemeData(
        textTheme: CupertinoTextThemeData(
            dateTimePickerTextStyle: TextStyle(
                fontSize: 16,
            ),
        ),
     ),
     child: CupertinoDatePicker(
          ...
like image 182
raffleberry Avatar answered Sep 16 '22 16:09

raffleberry