of static method
Reads the flat <field>.__media sibling off record. Null when the
field carries no such sibling (not a medialibrary field, or the field
is simply absent from this record) or the sibling is not a list — both
read as "nothing to show" rather than a parse failure, since a screen
with no media field configured is the ordinary case, not an error one.
Implementation
static MediaSet? of(ResourceRecord record, String field) {
final raw = record.get<List<dynamic>>('$field.__media');
if (raw == null) return null;
return MediaSet.fromJson(raw, '$field.__media');
}