Sitelet https://github.com/flutter/flutter/pull/185446
Skip to content

Add awaitNotRequired annotation to Material/Cupertino libraries - #185446

Closed
victorsanni wants to merge 26 commits into
flutter:masterfrom
victorsanni:fix/pr-181513-material-cupertino
Closed

victorsanni wants to merge 26 commits into
flutter:masterfrom
victorsanni:fix/pr-181513-material-cupertino

Conversation

@victorsanni

Copy link
Copy Markdown
Contributor

Part of Use @awaitNotRequired in Flutter SDK

The non-design parts of this issue is done in Add @awaitNotRequired annotation to flutter sdk.

@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages p: cupertino_ui cupertino_ui package in flutter/packages f: routes Navigator, Router, and related APIs. labels Apr 22, 2026
@victorsanni
victorsanni marked this pull request as draft April 22, 2026 23:12

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

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.

Code Review

This pull request adds the @awaitNotRequired annotation to several asynchronous functions across the Cupertino and Material libraries, including showCupertinoModalPopup, showCupertinoDialog, showModalBottomSheet, animateToItem, showDatePicker, showDateRangePicker, showDialog, showAdaptiveDialog, showMenu, and showTimePicker. A review comment identifies a redundant import of package:flutter/foundation.dart in date_picker.dart, as the required symbols are already available through other existing imports.


import 'dart:math' as math;

import 'package:flutter/foundation.dart' show awaitNotRequired;

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

This import is redundant. Both package:flutter/rendering.dart (line 14) and package:flutter/widgets.dart (line 16) already export package:flutter/foundation.dart, making its symbols (including awaitNotRequired) available in this file. Removing it adheres to the repository's principle of writing only what is necessary.

References
  1. Write what you need and no more, but when you write it, do it right. (link)

@dkwingsmt dkwingsmt left a comment

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.

LGTM

@Piinks Piinks added the Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. label Jun 24, 2026
@Piinks

Piinks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I've marked this PR as not ready to port to flutter/packages yet.
We'll provide instructions to move this change over to material_ui/cupertino_ui once ready to receive PRs. Thank you!

@victorsanni

Copy link
Copy Markdown
Contributor Author

Closing as superseded by design library PRs.

auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 9, 2026
material_ui split of [Add awaitNotRequired annotation to Material/Cupertino libraries](flutter/flutter#185446)

Part of [Use @awaitNotRequired in Flutter SDK](flutter/flutter#168555)
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 9, 2026
…out await (#12817)

cupertino_ui split of [Add awaitNotRequired annotation to Material/Cupertino libraries](flutter/flutter#185446)

Part of [Use @awaitNotRequired in Flutter SDK](flutter/flutter#168555)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. p: cupertino_ui cupertino_ui package in flutter/packages p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants