Testing empty or null, use Dart's safe navigation if (mystring?.isEmpty ?? true) { // }
if (myString == '' || myString == null) {