在构建Directionality(textDirection:ltr)时引发了以下NoSuchMethodError:在null上调用了'formatFullDate'方法。
RaisedButton.icon(
icon: Icon(Icons.date_range),
label: Text('Start'),
onPressed: () async {
var date = await showDatePicker(
context: context,
initialDate: DateTime.now(),
locale: Locale.fromSubtags(
countryCode: 'KE',
languageCode: 'EN',
),
firstDate: DateTime(2008),
useRootNavigator: true,
lastDate: DateTime.now(),
builder: (context, widget) => widget,
);
print(date);
},
),
答案 0 :(得分:0)
我意识到本地化是错误的。通过
对其进行了修复locale: Locale.fromSubtags(
countryCode: 'en',
languageCode: 'US',
),
答案 1 :(得分:0)
怎么样?
locale: Locale.fromSubtags(
countryCode: 'KE',
languageCode: 'en',
),