From adba86431eda5c0b1befe590de99f92ccdb3cc5e Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Thu, 15 Oct 2015 14:41:54 -0700 Subject: [PATCH] Revised LinearGradient ctor checking. It's OK to just specify the colors list. --- packages/flutter/lib/src/painting/box_painter.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/painting/box_painter.dart b/packages/flutter/lib/src/painting/box_painter.dart index 117c71823b..2d3b3363aa 100644 --- a/packages/flutter/lib/src/painting/box_painter.dart +++ b/packages/flutter/lib/src/painting/box_painter.dart @@ -306,9 +306,7 @@ class LinearGradient extends Gradient { this.colors, this.stops, this.tileMode: ui.TileMode.clamp - }) { - assert(colors.length == stops.length); - } + }); /// The point at which stop 0.0 of the gradient is placed final Point begin; @@ -323,7 +321,8 @@ class LinearGradient extends Gradient { /// A list of values from 0.0 to 1.0 that denote fractions of the vector from start to end /// - /// Note: This list must have the same length as [colors]. + /// Note: If specified, this list must have the same length as [colors]. Otherwise the colors + /// are distributed evenly between [begin] and [end]. final List stops; /// How this gradient should tile the plane