Flutter is now days popular platform for creating mobile and desktop applications.In their docs We can customize the content inside the appbars but only problem is very difficult to make gradient color in app bar .So in this article we discuss about how to create gradient effect in app bar using a external library.
Love the material AppBar? Do you want to add more color to the appbar? Here’s a gradientAppBar.
It works just like the normal AppBar. Also with actions, back buttons, titles. So it’s just your normal AppBar, but with a twist.
- Depend on it by adding this to your pubspec.yaml file:
- Import it:
- Replace your current AppBar (In the scaffold) to GradientAppBar.
appBar: GradientAppBar( title: Text('Flutter'), gradient: LinearGradient(colors: [Colors.blue, Colors.purple, Colors.red]) ),