Skip to content

Instantly share code, notes, and snippets.

@beyondszine
Created May 9, 2023 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beyondszine/81c1d64741e5cfeae5d4cac9e43eba0f to your computer and use it in GitHub Desktop.
Save beyondszine/81c1d64741e5cfeae5d4cac9e43eba0f to your computer and use it in GitHub Desktop.
solar-arc-1934
void main() {
Map<String, dynamic> person = {
'name': 'John Doe',
'age': 30,
'address': {
'street': '123 Main St',
'city': 'Anytown',
'state': 'CA',
},
};
Map<String, dynamic> person2 = {
'name': 'John Doe',
'age': 30,
'address': null
};
print(null ?? "if it went wrong!");
print(person['address']['city'] ?? "got no city!" );
print(person2['address']['city'] ?? "got no city!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment