listFrom static method
Reads a multiple reference (a list of expanded references) out of a
decoded record value. A single expanded reference gives a one-item
list; anything else (a plain id, a list of ids, null) gives an empty
list.
Implementation
static List<ExpandedReference> listFrom(Object? value) {
if (value is List) {
return [
for (final item in value)
if (maybeFrom(item) case final ref?) ref,
];
}
final single = maybeFrom(value);
return single == null ? const [] : [single];
}