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:
parent
ee1fa94b4d
commit
4c1d79f42f
@ -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 =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user