<!-- start_original_pr_link -->
Reverts: flutter/flutter#178817
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: Piinks
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: change was landed during tree closure
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: flutter-zl
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {chunhtai}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
This is a reland of #177570, which was reverted in #178744 due to test
failures.
The original PR introduced `hitTestBehavior` to the semantics framework
but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked
platform views from receiving pointer events.
Instead of making the entire modal opaque, we:
1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to
`defer`)
2. Make only the dialog/sheet content opaque (blocks clicks to barrier)
3. Platform views remain clickable because they're outside the opaque
content boundary
Fixes#149001
Original PR: #177570
Revert: #178744
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
This is a reland of #177570, which was reverted in #178744 due to test
failures.
The original PR introduced `hitTestBehavior` to the semantics framework
but incorrectly applied `opaque` behavior to `ModalRoute`, which blocked
platform views from receiving pointer events.
Instead of making the entire modal opaque, we:
1. Keep `ModalRoute` without explicit `hitTestBehavior` (defaults to
`defer`)
2. Make only the dialog/sheet content opaque (blocks clicks to barrier)
3. Platform views remain clickable because they're outside the opaque
content boundary
Fixes#149001
Original PR: #177570
Revert: #178744
## What's new?
- Added tooltips to the windowing API, but they have no implementation
for the time being
- Added the `WindowPostiioner` logic to the windowing API
- Wrote a lot of tests 🧪
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
fixes https://github.com/flutter/flutter/issues/178982
This payload used to not matter (since the display ID was always zero),
but now not setting the display ID results in the display ID to be set
to zero. That is unfortunate, but this is a good fix for now!
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Fixes https://github.com/flutter/flutter/issues/173097
The semantics flush is ~200 μs slower with the shortcuircut removed +
#177477 (which reduces the time increase by ~ 100 μs, from 876 μs to 773
μs) I tried to introduce caching in [a different
patch](https://github.com/flutter/flutter/compare/master...LongCatIsLooong:semantics-geometry?expand=1)
but that patch is more risky and still needs a cleanup.
773 μs doesn't seem bad considering there were little to no geometry
updates between frames before the fix. Introducing cache currently only
improves `Semantics.ensureGeometry` by less than 100 μs and is much more
risky / harder to ensure the correctness.
### BEFORE
```
[bench_material3_scroll_semantics] name: bench_material3_scroll_semantics
SEMANTICS: (samples: 98 clean/2 outliers/100 measured/300 total)
| average: 567.0510204081633 μs
| outlier average: 799 μs
| outlier/clean ratio: 1.4090442856885785x
| noise: 13.95%
Semantics.updateChildren: (samples: 91 clean/9 outliers/100 measured/300 total)
| average: 58.9010989010989 μs
| outlier average: 199.88888888888889 μs
| outlier/clean ratio: 3.3936359867330017x
| noise: 82.78%
Semantics.ensureGeometry: (samples: 95 clean/5 outliers/100 measured/300 total)
| average: 95.46315789473684 μs
| outlier average: 299 μs
| outlier/clean ratio: 3.1320983570404675x
| noise: 64.29%
Semantics.ensureSemanticsNode: (samples: 100 clean/0 outliers/100 measured/300 total)
| average: 78.59 μs
| outlier average: 78.59 μs
| outlier/clean ratio: 1x
| noise: 80.86%
drawFrameDuration: (samples: 98 clean/2 outliers/100 measured/300 total)
| average: 1685.6938775510205 μs
| outlier average: 2000 μs
| outlier/clean ratio: 1.1864550418285935x
| noise: 7.77%```
```
### AFTER (with this and https://github.com/flutter/flutter/pull/177477)
```
[bench_material3_scroll_semantics] name: bench_material3_scroll_semantics
SEMANTICS: (samples: 91 clean/9 outliers/100 measured/300 total)
| average: 773.1098901098901 μs
| outlier average: 1000 μs
| outlier/clean ratio: 1.2934771793669069x
| noise: 10.65%
Semantics.updateChildren: (samples: 94 clean/6 outliers/100 measured/300 total)
| average: 48.648936170212764 μs
| outlier average: 200 μs
| outlier/clean ratio: 4.111086813907719x
| noise: 102.15%
Semantics.ensureGeometry: (samples: 95 clean/5 outliers/100 measured/300 total)
| average: 239.55789473684212 μs
| outlier average: 399.6 μs
| outlier/clean ratio: 1.6680727656208807x
| noise: 22.05%
Semantics.ensureSemanticsNode: (samples: 99 clean/1 outliers/100 measured/300 total)
| average: 194.5151515151515 μs
| outlier average: 400 μs
| outlier/clean ratio: 2.0563950771148156x
| noise: 31.31%
drawFrameDuration: (samples: 95 clean/5 outliers/100 measured/300 total)
| average: 1775.8315789473684 μs
| outlier average: 2099.6 μs
| outlier/clean ratio: 1.1823193285280729x
| noise: 7.56%
```
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
## Description
This PR adds an assert message to help users understand the error
occuring when `OverlayEntry.remove` is called twice. It also adds a
comment about calling dispose after removal as this is mandatory since
github.com/flutter/flutter/issues/102794.
## Related Issue
Fixes ["Failed assertion: line 207 pos 12: '_overlay != null': is not
true" when trying to remove a non null
overlayEntry](https://github.com/flutter/flutter/issues/145466)
Related external issue:
https://github.com/LanarsInc/top-snackbar-flutter/issues/80
## Tests
- Adds 1 test.
Includes the following commits:
```
8dcc6bc368f [linter] Test unnecessary ignore logic for unique names.
ea75975e030 [vm,ia32] Avoid clobbering callee-save register in assembler test
60de6c5dad9 Update analysis server diagnostics page to use relative links
a89b2d6e539 [frontend_server_client] Syncing frontend_server_client Package with Webdev Repo
4d669c06ee5 [CFE] Change core to '3' for benchmarker-golem
76dcc632ca7 add a tool for searching for dart and flutter releases containing a specific commit
6230f5bd9df [vm] Skip appending Windows unwinding sections for relocatable objects.
4f1f82f59ee [dds/dap] Fix evaluateNames of global variables
7cd95f5f91e [linter] Introduce a new representation for removed lints.
0d052e39698 [deps] Roll dart-lang/native
2c804fa2513 [vm] Handle the context of implicit instance closures in the debugger.
```
Manual roll to accommodate `package:record_use` move into native
monorepo
Fixes#169119
## Details
The error caused by drag is due to the reference to
`ServicesBinding.instance.restorationManager` in the
`ScrollableState.saveOffset` method.
018897e3f1/packages/flutter/lib/src/widgets/scrollable.dart (L648-L656)
The TestWidgetsFlutterBinding now only cleans up the
`restorationManager` when `reset` is called. Therefore, we need to find
an appropriate place to clean up the `restorationManager`.
018897e3f1/packages/flutter_test/lib/src/binding.dart (L239-L263)018897e3f1/packages/flutter_test/lib/src/widget_tester.dart (L188-L193)
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
---------
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Since `flutter clean` can delete the `.dart_tool/` directory while a
`flutter widget-preview start` command is active, it's possible for the
`widget_preview_scaffold` to be deleted and cause the preview process to
crash.
This change works around this issue by always generating the
`widget_preview_scaffold` project under $TMP on each invocation of the
previewer. This doesn't result in much of a regression in startup times
as we currently aren't launching the previewer using restored state as
this isn't currently possible with the web device targets. Moving the
scaffold under $TMP means Flutter tooling will never accidentally delete
the scaffold while the previewer is running.
Filed https://github.com/flutter/flutter/issues/179036 to track
reverting this behavior when a better solution is found.
Fixes https://github.com/flutter/flutter/issues/175058
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
Passes `EXCLUDED_ARCHS` from Xcode project build settings to the
xcodebuild command, fixing macOS builds when
dependencies don't support all architectures.
### Problem
Release builds for macOS create universal binaries (arm64 + x86_64) by
default. This causes build failures when
using native dependencies that only provide binaries for a single
architecture. While developers can set
`EXCLUDED_ARCHS` in their Xcode project's xcconfig files, Swift Package
Manager dependencies don't respect this
project-level setting.
**Fixes**: https://github.com/flutter/flutter/issues/176605
## Solution
Instead of adding a CLI flag, pass `EXCLUDED_ARCHS` from the Xcode
project's build settings directly to xcodebuild. This ensures Swift
Package Manager dependencies respect architecture exclusions set in the
project configuration.
**How it works:**
When `macos/Runner/Configs/Release.xcconfig` contains:
```xcconfig
EXCLUDED_ARCHS = x86_64
```
The build command now includes `EXCLUDED_ARCHS=x86_64`, creating an
arm64-only binary.
## Usage
**1. Edit your xcconfig file** (e.g.,
`macos/Runner/Configs/Release.xcconfig`):
```xcconfig
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
// Exclude x86_64 for dependencies that only support Apple Silicon
EXCLUDED_ARCHS = x86_64
```
**2. Build normally:**
```bash
flutter build macos --release
```
**Without exclusions (default behavior):**
```bash
# Creates universal binary (arm64 + x86_64)
flutter build macos --release
```
## Implementation
- Modified `buildMacOS()` to retrieve `EXCLUDED_ARCHS` from Xcode
project build settings
- Pass `EXCLUDED_ARCHS` to xcodebuild command when set and non-empty
- Removed unused `activeArch` parameter
- Added inline documentation explaining the SPM compatibility fix
## Testing
**Manual verification:**
- ✅ Built ExecuTorch Flutter example with `EXCLUDED_ARCHS = x86_64`:
arm64-only binary (518.6MB)
- ✅ Built without exclusions: universal binary (existing behavior)
- ✅ Verified architecture with `lipo -info`: arm64-only when excluded
**Unit tests:**
- ✅ Added test: "Passes EXCLUDED_ARCHS from Xcode project to xcodebuild
command"
- ✅ Added test: "Does not pass EXCLUDED_ARCHS when not set in Xcode
project"
- ✅ All 25 macOS build tests passing
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
Adding some more logging and retrying mechanisms to the win32 windowing
tests to see if it fixes the flakiness.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Reverts flutter/flutter#177410
The change is causing the task `wide_gamut_ios` to hang every time.
Local testing shows that reverting this commit fixes the problem.
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the SearchAnchor
widget.
---------
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Stepper widget.
---------
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
UserAccountsDrawerHeader widget.
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the TimePickerDialog
widget.
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
CupertinoLinearActivityIndicator widget.
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the CupertinoTabBar
widget.
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This PR fixes https://github.com/flutter/flutter/issues/169147
This is the iOS implementation of
https://github.com/flutter/flutter/issues/149033
In Add-to-App scenarios, a common desired use case is to have the
embedded FlutterView be able to size itself based on it's content. Up
till now, the size had to be manually specified, which can be tedious
and inaccurate.
This PR adds a new flag, `isAutoResizable`, which enables the ability
for the embedded flutter view to dynamically set it's own size based off
it's content. Note that this feature will *NOT* work if the the embedded
app is wrapped in flexible or unsized widgets, such as Scaffold. The
FlutterView will just not display at all.
To use the new flag, just set it like
```
flutterViewController.autoResizable = true;
```
or in Swift
```
flutterViewController.isAutoResizable = true
```
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.