Skip to content

Instantly share code, notes, and snippets.

@HugoHeneault
Created January 7, 2022 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HugoHeneault/49e08930c99d9300d85a412ebd052bf5 to your computer and use it in GitHub Desktop.
Save HugoHeneault/49e08930c99d9300d85a412ebd052bf5 to your computer and use it in GitHub Desktop.
Future.forEach Object?
void main() async {
final List<String> alwaysRequiredFiles = ['some_path', 'other_path'];
await Future.forEach(alwaysRequiredFiles, (filepath) async {
// this fails: error: The argument type 'Object?' can't be assigned to the parameter type 'String'. (argument_type_not_assignable
final String file = filepath;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment