LocalSingleton<T> constructor
const
LocalSingleton<T> ({})
Local persistance container for singletons.
LocalSingleton will always save to the same base path and offers no variability; consider LocalValue when storing to different paths (ex. storing users by ID).
see LocalValue for explinations on toJson
fromJson
, and documentType
.
Implementation
const LocalSingleton(
{required this.id,
DocumentType? documentType,
T Function(Map<String, dynamic>)? fromJson,
Map<String, dynamic> Function(T)? toJson})
: super(
documentType: documentType,
fromJson: fromJson,
toJson: toJson,
localDataContainerCreator: LocalDataContainer.create);