PersistState<T> constructor

PersistState<T>({
  1. required String key,
  2. String toJson(
    1. T s
    )?,
  3. FutureOr<T> fromJson(
    1. String json
    )?,
  4. PersistOn? persistOn,
  5. int? throttleDelay,
  6. bool catchPersistError = false,
  7. bool debugPrintOperations = false,
  8. IPersistStore? persistStateProvider,
  9. bool? shouldRecreateTheState,
})

State persistence setting.

Implementation

PersistState({
  required this.key,
  this.toJson,
  this.fromJson,
  this.persistOn,
  this.throttleDelay,
  this.catchPersistError = false,
  this.debugPrintOperations = false,
  this.persistStateProvider,
  this.shouldRecreateTheState,
}) {
  assert(T != dynamic && !isObjectOrNull<T>());
  fromJson ??= _getFromJsonOfPrimitive<T>();
  toJson ??= _getToJsonOfPrimitive<T>();
}