mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-01-31 09:27:02 +00:00
14 lines
321 B
Dart
14 lines
321 B
Dart
Function mtuValidator(bool required) {
|
|
return (String str) {
|
|
if (str == null || str == "") {
|
|
return required ? 'Please fill out this field' : null;
|
|
}
|
|
|
|
var mtu = int.tryParse(str);
|
|
if (mtu == null || mtu < 0 || mtu > 65535) {
|
|
return 'Please enter a valid mtu';
|
|
}
|
|
|
|
return null;
|
|
};
|
|
}
|