Skip to content

StraightPathTransformation could be represented as TweenPathTransformation  #46

@Joshix-1

Description

@Joshix-1

I'm not sure if that's an improvement.
Removing the public angle and distance properties would be a breaking change

/// A path transformation that moves the initial position along a straight line.
///
/// This transformation moves the position in a straight line defined by a distance
/// and an optional angle. The movement is linear and calculated using trigonometric
/// functions based on the angle.
final class StraightPathTransformation extends TweenPathTransformation {
  /// Creates a [StraightPathTransformation] with the given [distance] and an optional [angle].
  ///
  /// The [angle] parameter allows specifying the angle of the straight line in degrees.
  /// The [distance] parameter specifies how far the position moves along the straight line.
  StraightPathTransformation({required double distance, double angle = 0})
      : super(
          tween: Tween(
            start: Offset.zero,
            end: Offset.fromDirection(radians(angle), distance),
          ),
        );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions