operator [] method

Object? operator [](
  1. String key
)

Retrieves the value associated with the specified key. If the key does not exist, returns an empty string. If an onGet callback is defined, it is invoked with the retrieved value before returning it. key The key whose associated value is to be retrieved. Returns the value associated with the key, or an empty string if the key does not exist.

Implementation

Object? operator [](String key) {
  if (!fields.keys.contains(key)) {
    return '';
  }
  var value = fields[key];
  if (onGet != null) {
    value = onGet!(value);
  }
  return value;
}