Skip to content

Instantly share code, notes, and snippets.

@av
Created October 25, 2019 11:47
Show Gist options
  • Save av/088b0c603f3256636a26e8546c47b8cc to your computer and use it in GitHub Desktop.
Save av/088b0c603f3256636a26e8546c47b8cc to your computer and use it in GitHub Desktop.
Flutter: magic, curved burst
// in Burst constructor, children.map(...)
// ...
(particle) => CurvedParticle(
curve: Interval(
// Interval would start at random point from 0 to 0.5
// and finish at random point between 0.6 and 1.0
Randoms.rnd.nextDouble() * .5,
Randoms.rnd.nextDouble() * .4 + .6,
),
child: MovingParticle(
from: Offset.zero,
to: Randoms.offsetFromSize(size),
child: particle,
),
),
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment