Closed nikhilbawane closed 3 years ago
Hello @nikhilbawane,
The "onSaved" method is not meant for what you describe (onDateSelected is the property you are looking for). If you look at the official documentation for the "onSaved" method, this is what you will find:
/// An optional method to call with the final value when the form is saved via /// [FormState.save].
Calling "formKey.currentState?.save()" for instance will trigger the DateTimeFormField to call onSaved.
To learn more about form key : Form Validation
I am closing this issue for now.
The function onSaved is not called when the date is selected or on tapping the OK button.
Reviewing the code I see that the constructor takes onSaved parameter, but isn't used anywhere in the code.
Ideally, I would expected it to return a value when the OK button is tapped.