Skip to content

Add await or ignore to future-returning methods defined in Dart SDK#184229

Open
victorsanni wants to merge 4 commits intoflutter:masterfrom
victorsanni:dart-unawaited
Open

Add await or ignore to future-returning methods defined in Dart SDK#184229
victorsanni wants to merge 4 commits intoflutter:masterfrom
victorsanni:dart-unawaited

Conversation

@victorsanni
Copy link
Copy Markdown
Contributor

Part of #181513

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. d: examples Sample code and demos f: integration_test The flutter/packages/integration_test plugin labels Mar 27, 2026
@victorsanni victorsanni added the CICD Run CI/CD label Mar 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses unawaited futures across various packages and tests by adding await to asynchronous calls—such as close, spawn, and runZoned—or applying // ignore: unawaited_futures where intentional. It also refactors file creation in snippets_test.dart and adds a new test case for ID matching in vm_service_golden_client_test.dart. Feedback suggests using asynchronous writeAsString instead of writeAsStringSync in snippets_test.dart to maintain consistency with the async test environment.

..writeAsStringSync('''
final File exampleFile = memoryFileSystem.file(examplePath);
await exampleFile.create(recursive: true);
exampleFile.writeAsStringSync('''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the async nature of this test and to avoid blocking, consider using the asynchronous writeAsString method instead of writeAsStringSync.

Suggested change
exampleFile.writeAsStringSync('''
await exampleFile.writeAsString('''

..writeAsStringSync('''
final File exampleFile = memoryFileSystem.file(examplePath);
await exampleFile.create(recursive: true);
exampleFile.writeAsStringSync('''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the async nature of this test and to avoid blocking, consider using the asynchronous writeAsString method instead of writeAsStringSync.

Suggested change
exampleFile.writeAsStringSync('''
await exampleFile.writeAsString('''

@github-actions github-actions bot removed the CICD Run CI/CD label Mar 27, 2026
@victorsanni victorsanni added the CICD Run CI/CD label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests CICD Run CI/CD d: examples Sample code and demos f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant