getPropsByTestId function

Map? getPropsByTestId(
  1. dynamic root,
  2. String value, {
  3. String key = defaultTestIdKey,
})

Returns the props of the first descendant of root that has its key prop value set to value.

Returns null if no descendant has its key prop value set to value.

Implementation

Map? getPropsByTestId(dynamic root, String value, {String key = defaultTestIdKey}) {
  var instance = getByTestId(root, value, key: key);
  if (instance != null) {
    return getProps(instance);
  }

  return null;
}