isEmpty method Null safety
- String? value
Checks whether the string is empty or not.
Implementation
static String? isEmpty(String? value) {
if (value == null || value.isEmpty) {
return 'Field cannot be empty';
}
return null;
}
Checks whether the string is empty or not.
static String? isEmpty(String? value) {
if (value == null || value.isEmpty) {
return 'Field cannot be empty';
}
return null;
}