toSafeInt method
Implementation
int toSafeInt({
int? minValue,
int? maxValue,
}) {
if (minValue == null && maxValue == null) {
return toInt();
}
if (minValue != null) {
if (this < minValue) {
return minValue;
}
}
if (maxValue != null) {
if (this > maxValue) {
return maxValue;
}
}
return toInt();
}