scroll_app_bar 0.2.0+1 scroll_app_bar: ^0.2.0+1 copied to clipboard
Hide or show app bar while scrolling. This package works without custom scroll view and slivers.
ScrollAppBar #
Hide or show app bar while scrolling. This package works without custom scroll views and slivers.
Why this package? #
This package has the same result of default way that use a custom scroll view widget with a floating sliver app bar.
So, why I should use this package?
Because default way don't works well in all cases. For example, if you have page views and list views inside of the pages.
This package grant you more control and you can use this in more cases. Also, you can use this widget in a scaffold app bar, that turns your code more simple.
PLUS:
- You can use a gradient background! 😊
- You can pin/unpin app bar
Usage #
Getting started #
Add scroll_app_bar
package to your project. You can do this following this steps.
Basic implementation #
First, you need a ScrollAppBarController
instance. If you need a custom ScrollController
, you can pass the instance on constructor.
final controller = ScrollAppBarController();
Now, you can use the ScrollAppBar
widget in a Scaffold
widget, and atach ScrollController
instance in your scrollable widget on body.
NOTE: Showing only essencial code. See example section to a complete implementation.
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: ScrollAppBar(
scrollAppBarController: controller,
title: Text("App Bar"),
),
body: ListView.builder(
controller: controller.scrollController,
itemBuilder: _listBuildItem,
),
);
}
Example #
See a complete example.