refs property

List<String> get refs

Gets a list of references from the models in the list.

Example:

final models = {
  '1': Person(id: '1', name: 'John', age: 30),
  '2': Person(id: '2', name: 'Doe', age: 25),
};

final refs = models.refs;
print(refs); // ['ref:person/1', 'ref:person/2']

Output:

['ref:person/1', 'ref:person/2']

Implementation

List<String> get refs => [
  for (final item in values)
    if (item.ref != null) item.ref!,
];