findAncestorStateOfKey<T extends GlobalKey<State<StatefulComponent>>> method
T?
findAncestorStateOfKey<
T extends GlobalKey<State<StatefulComponent>>>( - String key
)
override
Implementation
@override
T? findAncestorStateOfKey<T extends GlobalKey<State<StatefulComponent>>>(
String key) {
var ancestor = _parent;
while (ancestor != null &&
!(ancestor is StatefulBinding &&
ancestor.state.key is T &&
ancestor.state.key.key == key)) {
ancestor = ancestor._parent;
}
return (ancestor as StatefulBinding?)?.state.key as T?;
}