Commit 4c1d79f4 authored by suragch's avatar suragch Committed by Michael Goderbauer

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.
parent ee1fa94b
...@@ -649,7 +649,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget { ...@@ -649,7 +649,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
assert(constraints == null || constraints.debugAssertIsValid()), assert(constraints == null || constraints.debugAssertIsValid()),
assert(color == null || decoration == null, assert(color == null || decoration == null,
'Cannot provide both a color and a decoration\n' '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), decoration = decoration ?? (color != null ? BoxDecoration(color: color) : null),
constraints = constraints =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment