Skip to content

Instantly share code, notes, and snippets.

@KoheiKanagu
Last active September 16, 2020 05:05
Show Gist options
  • Save KoheiKanagu/bec06f4ba0a586b002cc40e597f8b079 to your computer and use it in GitHub Desktop.
Save KoheiKanagu/bec06f4ba0a586b002cc40e597f8b079 to your computer and use it in GitHub Desktop.
() => String' is not a subtype of type '(() => Null)?
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