@@ -35,7 +35,6 @@ abstract class ParametricCurve<T> {
35
35
/// implementation of [transform] , which delegates the remaining logic to
36
36
/// [transformInternal] .
37
37
T transform (double t) {
38
- assert (t != null );
39
38
assert (t >= 0.0 && t <= 1.0 , 'parametric value $t is outside of [0, 1] range.' );
40
39
return transformInternal (t);
41
40
}
@@ -129,7 +128,7 @@ class SawTooth extends Curve {
129
128
/// Creates a sawtooth curve.
130
129
///
131
130
/// The [count] argument must not be null.
132
- const SawTooth (this .count) : assert (count != null ) ;
131
+ const SawTooth (this .count);
133
132
134
133
/// The number of repetitions of the sawtooth pattern in the unit interval.
135
134
final int count;
@@ -159,10 +158,7 @@ class Interval extends Curve {
159
158
/// Creates an interval curve.
160
159
///
161
160
/// 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 });
166
162
167
163
/// The largest value for which this interval is 0.0.
168
164
///
@@ -207,7 +203,7 @@ class Threshold extends Curve {
207
203
/// Creates a threshold curve.
208
204
///
209
205
/// The [threshold] argument must not be null.
210
- const Threshold (this .threshold) : assert (threshold != null ) ;
206
+ const Threshold (this .threshold);
211
207
212
208
/// The value before which the curve is 0.0 and after which the curve is 1.0.
213
209
///
@@ -307,11 +303,7 @@ class Cubic extends Curve {
307
303
/// cubic curves in [Curves] .
308
304
///
309
305
/// 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);
315
307
316
308
/// The x coordinate of the first control point.
317
309
///
@@ -518,9 +510,6 @@ abstract class Curve2D extends ParametricCurve<Offset> {
518
510
// 4. Recursively sample the two parts.
519
511
//
520
512
// This algorithm concentrates samples in areas of high curvature.
521
- assert (tolerance != null );
522
- assert (start != null );
523
- assert (end != null );
524
513
assert (end > start);
525
514
// We want to pick a random seed that will keep the result stable if
526
515
// evaluated again, so we use the first non-generated control point.
@@ -577,7 +566,6 @@ abstract class Curve2D extends ParametricCurve<Offset> {
577
566
/// single-valued, it will return the parameter for only one of the values at
578
567
/// the given `x` location.
579
568
double findInverse (double x) {
580
- assert (x != null );
581
569
double start = 0.0 ;
582
570
double end = 1.0 ;
583
571
late double mid;
@@ -612,7 +600,7 @@ class Curve2DSample {
612
600
/// Creates an object that holds a sample; used with [Curve2D] subclasses.
613
601
///
614
602
/// 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);
616
604
617
605
/// The parametric location of this sample point along the curve.
618
606
final double t;
@@ -682,9 +670,7 @@ class CatmullRomSpline extends Curve2D {
682
670
double tension = 0.0 ,
683
671
Offset ? startHandle,
684
672
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.' ),
688
674
assert (tension >= 0.0 , 'tension $tension must not be negative.' ),
689
675
assert (controlPoints.length > 3 , 'There must be at least four control points to create a CatmullRomSpline.' ),
690
676
_controlPoints = controlPoints,
@@ -702,9 +688,7 @@ class CatmullRomSpline extends Curve2D {
702
688
double tension = 0.0 ,
703
689
Offset ? startHandle,
704
690
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.' ),
708
692
assert (tension >= 0.0 , 'tension $tension must not be negative.' ),
709
693
assert (controlPoints.length > 3 , 'There must be at least four control points to create a CatmullRomSpline.' ),
710
694
_controlPoints = null ,
@@ -860,8 +844,7 @@ class CatmullRomCurve extends Curve {
860
844
///
861
845
/// * This [paper on using Catmull-Rom splines] (http://faculty.cs.tamu.edu/schaefer/research/cr_cad.pdf).
862
846
CatmullRomCurve (this .controlPoints, {this .tension = 0.0 })
863
- : assert (tension != null ),
864
- assert (() {
847
+ : assert (() {
865
848
return validateControlPoints (
866
849
controlPoints,
867
850
tension: tension,
@@ -877,8 +860,7 @@ class CatmullRomCurve extends Curve {
877
860
/// Same as [CatmullRomCurve.new] , but it precomputes the internal curve data
878
861
/// structures for a more predictable computation load.
879
862
CatmullRomCurve .precompute (this .controlPoints, {this .tension = 0.0 })
880
- : assert (tension != null ),
881
- assert (() {
863
+ : assert (() {
882
864
return validateControlPoints (
883
865
controlPoints,
884
866
tension: tension,
@@ -963,7 +945,6 @@ class CatmullRomCurve extends Curve {
963
945
double tension = 0.0 ,
964
946
List <String >? reasons,
965
947
}) {
966
- assert (tension != null );
967
948
if (controlPoints == null ) {
968
949
assert (() {
969
950
reasons? .add ('Supplied control points cannot be null' );
@@ -1143,7 +1124,7 @@ class FlippedCurve extends Curve {
1143
1124
/// Creates a flipped curve.
1144
1125
///
1145
1126
/// The [curve] argument must not be null.
1146
- const FlippedCurve (this .curve) : assert (curve != null ) ;
1127
+ const FlippedCurve (this .curve);
1147
1128
1148
1129
/// The curve that is being flipped.
1149
1130
final Curve curve;
0 commit comments