Check if string is not empty and not null
text - The text to validate Returns true if text is not empty and not null
text
static bool isNotEmpty(String? text) { return text != null && text.trim().isNotEmpty; }