Repository navigation
Add awaitNotRequired annotation to Material/Cupertino libraries - #185446
victorsanni wants to merge 26 commits into
Conversation
|
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. |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
- Write what you need and no more, but when you write it, do it right. (link)
|
I've marked this PR as not ready to port to flutter/packages yet. |
|
Closing as superseded by design library PRs. |
material_ui split of [Add awaitNotRequired annotation to Material/Cupertino libraries](flutter/flutter#185446) Part of [Use @awaitNotRequired in Flutter SDK](flutter/flutter#168555)
…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)
Part of Use @awaitNotRequired in Flutter SDK
The non-design parts of this issue is done in Add @awaitNotRequired annotation to flutter sdk.