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

value is not updating after setState #11

Open
diaodiallo opened this issue Jul 12, 2022 · 0 comments
Open

value is not updating after setState #11

diaodiallo opened this issue Jul 12, 2022 · 0 comments

Comments

@diaodiallo
Copy link

Hi All,
I have a problem of refreshing my DateTimeFormField after a setState update, do someone having the same problem or I am just missing the right code?

Here is my code:
DateTimeFormField( initialValue: myInitialValue, decoration: const InputDecoration( suffixIcon: Icon(Icons.event_note), labelText: 'Time line', ), mode: DateTimeFieldPickerMode.date, onDateSelected: (DateTime value) { myInitialValue = value; }, ),
Then hope to see the date changing after a:
setState(() { myInitialValue = value; });

I was hoping to have something like a controller here but can't find it.

Thanks in advance

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

1 participant