stateOrProvince method
Validates the state or province for a specific country.
Implementation
@override
String? stateOrProvince(String? value) {
if (value == null || value.trim().isEmpty) {
return 'State is required';
}
if (value.trim().length < 2) {
return 'Enter a valid state';
}
return null;
}