toValue method
Converts this sequence to a native Dart value:
nullif empty- the unwrapped value if single item
- a
Listof unwrapped values otherwise
Implementation
Object? toValue() {
if (isEmpty) return null;
if (length == 1) return first.toValue();
return [for (final item in this) item.toValue()];
}