clampBetween method

int clampBetween(
  1. int min,
  2. int max
)

Implementation

int clampBetween(int min, int max) =>
    this < min ? min : (this > max ? max : this);