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
Remove date or set back to empty #15
Comments
Hello @JandalZaheer, I am currently very busy. I will be able to fix that during the week of June 12. If you are in a rush you can create a pull request. I will make sure to review it as soon as you push it! |
You can just set the date to null and call the setState method. Since this is not an issue, I will now close it. |
@JandalZaheer @GaspardMerten I added a "clear" button to the input decoration of the form field. To actually clear the date, you need to get a hold of the final _formFieldStateKey = GlobalKey<FormFieldState>();
DateTime? myValue;
//...
DateTimeFormField(
key: _formFieldStateKey,
decoration: InputDecoration(
suffixIcon: myValue == null
? Icon(Icons.event_outlined)
: IconButton(
icon: const Icon(Icons.clear_outlined),
onPressed: () {
_formFieldStateKey.currentState!.didChange(null);
setState(() => myValue = null);
}),
),
mode: _dateTimeModes[uiValueType]!,
initialValue: widget.comparison.uiValue,
onDateSelected: (value) {
setState(() => myValue = value);
},
// ...
); |
ok thanks for help, really appreciate.
…On Wed, Sep 22, 2021 at 10:55 PM Gaspard Merten ***@***.***> wrote:
You can just set the date to null and call the setState method. Since this
is not an issue, I will now close it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQEZL7CFYWXTIYTRAAHXBY3UDIKAZANCNFSM45M52KOA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thanks for this solution ! Great plugin ! |
Hi
You got very good plugin for date time, I am facing an issue after adding date to field there is no way to remove or set it back to empty field. please help me on this
The text was updated successfully, but these errors were encountered: