• Home
  • Flutter
    • All
    • App Templates
    • Designs
    • Resources
    • Widgets
    Quizlet Alternative AI: Study Notes to Flashcards

    Quizlet Alternative AI: Study Notes to Flashcards

    StickerAI

    StickerAI: AI Sticker Maker for iOS

    plants selling ui design

    Plants Selling Flutter UI App Design

    7 Best Flutter Repositories on GitHub

    7 Best Flutter Repositories on GitHub

    flutter ecommerce templates

    Top 8 Ecommerce Flutter App Templates

    best-flutter-ui-kits

    10 Best Flutter UI Kits

    AI image generator app - featured image.

    Create an AI Image Generator In Flutter, Clean Architecture Part 2

    Create an ai image generator in flutter

    Create an AI Image Generator In Flutter, Clean Architecture Part 1

    How To Create a Custom AppBar In Flutter

    How To Create a Custom AppBar In Flutter

  • My Apps
  • Recommendations
  • Backend
  • How-To-Guides
  • General
No Result
View All Result
Yassine Benkhay
  • Home
  • Flutter
    • All
    • App Templates
    • Designs
    • Resources
    • Widgets
    Quizlet Alternative AI: Study Notes to Flashcards

    Quizlet Alternative AI: Study Notes to Flashcards

    StickerAI

    StickerAI: AI Sticker Maker for iOS

    plants selling ui design

    Plants Selling Flutter UI App Design

    7 Best Flutter Repositories on GitHub

    7 Best Flutter Repositories on GitHub

    flutter ecommerce templates

    Top 8 Ecommerce Flutter App Templates

    best-flutter-ui-kits

    10 Best Flutter UI Kits

    AI image generator app - featured image.

    Create an AI Image Generator In Flutter, Clean Architecture Part 2

    Create an ai image generator in flutter

    Create an AI Image Generator In Flutter, Clean Architecture Part 1

    How To Create a Custom AppBar In Flutter

    How To Create a Custom AppBar In Flutter

  • My Apps
  • Recommendations
  • Backend
  • How-To-Guides
  • General
No Result
View All Result
Yassine Benkhay
No Result
View All Result

How To Change AppBar Color In Flutter(2 Ways)

Yassine BENKHAY by Yassine BENKHAY
July 23, 2023
in How-To-Guides, Widgets
1
Change AppBar Color in Flutter
Share on FacebookShare on Twitter

Table of Contents

  • 1. The first way to change appbar color
  • 2. Change appbar color globally: Second Way
  • 3. The result
  • 4. Conclusion

Many times when working on a Flutter app design you need to change the appbar widget color. The appbar widget is one of the most used Flutter widgets, It allows you to identify the page’s titles, and it contains the toolbar and buttons such as the leading button and action button. In this tutorial, we will learn how to change appbar color in Flutter in two ways. so without further ado let’s get right into it.

01
of 04
The first way to change appbar color

For a small application like this Flutter app UI design, you can change the appbar color by locating the file where you have the appbar widget and then setting the backgroundColor property to a desired color such as Colors.green like so:

AppBar(
          title: Text('Home'),
          backgroundColor: Colors.green, //<---Set the desired color here like my branding color #000132
        ),

If you have a specific color pallet and you want to use hex color codes then set the backgroundColor with Color(0xff000132). We always add the 0xff then our hex code of the color.

using this approach will make you set up the appbar color for each screen you add, to not repeat yourself there is a better way which is to change the appbar color globally at the app level, this way you change the appbar color in one place and it gets changed in the whole application no matter how many screens you have.

02
of 04
Change appbar color globally: Second Way

to change the appbar color globally you first locate the MaterialAppwidget, add the theme property, and assign the ThemeData class to it.

inside the themeData add the appBarTheme property and assign the AppBarTheme class to it, which will have the color property as follows:

MaterialApp(
  theme: ThemeData(
    primarySwatch: Colors.blue,
    appBarTheme: AppBarTheme(
        color: Colors.green, //<---Set the desired color here like my branding color #000132
),
  ),
  home: YassineBenkhayChangeAppBarColorTutorial(),
);

03
of 04
The result

appbar

04
of 04
Conclusion

In this tutorial, we learned how to change the appbar color on both the page and app levels with practical examples. you can check the custom appbar tutorial to learn how to create a custom appbar in Flutter.

Tags: appbarFlutterWdigets
Previous Post

How To Integrate AdMob Ads in Flutter App

Next Post

How To Create a Custom AppBar In Flutter

Yassine BENKHAY

Yassine BENKHAY

Hey there, my name is Yassine. I am a bachelor degree in computer systems and software engineering, and a mobile flutter developer, refer to about me page for more information.

Related Posts

Create an AI Image Generator, Flutter Clean Architecture Part 3
How-To-Guides

Create an AI Image Generator, Flutter Clean Architecture Part 3

by Yassine BENKHAY
August 13, 2023
0

Following part 1 and part 2 of building an AI Image Generator with Flutter Clean Architecture, in this part, we'll...

Read more
How To Create a Custom AppBar In Flutter

How To Create a Custom AppBar In Flutter

July 23, 2023
admob ads

How To Integrate AdMob Ads in Flutter App

July 5, 2023
Flutter Roadmap | How To Learn Flutter In 2022 The Right Way

Flutter Roadmap | How To Learn Flutter In 2022 The Right Way

June 17, 2023
Next Post
How To Create a Custom AppBar In Flutter

How To Create a Custom AppBar In Flutter

Comments 1

  1. Pingback: How To Create a Custom AppBar In Flutter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe to Our Newsletter

Flutter Premium Templates

Recommendations

Quizlet Alternative AI: Study Notes to Flashcards

November 15, 2024
Quizlet Alternative AI: Study Notes to Flashcards

Introduction In today’s fast-paced academic environment, students need tools that adapt to their learning styles. While Quizlet has long been...

Read more
by Yassine BENKHAY
0 Comments
Recommendations

StickerAI: AI Sticker Maker for iOS

October 9, 2024
StickerAI

Looking for a fun and simple way to create personalized stickers for your chats, social media, or even printed products?...

Read more
by Yassine BENKHAY
0 Comments
Designs

Plants Selling Flutter UI App Design

November 28, 2023
plants selling ui design

The user interface is a crucial part of any mobile application development, not only a beautiful design can shape the...

Read more
by Yassine BENKHAY
0 Comments
Yassine Benkhay

Terms & conditions | Privacy Policy | About me | Contact
© 2024 yassinebenkhay.com All rights reserved.

Quick Links

  • Home
  • Flutter
  • My Apps
  • Recommendations
  • Backend
  • How-To-Guides
  • General

Let's keep in touch!

No Result
View All Result
  • Home
  • Flutter
  • My Apps
  • Recommendations
  • Backend
  • How-To-Guides
  • General

Terms & conditions | Privacy Policy | About me | Contact
© 2024 yassinebenkhay.com All rights reserved.