trim the string then checks if isNotEmpty
trim
isNotEmpty
bool isNotEmpty(String? string) { return string?.trim().isNotEmpty ?? false; }