AnimationSpec.curve constructor
Animation which uses a curve
and animates for a fixed duration
.
Examples
import 'package:flutter/animation.dart';
final linearDefaultDuration = AnimationSpec.curve(Curves.linear);
final linearDefaultDurationFromCurve = Curves.linear.animation();
final ease250ms = AnimationSpec.curve(Curves.ease, 250.ms);
final ease250msFromCurve = Curves.ease.animation(250.ms);
final withDelay = AnimationSpec.curve(Curves.linear).delay(250.ms);
See also:
- AnimationFromCurveExtension.animation for a more convenient way to create an animation from a Curve.
Implementation
AnimationSpec.curve(Curve curve, [Duration duration = defaultDuration])
: this._(
provider: _CurveAnimationProvider(
curve: curve,
duration: duration,
),
);