In this tutorial, we will be implementing custom Flutter appbar color, understanding how to change the flutter appbar color, what is the default flutter appbar color and how to change it with our desired Flutter appbar color.
After reading this article, you’ll have a detailed knowledge of how to properly change background color of Flutter appbar widget.
Default Flutter Appbar Color
Scaffold( appBar: AppBar() )

Change Flutter Appbar Color
AppBar( backgroundColor: Colors.pink )

Transparent Flutter Appbar
AppBar( backgroundColor: Colors.transparent )

AppBar( elevation:0 backgroundColor: Colors.transparent )
AppBar( backgroundColor: Colors.transparent, elevation: 0, centerTitle: true, title: Text( 'Appbar', style: TextStyle(color: Colors.blue), ), )

Source Code
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Flutter Appbar Color', home: flutterAppbarColor()); } } class flutterAppbarColor extends StatefulWidget { @override State<flutterAppbarColor> createState() => _flutterAppbarColorState(); } class _flutterAppbarColorState extends State<flutterAppbarColor> { @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, leading: Container( margin: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(9.0), alignment: Alignment.center, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.pink, boxShadow: [ BoxShadow(blurRadius: 5, color: Colors.grey.shade800) ]), child: Icon(Icons.arrow_back_ios)), elevation: 0, title: Text( 'Appbar', style: TextStyle(color: Colors.pink, fontWeight: FontWeight.w900), ), actions: [ Container( margin: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0), decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.pink, boxShadow: [ BoxShadow(blurRadius: 5, color: Colors.grey.shade800) ]), child: Icon(Icons.chat)), Container( margin: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0), decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.pink, boxShadow: [ BoxShadow(blurRadius: 5, color: Colors.grey.shade800) ]), child: Icon(Icons.email)), Container( margin: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0), decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.pink, boxShadow: [ BoxShadow(blurRadius: 5, color: Colors.grey.shade800) ]), child: Icon(Icons.logout)), ]), ), ); } }
Conclusion
That’s it for this article in which we have understood Flutter appbar color customization with proper implementation. We would love to see you implement the mentioned beautiful Flutter appbar design in your code and share your experience with us using the comment section.
We’d be very glad to see you visit our other tutorials on Flutter app development and Python programming. Thank you for reading this article.