From 4c1d79f42f7e2f0cea6b17cbb5ac9a03687fd96c Mon Sep 17 00:00:00 2001 From: suragch Date: Fri, 17 Jan 2020 02:03:43 +0800 Subject: [PATCH] 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. --- packages/flutter/lib/src/widgets/implicit_animations.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 62c156f0d3..efd31e1da2 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -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 =