Skip to content

Make Drawer stateful again - #605

Closed
abarth wants to merge 1 commit into
flutter:masterfrom
abarth:stateful_drawer
Closed

abarth wants to merge 1 commit into
flutter:masterfrom
abarth:stateful_drawer

Conversation

@abarth

@abarth abarth commented Nov 27, 2015

Copy link
Copy Markdown
Contributor

We need to pass a WidgetBuilder instead of a Widget to showDrawer so that
app-level setStates will trigger a rebuild of the drawer. This patch pulled a
refactoring of the global settings in the stocks app so that they were cleanly
owned by the StocksApp and referenced by pointer instead of from copies.

Fixes #604
Fixes #187

@abarth

abarth commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

@Hixie

We need to pass a WidgetBuilder instead of a Widget to showDrawer so that
app-level setStates will trigger a rebuild of the drawer. This patch pulled a
refactoring of the global settings in the stocks app so that they were cleanly
owned by the StocksApp and referenced by pointer instead of from copies.

Fixes flutter#604
Fixes flutter#187

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.

Put a comment in the callback block explaining what changed.

@Hixie

Hixie commented Nov 27, 2015

Copy link
Copy Markdown
Contributor

Make the drawer in the stock demo have some UI mutate a state that is specific to the stock home state (e.g. color of the FAB). If I read the patch correctly, it won't update right.

@abarth

abarth commented Nov 27, 2015

Copy link
Copy Markdown
Contributor Author

If I read the patch correctly, it won't update right.

That's correct. To make that work, I think I'll need to give the Drawer to the Scaffold so that it will be below the StockHome in the hierarchy. We'll probably want to do that eventually anyway for tablet UI. I'll give it a try here.

@abarth abarth closed this Dec 3, 2015
@abarth
abarth deleted the stateful_drawer branch December 3, 2015 07:57
@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.

setState might not update the widgets in showDrawer Drawers and popup menus are no longer stateful

2 participants