mirrorsFieldResolver<T> function
T?
mirrorsFieldResolver<T>(])
Uses dart:mirrors
to read field names from items. If they are Maps, performs a regular lookup.
Implementation
T? mirrorsFieldResolver<T>(objectValue, String fieldName,
[Map<String, dynamic>? objectValues]) {
if (objectValue is Map) {
return objectValue[fieldName] as T?;
} else {
return reflect(objectValue).getField(Symbol(fieldName)).reflectee as T?;
}
}