findAncestorStateOfType<T extends State<StatefulComponent>> abstract method

T? findAncestorStateOfType<T extends State<StatefulComponent>>()

Returns the State object of the nearest ancestor StatefulComponent component that is an instance of the given type T.

Calling this method is relatively expensive (O(N) in the depth of the tree). Only call this method if the distance from this component to the desired ancestor is known to be small and bounded.

Implementation

T? findAncestorStateOfType<T extends State>();