PrefsOption<T> constructor
Null safety
- String name,
- T value
Implementation
factory PrefsOption(String name, T value) {
if (value is bool) {
return BooleanOption(name, value) as PrefsOption<T>;
} else if (value is int) {
return IntegerOption(name, value) as PrefsOption<T>;
} else if (value is String) {
return StringOption(name, value) as PrefsOption<T>;
}
throw ArgumentError(
'Only `bool`, `int` and `String` are valid parameter types.');
}