Remove ThemeData.primarySwatch

In the dark theme, there isn't really a primary swatch, so this API was
a sandtrap. Instead, be explicit about the colors we need for various
widgets in the theme.

Fixes #1277
This commit is contained in:
Adam Barth
2016-02-21 20:26:09 -08:00
parent d91d334787
commit 2c2fa23886
6 changed files with 77 additions and 71 deletions

View File

@@ -300,7 +300,7 @@ class CardCollectionState extends State<CardCollection> {
onResized: () { _invalidator(<int>[index]); },
onDismissed: () { dismissCard(cardModel); },
child: new Card(
color: Theme.of(context).primarySwatch[cardModel.color],
color: _primaryColor[cardModel.color],
child: new Container(
height: cardModel.height,
padding: const EdgeDims.all(kCardMargins),
@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> {
Widget body = new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: Theme.of(context).primarySwatch[50]),
decoration: new BoxDecoration(backgroundColor: _primaryColor[50]),
child: cardCollection
);