utils/helpers library

Classes

NormalizedFrictionSimulation
A Simulation that wraps FrictionSimulation and normalizes its output to the 0.0 -> 1.0 range.

Extensions

DoubleSum on Iterable<T>

Functions

calculateEndRotate(RouletteGroup group, int targetIndex, bool clockwise, int minRotateCircles, {double offset = 0}) double
Calculate the end rotate value by targetIndex. The returned value contains the circles to roll. Make sure when you run this method the group has at least one RouletteUnit.
hitTestSector({required Size size, required RouletteGroup group, required double rotation, required Offset localPosition, double centerStickerPercent = 0}) int?
Determines which sector of a roulette the given localPosition falls in.
makeAnimation(AnimationController controller, double targetValue, Curve? curve, {double initialValue = 0}) Animation<double>
Make Animation from controller to begin rotate effect. Rotate final position is targetValue.

Typedefs

DoubleSelector<T> = double Function(T source)
IndexBuilder<T> = T Function(int index)