Line data Source code
1 : import 'package:flutter/animation.dart'; 2 : 3 : import 'particle.dart'; 4 : 5 : /// A [Particle] which applies certain [Curve] for 6 : /// easing or other purposes to its [progress] getter. 7 : class CurvedParticle extends Particle { 8 : final Curve curve; 9 : 10 0 : CurvedParticle({ 11 : this.curve = Curves.linear, 12 : double? lifespan, 13 0 : }) : super( 14 : lifespan: lifespan, 15 : ); 16 : 17 0 : @override 18 0 : double get progress => curve.transform(super.progress); 19 : }