Using shared_preferences in Flutter The counter reverts to 0 when the app is destroyed or closed. We’ll use SharedPreferences to persist the state of the counter so the counter value begins from where it was before the app was shut down. Let’s do it.
Read moreHow do I remove a value from SharedPreferences?
You can use preferences. edit(). remove(“key”). commit() to delete saved values from shared preferences.
Read moreHow do I delete all SharedPreferences data Kotlin?
To clear all the values in the shared preferences file, call the clear() method on the shared preferences editor and apply the changes .
Read more