title: How to get theme color inside the widget in Flutter
body: <p>I have this:</p>
  
  <pre class="lang-dart prettyprint-override"><code>Widget build(BuildContext context) {
      return MaterialApp(
        title: 'AnApp',
        theme: ThemeData(
          primarySwatch: Colors.blueGrey,
        ),
        home: MainWidget()
      );
    }
  }
  </code></pre>
  
  <p>So I have set <code>primarySwatch</code> color to <code>blueGrey</code>.
  How can I access this color inside the <code>MainWidget</code> class?</p>
  
  <p>I want to set a background the same as the <code>AppBar</code> color.</p>