title: how to add custom color to flutter?
body: <p>I want to change the color of AppBar and use a custom color for it, I tried many options but none seem to work.
  Is there anything I'm missing?</p>
  <pre><code>import 'package:flutter/material.dart';
  
  final ThemeData CompanyThemeData = new ThemeData(
    brightness: Brightness.light,
    primaryColorBrightness: Brightness.light,
    accentColor: CompanyColors.black[500],
    accentColorBrightness: Brightness.light
  );
    
  class CompanyColors {
    CompanyColors._(); // this basically makes it so you can instantiate this class
   
   static const _blackPrimaryValue = 0xFF000000;
  
    static const MaterialColor black = const MaterialColor(
      _blackPrimaryValue,
      const &lt;int, Color&gt;{
        50:  const Color(0xFFe0e0e0),
        100: const Color(0xFFb3b3b3),
        200: const Color(0xFF808080),
        300: const Color(0xFF4d4d4d),
        400: const Color(0xFF262626),
        500: const Color(_blackPrimaryValue),
        600: const Color(0xFF000000),
        700: const Color(0xFF000000),
        800: const Color(0xFF000000),
        900: const Color(0xFF000000),
      },
    );
  }
  </code></pre>
  <p>and then I have used it in main.dart as</p>
  <pre><code>Widget build(BuildContext context) {
      return new MaterialApp(
        title: 'Flutter Demo',
        theme: new ThemeData(
          // This is the theme of your application.
          //
          // Try running your application with &quot;flutter run&quot;. You'll see the
          // application has a blue toolbar. Then, without quitting the app, try
          // changing the primarySwatch below to Colors.green and then invoke
          // &quot;hot reload&quot; (press &quot;r&quot; in the console where you ran &quot;flutter run&quot;,
          // or press Run &gt; Flutter Hot Reload in IntelliJ). Notice that the
          // counter didn't reset back to zero; the application is not restarted.
          primarySwatch:Theme1.CompanyColors.black[50],
        ),
        home: new MyHomePage(title: 'Flutter Demo Home Page'),
      );
    }
  </code></pre>
  <p>but after execution it says</p>
  <blockquote>
  <p>type Color is not of subtype MaterialColor</p>
  </blockquote>