Skip to content

Make TabBarSelection a widget - #1007

Merged
HansMuller merged 2 commits into
flutter:masterfrom
HansMuller:revise_tabbar_selection
Dec 22, 2015
Merged

HansMuller merged 2 commits into
flutter:masterfrom
HansMuller:revise_tabbar_selection

Conversation

@HansMuller

Copy link
Copy Markdown
Contributor

TabBarSelection is now expected to be an ancestor of its TabBar and TabBarView.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd call this just "page wrapper builder" or something. There's nothing actually tab-specific about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll change that. At some point I think it would be worth revisiting the WidgetDemo and GalleryPage types. They don't work well for demoing tabs, toolbars, etc.

@HansMuller
HansMuller force-pushed the revise_tabbar_selection branch from e666199 to 29bd89c Compare December 22, 2015 00:30
@HansMuller HansMuller changed the title Convert TabBarSelection to an InheritedWidget Make TabBarSelection a widget Dec 22, 2015
@HansMuller

Copy link
Copy Markdown
Contributor Author

TabBarSelection no longer creates an InheritedWidget.

Descendants now add themselves as performance listeners with TabBarSelection.registerPerformanceListener() and remove themselves with TabBarSelection.unregisterPerformanceListener(). If the TabBarSelection is deactivated, the listeners are automatically unregistered and the listener's handleDeactivate() method is called.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since classes can't extend this one (they can only implement it) I think we should make the functions abstract (replace the bodies with just a semicolon). Should be a no-op in principle.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm actually I guess using with like you do it, they could. I think I'd still go with 'implements', but your call.

@Hixie

Hixie commented Dec 22, 2015

Copy link
Copy Markdown
Contributor

LGTM, but if you don't add tests here we should at least file a bug for adding tests. And definitely file a bug about the insertion case if you don't test it and/or fix it.

@HansMuller

Copy link
Copy Markdown
Contributor Author

I've filed two issues related to this CL:

Inserting a TabBarSelection doesn't cause its descendants to rebuild
#1017

The TabBarSelection listener machinery needs a test
#1018

@HansMuller
HansMuller force-pushed the revise_tabbar_selection branch from e06dae7 to 6178fdf Compare December 22, 2015 22:13
HansMuller pushed a commit that referenced this pull request Dec 22, 2015
Make TabBarSelection a widget

TabBarSelection is now expected to be an ancestor of its TabBar and TabBarView.
@HansMuller
HansMuller merged commit a9ddbb4 into flutter:master Dec 22, 2015
@HansMuller
HansMuller deleted the revise_tabbar_selection branch December 22, 2015 22:24
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants