Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset flutter views when leaving flutter module inside native app

Tags:

ios

swift

flutter

I have to include a FlutterViewController as part of my native App. The Engine is created on app start. If the user clicks on an item in a native view the Flutter App opens and loads the data that it receives via some method channels.

Until here it is working. Now the user gets back to the native app and clicks on a different item. Now again the Flutter part is invoked, calls the method channels to get the needed infos to show and shows them.

The problem I'm facing now is, that when the user clicks on the second, third, ... item the flutter part opens and shows for a very short time the data of the old item, which is obviously not so good for the user experience.

My question now. Is there a way in Flutter or in the native part to kinda reset flutter in background, without destroying the flutter engine?

like image 361
Hons Avatar asked Feb 16 '26 18:02

Hons


1 Answers

After some experiments the solution was to natively react to the state and send a custom 'reset' through a methodchannel

like image 139
Hons Avatar answered Feb 18 '26 12:02

Hons



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!