findChildState<T extends State<StatefulComponent>> method

  1. @override
T? findChildState<T extends State<StatefulComponent>>()
override

Implementation

@override
T? findChildState<T extends State>() {
  var visiting = visitChildren(TreeVisitor<Binding>((visitor) {
    if (visitor.currentValue is StatefulBinding &&
        (visitor.currentValue as StatefulBinding).state is T) {
      visitor.stop();
    }
  }));

  return (visiting.result as StatefulBinding?)?.state as T?;
}