您可以调整初始日期的文本大小吗?如果是这样,怎么办?我发现它在手机大小的设备上太大了。
return showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
lastDate: DateTime.now().add(Duration(days: 356)),
builder: (context, child) {
return Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 50.0),
child: Container(
height: 450,
width: 700,
child: child,
),
),
],
);
},
);
我从https://stackoverflow.com/a/60037183/9554434借用了此示例代码。
尝试用ThemeData和TextTheme property包裹子项,并使用TextStyle更改字体大小,像这样
ThemeData(
textTheme: TextTheme(
body1: TextStyle(fontSize: 10.0), // <-- here you can do your font smaller
body2: TextStyle(fontSize: 8.0)
)
)