of static method

Return AppBarWithSearchSwitch in children of AppBarWithSearchFinder.

Note: there is a standard limitation:

Implementation

static AppBarWithSearchSwitch? of(BuildContext context) {
  final scaffold = Scaffold.maybeOf(context);
  if (scaffold != null &&
      scaffold.hasAppBar &&
      (scaffold.widget.appBar.runtimeType == AppBarWithSearchSwitch)) {
    return (scaffold.widget.appBar as AppBarWithSearchSwitch);
  }

  return null;
}