findWidget<T extends Widget> method
T?
findWidget<T extends Widget>()
Implementation
T? findWidget<T extends Widget>() {
for (var pageWrapper in _pageStack.reversed) {
final page = pageWrapper.pageOrNull;
if (page is MaterialPage && page.child is T) {
return page.child as T;
}
if (page is CupertinoPage && page.child is T) {
return page.child as T;
}
if (page is DialogPage && page.child is T) {
return page.child as T;
}
}
return null;
}