Start a Project

SliverAppBar-class in flutter

In this blog, we will learn SliverAppBar-class in Flutter and check how it works.

Looking for the best Flutter app development company?

Introduction


In brief the SliverAppBar class in Flutter is a widget that provides a collapsible app bar for a scrollable list or grid. It is designed to be used with CustomScrollView any other widget that has a scrollable content area.

When a SliverAppBar is created, it occupies the top of the scrollable area and can be collapsed as the user scrolls down. By default, it displays a title, leading and trailing widgets, and a background color.
However, It can be customized to display more complex layouts, such as flexible spaces, tabs, and search fields.

Properties

Some of the important properties of the SliverAppBar class are:

Example

for example:

In conclusion to the above example, SliverAppBar has a title, leading and trailing icons, and an expanded height of 200 pixels with the background image.
Just Pass this CustomScrollView to the body of the Scaffold.

Result :

As a result, we will get the below screen.

Conclusion

In this blog, we learn about SliverAppBar-class in flutter. However, you can check more about SliverAppBar-class here.
Thanks for reading…

Exit mobile version