简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM