setObject<T> method

  1. @override
Future<void> setObject<T>(
  1. String key,
  2. T value
)
override

Implementation

@override
Future<void> setObject<T>(String key, T value) {
  if (value is int) {
    return _preferences.setInt(key, value);
  }
  if (value is double) {
    return _preferences.setDouble(key, value);
  }
  if (value is bool) {
    return _preferences.setBool(key, value);
  }
  if (value is String) {
    return _preferences.setString(key, value);
  }
  throw Exception('No Implementation Found');
}