Commit 60ef3836 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #1133 from Hixie/TabBarSelectionState.of

Reimplement TabBarSelectionState.of() using new methods
parents 51d06647 892cc272
......@@ -409,15 +409,7 @@ class TabBarSelection<T> extends StatefulComponent {
TabBarSelectionState createState() => new TabBarSelectionState<T>();
static TabBarSelectionState of(BuildContext context) {
TabBarSelectionState result = null;
context.visitAncestorElements((ancestor) {
if (ancestor is StatefulComponentElement && ancestor.state is TabBarSelectionState) {
result = ancestor.state;
return false;
}
return true;
});
return result;
return context.ancestorStateOfType(const TypeMatcher<TabBarSelectionState>());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment