validateSavedEncryptedSettingAndLoad method
- VoidCallback onLoadEncrypted
Validate saved encrypted setting and load if valid.
Implementation
Future<void> validateSavedEncryptedSettingAndLoad(
VoidCallback onLoadEncrypted,
) async {
final shouldLoad = await validateSavedEncryptedSetting(
mapSettings: mapSettings,
isLoggedIn: isLoggedIn,
allPlaces: allPlaces,
);
if (!shouldLoad) {
// Reset setting if validation failed.
if (!isLoggedIn) {
safeSetState(this, () {
mapSettings = mapSettings.copyWith(showEncryptedPlaces: false);
});
}
return;
}
// Load encrypted places.
onLoadEncrypted();
}