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
Clearing form field #12
Comments
Clearing the field, by pressing the "X" icon, does trigger |
I've not specified a controller but will try that next. After further investigation this doesn't seem to reveal itself on Android, only on iOS. Entering a date triggers, changing a date triggers, but clearing with the "X" button after does not. Widget buildDatePicker() {
Widget dp = Container(
padding: EdgeInsets.fromLTRB(0, 50.0, 0, 0),
child: Row(
children: <Widget>[
new Flexible(
child: DateTimePickerFormField(
editable: false,
lastDate: DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day, DateTime.now().hour + 2),
format: dateFormat,
dateOnly: true,
decoration: InputDecoration(
prefixIcon: Icon(FontAwesomeIcons.calendar),
labelText: 'Date',
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black))),
onChanged: (dt) {
print(dt);
if (dt != null) {
dateRoch = dt.millisecondsSinceEpoch;
}
},
)),
],
),
);
return dp;
} |
From looking at the relevant lines, I am guessing maybe iOS doesn't allow |
you can user a controller instead (didn't test it yet with this plugin)
|
I'll try the controller when I get a chance. I'll close this issue if all is working as expected. |
Clearing form field doesn't trigger onChanged so if setting a value there it sticks. Should onChanged be triggered for clearing form field or is there another way to clear value?
The text was updated successfully, but these errors were encountered: