isNullOrEmpty function

bool isNullOrEmpty(
  1. dynamic value
)

Utility function to check if value is null or empty Works with String, List, Map, Iterable, etc.

Implementation

bool isNullOrEmpty(dynamic value) {
  if (value == null) return true;
  if (value is String) return value.isEmpty;
  if (value is Iterable) return value.isEmpty;
  if (value is Map) return value.isEmpty;
  return false;
}