Returns the first mounted element whose widget key equals key, or null.
key
null
Element? firstByKey(Key key) { final matches = byKey(key); return matches.isEmpty ? null : matches.first; }