toJson method
Returns data as an encodable object compatible with json.encode()
.
For data arrays the type of the returned value is Iterable<Object?>
, and
for data objects Map<String, Object?>
.
Implementation
@override
Iterable<Object?> toJson() => list;