validAge static method

String? validAge({
  1. String? value,
})

Implementation

static String? validAge({String? value}) {
  if (value!.isEmpty) {
    return 'Please Enter your Age';
  } else if (int.parse(value) > 100) {
    return 'Enter Valid Age ';
  } else if (int.parse(value) == 0) {
    return 'Enter Valid Age ';
  }
  return null;
}