beInteger method
Instructs NumberMust to make sure the given number is an integer, i.e. no decimal places.
Implementation
void beInteger([String? errorMessage]) {
_validators.add((value) {
if (value == null || value is! int)
return errorMessage ?? 'The number is not an integer.';
return '';
});
}