encode method
Converts a Serialisable list of items into a List<Map<String, dynamic>>.
The List has a fixed length if growable is false.
Implementation
List<Map<String, dynamic>> encode(
final Iterable<Serialisable> items, {
final bool growable = false,
}) {
return items.map((final Serialisable item) => item.toJson()).toList(growable: growable);
}