RxPersistStringList constructor

RxPersistStringList(
  1. String key,
  2. List<String> initial
)

Rx persistent class, with the persistent key of _persistKey.

Default value to initial if the persistent storage returns null.

Implementation

RxPersistStringList(String key, List<String> initial)
    : assert(_isPersistenceInit,
          'Persistent storage did not initialize, please use initGlobalPersist() in main()'),
      // For collections, needs to clone the initial collection to the _default value.
      super(key, [...initial]) {
  _value = _sharedPreferences.getStringList(_persistKey) ?? initial;
}