Created with <3 with dartpad.dev.
Created
November 3, 2022 16:30
-
-
Save oravecz/b7b4358a0c15fc929afdab0cda0cc794 to your computer and use it in GitHub Desktop.
lively-ray-9860
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
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