I've been reading the tutorials etc. and I'm now implementing Shared Preferences to save variables between screens. In my app the user moves to and from items in a ListView widget, and may return to a particular screen, I need to save their activity there in case of that.
In Java on Android you would save to sharePrefs when the user exits an activity (screen) because it's a slow operation and saving each time a variable changes is not performant.
Is there a best practice time to save in flutter? How do you know a user is exiting a screen, and descending back to an earlier dart file?
Apologies if this is a turbo ignorant question.