@@ -35,7 +35,6 @@ abstract class ParametricCurve<T> {
3535 /// implementation of [transform] , which delegates the remaining logic to
3636 /// [transformInternal] .
3737 T transform (double t) {
38- assert (t != null );
3938 assert (t >= 0.0 && t <= 1.0 , 'parametric value $t is outside of [0, 1] range.' );
4039 return transformInternal (t);
4140 }
@@ -129,7 +128,7 @@ class SawTooth extends Curve {
129128 /// Creates a sawtooth curve.
130129 ///
131130 /// The [count] argument must not be null.
132- const SawTooth (this .count) : assert (count != null ) ;
131+ const SawTooth (this .count);
133132
134133 /// The number of repetitions of the sawtooth pattern in the unit interval.
135134 final int count;
@@ -159,10 +158,7 @@ class Interval extends Curve {
159158 /// Creates an interval curve.
160159 ///
161160 /// The arguments must not be null.
162- const Interval (this .begin, this .end, { this .curve = Curves .linear })
163- : assert (begin != null ),
164- assert (end != null ),
165- assert (curve != null );
161+ const Interval (this .begin, this .end, { this .curve = Curves .linear });
166162
167163 /// The largest value for which this interval is 0.0.
168164 ///
@@ -207,7 +203,7 @@ class Threshold extends Curve {
207203 /// Creates a threshold curve.
208204 ///
209205 /// The [threshold] argument must not be null.
210- const Threshold (this .threshold) : assert (threshold != null ) ;
206+ const Threshold (this .threshold);
211207
212208 /// The value before which the curve is 0.0 and after which the curve is 1.0.
213209 ///
@@ -307,11 +303,7 @@ class Cubic extends Curve {
307303 /// cubic curves in [Curves] .
308304 ///
309305 /// The [a] (x1), [b] (y1), [c] (x2) and [d] (y2) arguments must not be null.
310- const Cubic (this .a, this .b, this .c, this .d)
311- : assert (a != null ),
312- assert (b != null ),
313- assert (c != null ),
314- assert (d != null );
306+ const Cubic (this .a, this .b, this .c, this .d);
315307
316308 /// The x coordinate of the first control point.
317309 ///
@@ -518,9 +510,6 @@ abstract class Curve2D extends ParametricCurve<Offset> {
518510 // 4. Recursively sample the two parts.
519511 //
520512 // This algorithm concentrates samples in areas of high curvature.
521- assert (tolerance != null );
522- assert (start != null );
523- assert (end != null );
524513 assert (end > start);
525514 // We want to pick a random seed that will keep the result stable if
526515 // evaluated again, so we use the first non-generated control point.
@@ -577,7 +566,6 @@ abstract class Curve2D extends ParametricCurve<Offset> {
577566 /// single-valued, it will return the parameter for only one of the values at
578567 /// the given `x` location.
579568 double findInverse (double x) {
580- assert (x != null );
581569 double start = 0.0 ;
582570 double end = 1.0 ;
583571 late double mid;
@@ -612,7 +600,7 @@ class Curve2DSample {
612600 /// Creates an object that holds a sample; used with [Curve2D] subclasses.
613601 ///
614602 /// All arguments must not be null.
615- const Curve2DSample (this .t, this .value) : assert (t != null ), assert (value != null ) ;
603+ const Curve2DSample (this .t, this .value);
616604
617605 /// The parametric location of this sample point along the curve.
618606 final double t;
@@ -682,9 +670,7 @@ class CatmullRomSpline extends Curve2D {
682670 double tension = 0.0 ,
683671 Offset ? startHandle,
684672 Offset ? endHandle,
685- }) : assert (controlPoints != null ),
686- assert (tension != null ),
687- assert (tension <= 1.0 , 'tension $tension must not be greater than 1.0.' ),
673+ }) : assert (tension <= 1.0 , 'tension $tension must not be greater than 1.0.' ),
688674 assert (tension >= 0.0 , 'tension $tension must not be negative.' ),
689675 assert (controlPoints.length > 3 , 'There must be at least four control points to create a CatmullRomSpline.' ),
690676 _controlPoints = controlPoints,
@@ -702,9 +688,7 @@ class CatmullRomSpline extends Curve2D {
702688 double tension = 0.0 ,
703689 Offset ? startHandle,
704690 Offset ? endHandle,
705- }) : assert (controlPoints != null ),
706- assert (tension != null ),
707- assert (tension <= 1.0 , 'tension $tension must not be greater than 1.0.' ),
691+ }) : assert (tension <= 1.0 , 'tension $tension must not be greater than 1.0.' ),
708692 assert (tension >= 0.0 , 'tension $tension must not be negative.' ),
709693 assert (controlPoints.length > 3 , 'There must be at least four control points to create a CatmullRomSpline.' ),
710694 _controlPoints = null ,
@@ -860,8 +844,7 @@ class CatmullRomCurve extends Curve {
860844 ///
861845 /// * This [paper on using Catmull-Rom splines] (http://faculty.cs.tamu.edu/schaefer/research/cr_cad.pdf).
862846 CatmullRomCurve (this .controlPoints, {this .tension = 0.0 })
863- : assert (tension != null ),
864- assert (() {
847+ : assert (() {
865848 return validateControlPoints (
866849 controlPoints,
867850 tension: tension,
@@ -877,8 +860,7 @@ class CatmullRomCurve extends Curve {
877860 /// Same as [CatmullRomCurve.new] , but it precomputes the internal curve data
878861 /// structures for a more predictable computation load.
879862 CatmullRomCurve .precompute (this .controlPoints, {this .tension = 0.0 })
880- : assert (tension != null ),
881- assert (() {
863+ : assert (() {
882864 return validateControlPoints (
883865 controlPoints,
884866 tension: tension,
@@ -963,7 +945,6 @@ class CatmullRomCurve extends Curve {
963945 double tension = 0.0 ,
964946 List <String >? reasons,
965947 }) {
966- assert (tension != null );
967948 if (controlPoints == null ) {
968949 assert (() {
969950 reasons? .add ('Supplied control points cannot be null' );
@@ -1143,7 +1124,7 @@ class FlippedCurve extends Curve {
11431124 /// Creates a flipped curve.
11441125 ///
11451126 /// The [curve] argument must not be null.
1146- const FlippedCurve (this .curve) : assert (curve != null ) ;
1127+ const FlippedCurve (this .curve);
11471128
11481129 /// The curve that is being flipped.
11491130 final Curve curve;
0 commit comments