limitTo method

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

returns this if it is between min and max (inclusive) otherwise returns min or max whichever is closer

Implementation

int limitTo(int min, int max) => (this as num)._limitTo(min, max).toInt();