Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - Changing the color of the appbar is not working

Tags:

flutter

dart

I am trying to change the background color of AppBar but it is not working.

When choosing the color 0x673AB7 according to the image below, AppBar turns gray instead of purple.

import "package:flutter/material.dart";

void main() {
  runApp(new ControlleApp());
}

class ControlleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: "Controlle Financeiro",
      home: new HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        backgroundColor: new Color(0x673AB7),
      ),
    );
  }
}

enter image description here

like image 861
rafaelcb21 Avatar asked Jun 12 '17 23:06

rafaelcb21


1 Answers

It looks like your color is completely transparent. Try changing the color to 0xFF673AB7

like image 74
Randal Schwartz Avatar answered Oct 21 '22 03:10

Randal Schwartz