Skip to content

Make CurveTween curve a regular parameter #21433

@sir-boformer

Description

@sir-boformer

Right now the CurveTween constructor looks like this:

  /// Creates a curve tween.
  ///
  /// The [curve] argument must not be null.
  CurveTween({ @required this.curve })
    : assert(curve != null);

Usage currently looks like this:

CurveTween(curve: Curves.easeInOut);

There is a single required parameter, and I think it's quite certain that a CurveTween needs a Curve to function.

I propose to make it a regular parameter to make usage easier and a bit more fail-safe:

CurveTween(Curves.easeInOut);

If this is approved by the Flutter team, I will create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: animationAnimation APIsc: API breakBackwards-incompatible API changesc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions