This Package is simple implementation of a fadable app bar for flutter. A wrapper on flutter's AppBar() to create a fade effect on the app bar when scrolling. This is a very common effect in many apps and is missing from flutter's default widgets.
demo with material 3 and with material 2 respectively
- Fadable AppBar
- Customizable
- Easy to use
dependencies:
fadable_app_bar: ^0.1.0import 'package:fadable_app_bar/fadable_app_bar.dart';import 'package:fadable_app_bar/fadable_app_bar.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MainApp());
}
class MainApp extends StatelessWidget {
MainApp({Key? key}) : super(key: key);
final ScrollController _controller = ScrollController();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: FadableAppBar(
scrollController: _controller,
title: const Text('Fadable App Bar Demo'),
foregroundColor: Colors.white,
foregroundColorOnFaded: Colors.black,
backgroundColor: Colors.green,
),
body: ListView.builder(
controller: _controller,
itemCount: 100,
itemBuilder: (context, index) {
return ListTile(
style: ListTileStyle.drawer,
title: Text('Item $index'),
);
})),
);
}
}scrollControlleris the controller of the scrollable widget that the app bar is in.foregroundColorOnFadeis the color of the title and icons when the app bar is faded.fadeFactoris the factor by which the app bar fades. The higher the value, the slower the app bar fades.
Please file feature requests and bugs at the issue tracker.

