Fix formatting

This commit is contained in:
Lukas Klingsbo
2020-06-24 11:50:24 +02:00
parent 9168ef3836
commit acde967bbc
2 changed files with 13 additions and 13 deletions

View File

@ -39,10 +39,10 @@ abstract class PositionComponentEffect {
double get totalTravelTime => travelTime * (isAlternating ? 2 : 1); double get totalTravelTime => travelTime * (isAlternating ? 2 : 1);
PositionComponentEffect( PositionComponentEffect(
this._initialIsInfinite, this._initialIsInfinite,
this._initialIsAlternating, { this._initialIsAlternating, {
this.onComplete, this.onComplete,
}) { }) {
isInfinite = _initialIsInfinite; isInfinite = _initialIsInfinite;
isAlternating = _initialIsAlternating; isAlternating = _initialIsAlternating;
} }
@ -58,7 +58,7 @@ abstract class PositionComponentEffect {
if (!hasFinished()) { if (!hasFinished()) {
currentTime += dt * curveDirection + driftTime * driftMultiplier; currentTime += dt * curveDirection + driftTime * driftMultiplier;
percentage = min(1.0, max(0.0, currentTime / travelTime)); percentage = min(1.0, max(0.0, currentTime / travelTime));
if (hasFinished()){ if (hasFinished()) {
onComplete?.call(); onComplete?.call();
} }
} }

View File

@ -22,14 +22,14 @@ class MoveEffect extends PositionComponentEffect {
double _yDistance; double _yDistance;
double _yDirection; double _yDirection;
MoveEffect({ MoveEffect(
@required this.destination, {@required this.destination,
@required this.speed, @required this.speed,
this.curve, this.curve,
isInfinite = false, isInfinite = false,
isAlternating = false, isAlternating = false,
Function onComplete Function onComplete})
}) : super(isInfinite, isAlternating, onComplete: onComplete); : super(isInfinite, isAlternating, onComplete: onComplete);
@override @override
void initialize(_comp) { void initialize(_comp) {