Created
October 30, 2021 07:59
-
-
Save jeckymodi/57c7c8635b394716a03819219b29253b to your computer and use it in GitHub Desktop.
Checking dynamic variable empty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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