Skip to content

Instantly share code, notes, and snippets.

@jeckymodi
Created October 30, 2021 07:59
Show Gist options
  • Save jeckymodi/57c7c8635b394716a03819219b29253b to your computer and use it in GitHub Desktop.
Save jeckymodi/57c7c8635b394716a03819219b29253b to your computer and use it in GitHub Desktop.
Checking dynamic variable empty
bool isNullEmptyOrFalse(dynamic o) {
if (o is Map<String, dynamic> || o is List<dynamic>) {
return o == null || o.length == 0;
}
return o == null || false == o || "" == o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment