Testing empty or null, use Dart's safe navigation
if (mystring?.isEmpty ?? true) {
//
}
// main function start
void main() {
// initialise a string st
String? st = "";
// print string is empty or not
print(st.isEmpty);
}