trim the string then checks if isEmpty
trim
isEmpty
bool isEmpty(String string) { return string.trim().isEmpty; }