Skip to content

Scaffold and AppBar are very restrictive compared to other widgets #8970

Closed

Description

@ds84182

In a project I'm working on, I need to bind a stream to a TabBar using StreamBuilder... however I can't target just the TabBar because of extremely strict types.

The "bottom" parameter to AppBar only accepts AppBarBottomWidgets, the "appbar" parameter to Scaffold only accepts AppBars. If I wanted to have the TabBar update with some asynchronous computation, I would have to rebuild at the Scaffold (!!!) level, instead of rebuilding just the TabBar with the new tabs.

This was actually quite surprising to me, since I was getting really used to utilizing StreamBuilder for text and other layouts that can change at any time.

Activity

  1. Hixie commented on Mar 22, 2017

    @Hixie
    Contributor

    The Scaffold.appBar problem is #8648.

    AppBarBottomWidgets isn't a problem, whoever. You can easily make a widget that implemented AppBarBottomWidgets. It's just an interface that requires you to implement a bottomHeight getter that returns the number of vertical pixels you want the widget to take.

  2. abarth commented on Mar 27, 2017

    @abarth
    Contributor

    Also #4581

  3. added
    c: API breakBackwards-incompatible API changes
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Mar 27, 2017
  4. added this to the milestone on Mar 27, 2017
  5. eseidelGoogle commented on Mar 27, 2017

    @eseidelGoogle
    Contributor

    I'm not sure what to do with this bug? Does it need an API Stability label?

    Seems like a common-ish request to marking M3?

  6. modified the milestones: 2: Make Early Adopters happy, on Apr 12, 2017
  7. Hixie commented on Apr 12, 2017

    @Hixie
    Contributor

    Hans figured out the solution here with a brilliant piece of insight: we can just have a widget that implements this interface and that way anyone can wrap whatever crazy widget they want in this widget.

  8. HansMuller commented on Apr 12, 2017

    @HansMuller
    Contributor

    I will close this bug along with #9349, it's what Ian referred to and I'm working on it now.

  9. github-actions commented on Sep 5, 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.

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

Metadata

Metadata

Assignees

Labels

c: API breakBackwards-incompatible API changesframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions