Skip to content

setState might not update the widgets in showDrawer #604

Closed

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.

Activity

  1. added
    c: regressionIt was better in the past than it is now
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Nov 27, 2015
  2. abarth commented on Nov 27, 2015

    @abarth
    Contributor

    This is a duplicate of #187. I can fix it for you.

    Sky Demo app in the Google Play Store

    Yeah, that demo is really old. We've unpublished it because we're no longer maintaining it.

    someone else can run the Stocks app

    The stocks app has the same bug. The issue is with how the showDrawer function takes its arguments. It needs to take a WidgetBuilder instead of a widget.

  3. self-assigned this
    on Nov 27, 2015
  4. abarth commented on Nov 27, 2015

    @abarth
    Contributor

    Hum... The fix isn't as simple as I thought it would be.

  5. abarth commented on Nov 27, 2015

    @abarth
    Contributor

    Fix in #605

  6. added 3 commits that reference this issue on Nov 27, 2015
    7f5c881
    1d195cb
  7. github-actions commented on Sep 7, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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