getValue static method
Implementation
static Object getValue(KV key, Object value) {
switch (value.runtimeType) {
case const (String):
return preference.getString(key.name) ?? value;
case const (bool):
return preference.getBool(key.name) ?? value;
case const (int):
return preference.getInt(key.name) ?? value;
case const (double):
return preference.getDouble(key.name) ?? value;
case const (List<String>):
return preference.getStringList(key.name) ?? value;
default:
return value;
}
}