isEmpty method Null safety

String? isEmpty(
  1. 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;
}