Skip to content

Need Support to Trigger Actions on Navigate back to App Screen Without Full Reload #2004

@ridsashabbir

Description

@ridsashabbir

If your app has a Bottom Navbar and you navigate from the App screen to another screen, then come back to the App screen, any actions you want to perform when returning won't automatically happen. To make them work, you currently have to reload the entire App screen by setting the selectedIndex on the Bottom Navbar — this triggers loading states and API calls again.

Ideally, there should be a way to simply update the necessary storage or perform specific actions when navigating back to the App screen, without needing to reload the entire screen.

Here is an example of it:
https://studio.ensembleui.com/app/HdjSahrGywFw8ov2dHRB/screen/VPZYeaqNTHs6hhuSHfDv

in the above example, we have App screen with Bottom Navbar, click on the + icon in center, it will open a BottomSheet, click any button Favorite from there, increment the value of ensemble.storage.currenValue from there, navigate back should return you the updated value, which is not working for now
Now open this bottomSheet again and click Home from there, increment value and navigate back from there, it will give you the updated value with reload of the App we want to update this without triggering the reload, see the CreatePostModal widget for code reference

Issue: When you open the bottomSheet from the + icon in Bottom Navbar, it will take you to a specific screen to perform an action, but it will dismiss the bottomSheet first then navigate you to the other screen (you can see the value being printed in the console) i want to trigger it when i return back to the App screen without reloading
Now, go to the CreatePostModal widget, here you can see that we are navigating user to the App screen manually to force update the storage that is leading to reload of the App

Possible Fix: Support a new action which will update the storage variable onNavigateBack to the App screen to prevent reload and to update the storage variable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions