updateValue method

void updateValue(
  1. String key,
  2. dynamic value
)

Update the given value for the given key in the storage.

The updated value is NOT persistent Throws an exception if the given value has not the same Type.

Implementation

void updateValue(String key, dynamic value) {
  if (appConfig[key] != null &&
      value.runtimeType != appConfig[key].runtimeType) {
    throw ("The persistent type of ${appConfig[key].runtimeType} does not match the given type ${value.runtimeType}");
  }
  appConfig.update(key, (dynamic) => value);
}