I'm using the following (snippet) to remove items from my app state...
FFAppState().waypointCache.removeWhere((item) => item.regionName == regionName);
Which works fine while you're running the app, but does not persist the changes if you restart the app. So I switched to using this...
final cache = FFAppState().waypointCache;
for (int i = cache.length - 1; i >= 0; i--) {
if (cache[i].regionName == regionName) {
FFAppState().removeFromWaypointCache(cache[i]);
}}
Which explicitly calls the removeFromWaypointCache function.
My question really is, is there any way of using removeWhere and having that persist? Just so I don't have to loop through all the waypointCache.
Thanks in advance.