Created with <3 with dartpad.dev.
Created
November 30, 2022 13:06
-
-
Save mit-mit/412bbf51a960d52d25f05d99bbdb63bd to your computer and use it in GitHub Desktop.
keen-destiny-4798
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
extension ListAdd1 on List { | |
void add1(element) { | |
add(element); | |
} | |
} | |
extension ListAdd2<T> on List<T> { | |
void add2(T element) { | |
add(element); | |
} | |
} | |
main() { | |
final l = <int>[1, 2, 42]; | |
l.add1(null); | |
l.add1('Not an int'); | |
l.add2(null); | |
l.add2('Not amn int'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment