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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Another way to do this, is to wrap the CupertinoDatePicker
in CupertinoTheme
.
CupertinoTheme(
data: CupertinoThemeData(
textTheme: CupertinoTextThemeData(
dateTimePickerTextStyle: TextStyle(
fontSize: 16,
),
),
),
child: CupertinoDatePicker(
...
回答2:
Finally got it, works as expected.
DefaultTextStyle.merge(
style: TextStyle(fontSize: 20),
child: CupertinoDatePicker(....)
)