getPropKey<T extends Map> function

String getPropKey<T extends Map>(
  1. void accessProp(
    1. T keySpy
    ),
  2. T factory(
    1. Map props
    )
)

Returns the string key of the factory prop accessed in accessProp.

Example:

var valuePropKey = getPropKey((props) => props.value, TextInput);

Implementation

String getPropKey<T extends Map>(void Function(T keySpy) accessProp, T Function(Map props) factory) {
  return _getKey((keySpy) {
    return accessProp(factory(keySpy));
  })! as String;
}