Testing empty or null, use Dart's safe navigation if (mystring?.isEmpty ?? true) { // }
void main() { String str = "Hello"; print(str.isEmpty); }