PrefsOption<T> constructor

PrefsOption<T>(
  1. String name,
  2. T value
)

Implementation

factory PrefsOption(String name, T value) {
  assert(value is bool || value is int || value is String);
  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>;
  }
  return null;
}