operator [] method

dynamic operator [](
  1. String fieldName
)

Implementation

operator [](String fieldName) {
  final field = value.fields.firstWhere(
    (field) => field.name == fieldName,
    orElse: () => throw ArgumentError('Unknown field $fieldName'),
  );

  return field.value;
}