trim the string then checks if isEmpty if string is empty it will returns true
trim
isEmpty
bool isEmpty(String? input) { return input?.trim().isEmpty ?? true; }