context method

Object? context(
  1. String name
)

The first named context entry, decoded from JSON, or null when absent. Throws a FormatException when its value is not valid JSON.

Implementation

Object? context(String name) {
  for (final entry in _objects(raw[AgUiFields.context])) {
    if (entry
        case {
          AgUiFields.description: final String description,
          AgUiFields.value: final String value,
        }
        when description.startsWith('$name:')) {
      return jsonDecode(value);
    }
  }
  return null;
}