getWidgetHashCode function Null safety

int getWidgetHashCode(
  1. String name,
  2. [int index = 0]
)

Implementation

int getWidgetHashCode(String name, [int index = 0]) {
  var elems = getElementsByName(name, index + 1);
  if (index < elems.length) {
    var code = elems[index].widget?.widget?.hashCode;
    code ??= -1;
    return code;
  }
  return -1;
}