setup static method
Implementation
static Future<void> setup() async {
OdinConfiguration odinConfiguration = OdinConfiguration();
try {
String? source =
Database.getSharedPreferences().getString('odin_configuration');
if (source == null) {
await odinConfiguration.save();
_instance = odinConfiguration;
return;
}
dynamic data = jsonDecode(source);
String databaseVersion = data['databaseVersion'] ?? '';
if (odinConfiguration._databaseVersion != databaseVersion) {
await Database.getSharedPreferences().clear();
}
await odinConfiguration.save();
_instance = odinConfiguration;
} catch (_) {}
}