favorite this post Flutter: Increase the power of your AppBar & SliverAppBar (AHMADABAD) hide this posting unhide

The flexible space widget is used to create a collapsing toolbar with an appbar effect.

To create a toolbar in a flutter developer make use of the well – known widget called AppBar and when you wish to have a dynamic toolbar that when you slide it shows the content which is used as a great widget known as SilverAppBar.

These widgets enable you to create a perfect and classic app and with flutter is very simple.

Now to modify the AppBar & SilverAppBar in a flutter

There are two cases and the first case goes;

If you wish to have an AppBar that is not jammed at the top of the screen as most of them do. But users wish to have a sidemenu and the AppBar response to the opening event of the sidemenu. This is what developers want to create with their own AppBar with the dimension that users want.

The issue is that the AppBar widget has a default size and it cannot be changed. When glancing the source code, you might see the parameters known as appBar from the Scafflod, and it accepts the Preferred size widget, and let’s check the source code of AppBar, and its found that it’s the only a statefulwidget that uses preferredsizewidget.

If its there already, you will have to create your own widget that uses preferredsizewidget.
  • do NOT contact me with unsolicited services or offers

post id: 6919047556


best of [?]