Skip to content

setState might not update the widgets in showDrawer #604

@afandria

Description

@afandria

Sorry if this is sparse on details. I mainly want to determine if there is a bug with showDrawer or with the way I attempted to use it.

Yesterday, I attempted to use showDrawer with the 7be58b1 alpha branch of Flutter. The drawer appeared/dismissed correctly, and the widgets I put in the drawer were correct.

Unfortunately, I noticed that no matter how I attempted to change the state of what was drawn in the drawer, it would not re-render. In my case, I tried to put a Switch inside a DrawerItem to toggle debug mode for my app. I did confirm that the state did actually change, which led me to think that Flutter has a bug.

I was following the Stocks demo app quite closely, which uses a Drawer to toggle the user's market sentiment (Optimistic vs Pessimistic). However, I was assuming that the app's behavior would match the Sky Demo app in the Google Play Store. I only just realized that this app is actually 3 months old (last update August 25), so it is very possible that in that time, the Stocks example does not function as it did before.

I am currently unable to try running these examples (though I have found the instructions), so if someone else can run the Stocks app and determine whether the Optimistic/Pessimistic radio buttons update the drawer menu or not, that would be very helpful.

Otherwise, I will look into this more after the break.

Metadata

Metadata

Assignees

Labels

c: regressionIt was better in the past than it is nowframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions