setDouble method

Future<void> setDouble(
  1. String key,
  2. double value
)

Stores a double value in SharedPreferences.

  • key: The key for the double value to be stored.
  • value: The double value to store.

Implementation

Future<void> setDouble(String key, double value) async {
  await ensureSharedPrefIsInitialized();
  if (doubleKeys.containsKey(key)) {
    await prefs.setDouble(key, value);
  } else {
    throw Exception("Key '$key' is not implemented as double.");
  }
}