Skip to content

Instantly share code, notes, and snippets.

@calvinalx
Last active June 16, 2022 08:13
Show Gist options
  • Select an option

  • Save calvinalx/3623cc44b805bc598787db394cecbf95 to your computer and use it in GitHub Desktop.

Select an option

Save calvinalx/3623cc44b805bc598787db394cecbf95 to your computer and use it in GitHub Desktop.
bool isNullOrEmptyString(String? value) {
return [null, ''].contains(value);
}
void main() {
dynamic value = null;
print(value == true ? false : !isNullOrEmptyString(value).replaceAll('null', ''));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment