2020-07-27 20:43:58 +00:00
|
|
|
Function mtuValidator(bool required) {
|
|
|
|
return (String str) {
|
2022-11-17 21:43:16 +00:00
|
|
|
if (str == "") {
|
2020-07-27 20:43:58 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|