Add a color argument to Container. (#8396)

It's common to just want a simple colored box. Simple thing should be simple,
so this patch adds a convenience argument to Continer for creating a box
decoration that is just a color.

Fixes #5555
This commit is contained in:
Adam Barth
2017-02-24 12:25:48 -08:00
committed by GitHub
parent 76394630ac
commit f20c3d1032
11 changed files with 39 additions and 28 deletions

View File

@@ -324,7 +324,7 @@ class CardCollectionState extends State<CardCollection> {
child: new SingleChildScrollView(
child: new Container(
height: cardModel.height,
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
color: theme.primaryColor,
child: new Row(
children: <Widget>[
leftArrowIcon,
@@ -378,7 +378,7 @@ class CardCollectionState extends State<CardCollection> {
Widget body = new Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: _primaryColor[50]),
color: _primaryColor[50],
child: cardCollection,
);