lerpDiscrete<T> function
Returns a when t is below the halfway point, otherwise b.
The honest interpolation for a value that cannot be blended — an enum, a bool, a callback, a shape. Snapping at the midpoint is what Flutter's own theme classes do for the same case.
Implementation
T? lerpDiscrete<T>(T? a, T? b, double t) => t < 0.5 ? a : b;