Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getter 'last' was called on null #81

Closed
gripzyyy opened this issue Jan 29, 2020 · 1 comment
Closed

The getter 'last' was called on null #81

gripzyyy opened this issue Jan 29, 2020 · 1 comment

Comments

@gripzyyy
Copy link

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
Copy link
Owner

没有指定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 /.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants