Skip to content

Instantly share code, notes, and snippets.

@oravecz
Created November 3, 2022 16:30
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 oravecz/b7b4358a0c15fc929afdab0cda0cc794 to your computer and use it in GitHub Desktop.
Save oravecz/b7b4358a0c15fc929afdab0cda0cc794 to your computer and use it in GitHub Desktop.
lively-ray-9860
void main() {
try {
var foo1 = <String, dynamic>{'bar': null};
foo1['bar'] = 1;
print('foo1 succeeded');
} catch (e) {
print('foo1 failed');
}
try {
var foo2 = <String, dynamic>{
'bar': {'baz': 0}
};
foo2['bar']['baz'] = 1;
print('foo2 succeeded');
} catch (e) {
print('foo2 failed');
}
try {
var foo3 = <String, dynamic>{
'bar': {'baz': null}
};
foo3['bar']['baz'] = 1;
print('foo3 succeeded');
} catch (e) {
print('foo3 failed');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment