appbar elevation
a flutter widget for an appbar that is initially flush with the body and elevated when scrolled.
usage
use the scrollactivatedappbarelevation
widget to wrap a scaffold that contains
a scrollable view (e.g. listview
, customscrollview
). the widget uses a
notificationlistener to detect the scroll position and provides an
appbarelevation
value to be used.
example
@override
widget build(buildcontext context) {
return scrollactivatedappbarelevation(
builder: (buildcontext context, double appbarelevation) {
return scaffold(
appbar: appbar(
elevation: appbarelevation,
),
body: listview(
children: [
// ...
],
),
);
},
);
}
see example for full code.
Comments are closed.