setPersistSelection method
Changes the persist mode at runtime.
- Setting to
true: saves the current environment immediately so the next launch restores it. - Setting to
false: clears the stored selection so the next launch always starts fromdefaultEnv; future switches are not saved.
Implementation
Future<void> setPersistSelection(bool persist) async {
_persistSelection = persist;
if (persist) {
await _store.save(current.name);
} else {
await _store.clear();
}
}