Flutter 3.4 TextFormField onTop Rebuild State and clear data in Android only

Viewed 26

In my latest Flutter version when I tap on TextFormField the state keep rebuilding and I lose all data on form. it's happen only in Android Emulator and Real device. For IOS emulator and real device it's working fine .

I am using final _yob = TextEditingController(); in the top part of my stageful widget .

Is there any solution for that > I am kinda stuck for 2 weeks.

Any help will be highly appreciate.

1 Answers

Thanks for your prompt response.

After 2 weeks I identified the problem and fix it. It was the use of UniqueKey() in the parent widget. The UniqueKey() function force rebuilding the whole widget-tree on any event triggered by the child .

Related