isNotEmpty function

bool isNotEmpty (dynamic value)

Resolves null as empty. Return false if null. Supports String, List, Map.

Implementation

bool isNotEmpty(dynamic value) {
  if (value is String) return value.isNotEmpty;
  if (value is List) return value.isNotEmpty;
  if (value is Map) return value.isNotEmpty;
  return false; //if value is null
}