Source
static TransitionFunction custom(num amount) { if (amount < -1) amount = -1; if (amount > 1) amount = 1; num easing(num t) { if (amount == 0) return t; if (amount < 0) return t * (t * -amount + 1 + amount); return t * ((2 - t) * amount + (1 - amount)); } return easing; }