from static method
Helper to parse from int or String.
Implementation
static PersistMode? from(dynamic value) {
if (value is PersistMode) return value;
if (value is int) {
for (final e in PersistMode.values) {
if (e.id == value) return e;
}
return null;
}
if (value is String) {
for (final e in PersistMode.values) {
if (e.name == value) return e;
}
return null;
}
return null;
}