getValue<T> static method

Future getValue<T>(
  1. String key,
  2. T defaultValue
)

Implementation

static Future getValue<T>(String key, T defaultValue) async {
  if (defaultValue is int) {
    return readInt(key, defaultValue);
  } else if (defaultValue is bool) {
    return readBool(key, defaultValue);
  } else if (defaultValue is double) {
    return readDouble(key, defaultValue);
  } else if (defaultValue is String) {
    return readString(key, defaultValue);
  } else if (defaultValue is List<String>) {
    return readStringList(key);
  }
}