Last active
June 10, 2020 21:01
-
-
Save xvrh/2d0bc36ec1f3a5ade5550c0944702d73 to your computer and use it in GitHub Desktop.
Try to use firstWhere with dart null safety
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() { | |
var list = ['a', 'b', 'c']; | |
String? d = list.firstWhere((e) => e == 'd', orElse: () => null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment