of static method
Return AppBarWithSearchSwitch in children of AppBarWithSearchFinder.
Note: there is a standard limitation:
- context should be inside of AppBarWithSearchFinder (belong to one of it children).
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;
}