searchChildElementByKey method

ElementModel? searchChildElementByKey(
  1. Key key, {
  2. required bool isInModal,
})

Implementation

ElementModel? searchChildElementByKey(
  Key key, {
  required bool isInModal,
}) {
  ElementModel? result;
  context.visitChildElements((element) => result = _searchChildElementByKey(
        context.findRenderObject(),
        element,
        key,
        isInModal: isInModal,
      ));
  if (result == null) {
    return ElementModel.empty();
  }
  return result;
}