list<T> static method
Creates a persistent list state container.
Implementation
static PersistroLightro<List<T>> list<T>(
String key, {
required List<T> initial,
required T Function(dynamic) fromJson,
bool autoSave = true,
}) {
return PersistroLightro<List<T>>(
key: key,
initial: initial,
decoder: (json) => List<T>.from(
jsonDecode(json).map((x) => fromJson(x)),
),
encoder: (value) => jsonEncode(value),
autoSave: autoSave,
);
}