withUpperLimit method

int withUpperLimit(
  1. int max
)

returns this if it is not greater than max, otherwise max

Implementation

int withUpperLimit(int max) => (this as num)._withUpperLimit(max).toInt();