mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
fix: doc/example/particles/readme, attempt to embed webm preview fix: doc/example/particles better sample for chaining refactor: Particle, dropped duration support
20 lines
438 B
Dart
20 lines
438 B
Dart
import 'package:flutter/animation.dart';
|
|
|
|
import '../particle.dart';
|
|
|
|
/// A [Particle] which applies certain [Curve] for
|
|
/// easing or other purposes to its [progress] getter.
|
|
class CurvedParticle extends Particle {
|
|
final Curve curve;
|
|
|
|
CurvedParticle({
|
|
this.curve = Curves.linear,
|
|
double lifespan,
|
|
}) : super(
|
|
lifespan: lifespan,
|
|
);
|
|
|
|
@override
|
|
double get progress => curve.transform(super.progress);
|
|
}
|