diff --git a/lib/effects/effects.dart b/lib/effects/effects.dart index f3ca9ff3f..ddc3658bb 100644 --- a/lib/effects/effects.dart +++ b/lib/effects/effects.dart @@ -166,7 +166,10 @@ abstract class SimplePositionComponentEffect extends PositionComponentEffect { Curve curve, bool isRelative = false, void Function() onComplete, - }) : assert(duration != null || speed != null), + }) : assert( + duration != null || speed != null, + "Either speed or duration necessary", + ), super( initialIsInfinite, initialIsAlternating, diff --git a/lib/effects/move_effect.dart b/lib/effects/move_effect.dart index 3a65f8a68..0410d9293 100644 --- a/lib/effects/move_effect.dart +++ b/lib/effects/move_effect.dart @@ -33,7 +33,10 @@ class MoveEffect extends SimplePositionComponentEffect { bool isAlternating = false, bool isRelative = false, void Function() onComplete, - }) : assert(duration != null || speed != null), + }) : assert( + duration != null || speed != null, + "Either speed or duration necessary", + ), super( isInfinite, isAlternating, diff --git a/lib/effects/rotate_effect.dart b/lib/effects/rotate_effect.dart index 3a23276ac..1dffa79b4 100644 --- a/lib/effects/rotate_effect.dart +++ b/lib/effects/rotate_effect.dart @@ -17,7 +17,10 @@ class RotateEffect extends SimplePositionComponentEffect { bool isAlternating = false, bool isRelative = false, void Function() onComplete, - }) : assert(duration != null || speed != null), + }) : assert( + duration != null || speed != null, + "Either speed or duration necessary", + ), super( isInfinite, isAlternating, diff --git a/lib/effects/scale_effect.dart b/lib/effects/scale_effect.dart index c7617838c..ec13695c5 100644 --- a/lib/effects/scale_effect.dart +++ b/lib/effects/scale_effect.dart @@ -18,7 +18,10 @@ class ScaleEffect extends SimplePositionComponentEffect { bool isAlternating = false, bool isRelative = false, void Function() onComplete, - }) : assert(duration != null || speed != null), + }) : assert( + duration != null || speed != null, + "Either speed or duration necessary", + ), super( isInfinite, isAlternating,