You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scaffold and AppBar are very restrictive compared to other widgets #8970
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.
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.
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.
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.
Activity
Hixie commentedon Mar 22, 2017
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.
abarth commentedon Mar 27, 2017
Also #4581
eseidelGoogle commentedon Mar 27, 2017
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?
Hixie commentedon Apr 12, 2017
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.
HansMuller commentedon Apr 12, 2017
I will close this bug along with #9349, it's what Ian referred to and I'm working on it now.
github-actions commentedon Sep 5, 2021
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 -vand a minimal reproduction of the issue.