Skip to content

Instantly share code, notes, and snippets.

@xanahopper
Last active December 22, 2021 03:47
Show Gist options
  • Save xanahopper/7990be23eef7d5950533f32d5360158f to your computer and use it in GitHub Desktop.
Save xanahopper/7990be23eef7d5950533f32d5360158f to your computer and use it in GitHub Desktop.
extension on Map? {
bool get isNullOrEmpty => this?.isEmpty ?? true;
bool get isNotNullOrEmpty => !isNullOrEmpty;
}
void main() {
Map<String, dynamic>? info;
print(info.isNullOrEmpty);
print(info.isNotNullOrEmpty);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment