in ,

A Flutter Widget for an AppBar that is initially flush with elevated when scrolled

appbar_elevation

Scrolling is always an important component in Web design because of its features, functions, and role. It’s a very very special component. Besides the functions of the scroll, we must note that the initial flush is initially elevated when scrolled. 

The result I’m looking for is to always have a widget for it. When displaying the content, how do you elevate when scrolling? Here is a Flutter Widget for an AppBar that is initially flush but elevated when scrolled. It can help you. 

This is a Flutter Widget for an AppBar that is initially flush with the body and elevated when scrolled:

flutter widget

Usage

Use the ScrollActivatedAppBarElevation widget to wrap a Scaffold that contains
a Scrollable view (e.g. ListViewCustomScrollView). The widget uses a
NotificationListener to detect the scroll position and provides an
appBarElevation value to be used.

Example

Here is a simple example for you:

@override
Widget build(BuildContext context) {
  return ScrollActivatedAppBarElevation(
    builder: (BuildContext context, double appBarElevation) {
      return Scaffold(
        appBar: AppBar(
          elevation: appBarElevation,
        ),
        body: ListView(
          children: [
            // ...
          ],
        ),
      );
    },
  );
}

The complete code can be found in the example.

GitHub

https://github.com/amitkot/appbar_elevation

Written by James

Hide or show bottom navigation bar while scrolling with flutter

A flutter navigation by gestures and taps