dylanwuzh / flutter-cupertino-date-picker

Flutter cupertino style date picker.
Apache License 2.0
362 stars 417 forks source link

The getter 'last' was called on null #81

Closed gripzyyy closed 4 years ago

gripzyyy commented 4 years ago

Hi! In a widget in an onPressed i use

DatePicker.showDatePicker(context, dateFormat: 'HH/mm/ss');

When I press the button I get this error: The following NoSuchMethodError was thrown building DatePickerWidget(dirty, state: _DatePickerWidgetState#7c286): The getter 'last' was called on null. Receiver: null Tried calling: last The relevant error-causing widget was MaterialApp When the exception was thrown, this was the stack

0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)

1 _DatePickerWidgetState._renderDatePickerColumnComponent

2 _DatePickerWidgetState._renderDatePickerWidget.

4 _DatePickerWidgetState._renderDatePickerWidget

dylanwuzh commented 4 years ago

没有指定pickerMode,默认是 DateTimePickerMode.datedateFormat 的值不合法,H、m、s 之间的分隔符不包括 "/",v1.0.23版本新增了pickerMode的校验,并且添加了分隔符 "/" No pickerMode is specified, the default is DateTimePickerMode.date, the value of dateFormat is invalid, and the separator between H, m, and s does not include"/", pickerMode verification is added in v1.0.23, and a separator is added /.