Checks if the text is valid
bool isValidText(String text) { return text.isNotEmpty && text.trim().isNotEmpty; }