ancestor<TWidget extends ScopedWidgetBase> method
TWidget
ancestor<TWidget extends ScopedWidgetBase>()
O(1) out TWidget
in ancestor by passing BuildContext.
If TWidget
does not exist in the ancestor, an error is output.
BuildContextを渡して祖先にあるTWidget
をO(1)で取り出します。
祖先にTWidget
が存在しない場合はエラーが出力されます。
Implementation
TWidget ancestor<TWidget extends ScopedWidgetBase>() {
return ScopedWidgetScope.of(this);
}