Last active
September 16, 2020 05:05
-
-
Save KoheiKanagu/bec06f4ba0a586b002cc40e597f8b079 to your computer and use it in GitHub Desktop.
() => String' is not a subtype of type '(() => Null)?
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() async { | |
final futures = <Future<String>>[]; | |
final waited = await Future.wait(futures); | |
final actual = waited.singleWhere( | |
(element) => element == 'Hello1', | |
orElse: () => 'unknown', | |
); | |
print(actual); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment