Update assert message for AnimatedContainer (#48962)

The error message was misleading because BoxDecoration does not have a `backgroundColor` parameter. Instead it has a `color` parameter, which sets the background color. I also removed the optional `new` keyword.
This commit is contained in:
suragch 2020-01-17 02:03:43 +08:00 committed by Michael Goderbauer
parent ee1fa94b4d
commit 4c1d79f42f

View File

@ -649,7 +649,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
assert(constraints == null || constraints.debugAssertIsValid()),
assert(color == null || decoration == null,
'Cannot provide both a color and a decoration\n'
'The color argument is just a shorthand for "decoration: new BoxDecoration(backgroundColor: color)".'
'The color argument is just a shorthand for "decoration: BoxDecoration(color: color)".'
),
decoration = decoration ?? (color != null ? BoxDecoration(color: color) : null),
constraints =