7855 Commits

Author SHA1 Message Date
Kate Lovett
8373cae876
[CP-stable] Pub dependencies & widget_preview_scaffold tests relocation (#182317)
Fixes https://github.com/flutter/flutter/issues/182314

This cherry picks in 2 changes to stable
- https://github.com/flutter/flutter/pull/180886
  - The pub roller was busted, and the stable release missed the update
- https://github.com/flutter/flutter/pull/180658
  - Preceded manual pub roll, required to pass analysis with above change.

This is a manual cherry pick, following https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md

Around about when we created the release, the pub roller was busted. It is fixed now (https://github.com/flutter/flutter/issues/180503).

Impacted Users: significant
Impact Description: users cannot upgrade to the latest version
Workaround: None
Risk: Not sure, but the pub roll this is cherry picking landed very very close to the stable release being cut. Analysis and flutter doctor all pass.
Test Coverage: For the widget scaffold change, tests are just relocated
Validation steps: https://github.com/dart-lang/test/issues/2570#issue-3684439955

**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.
2026-02-12 22:16:25 +00:00
Victoria Ashworth
37f698a5b5
Generate Flutter framework swift package (#181578)
This PR creates a FlutterFramework swift package with no real content. This is a placeholder so that plugins may add a dependency on the FlutterFramework in their Package.swift before https://github.com/flutter/flutter/pull/178931 lands in stable. See go/swiftpm-flutter-release.

Impacted Users: Flutter iOS with SwiftPM feature flag enabled

Impact Description: Allows plugins to add a dependency on the FlutterFramework in their Package.swift.

Workaround: See Problem 2 alternatives in [go/swiftpm-flutter-release](http://goto.google.com/swiftpm-flutter-release)

Risk: This PR by itself is low risk. It just generates a couple files in an ephemeral directory. It only is actually used if a plugin adds a dependency on it in it's Package.swift. If a plugin does this, it's still low risk since it's basically just an empty Swift package. It's also behind a feature flag (`flutter config --enable-swift-package-manager`), which can be disabled.

Test Coverage: Yes

Validation Steps: 
 - `flutter config --enable-swift-package-manager`
 - `flutter create my_plugin && cd my_plugin/example`
 - Add `FlutterFramework` to Package.swift (see [example](https://github.com/flutter/flutter/blob/master/packages/integration_test/ios/integration_test/Package.swift#L15-L21))
 - `flutter build ios`

**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.
2026-01-28 17:40:34 +00:00
Ben Konyi
57c022c87b
[CP-beta][ Tool ] Handle DartDevelopmentServiceException when launching web applications (#181162)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

https://github.com/flutter/flutter/issues/178151

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples

`flutter run -d chrome` can crash with a `DartDevelopmentServiceException` if the application shuts down during the startup sequence.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Flaky crashes for users developing Flutter web applications. This is one of the top crashers for 3.38.

### Workaround:
Is there a workaround for this issue?

N/A

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

Difficult to validate manually as the failure is timing based. Tests have been added to simulate the crash scenario and verify the fix.
2026-01-21 19:16:29 +00:00
Ben Konyi
e4f99016df
[CP-beta][ Tool ] Fix flutter run -d all crash (#180845) (#181163)
### Issue Link:
What is the link to the issue this cherry-pick is addressing?

https://github.com/flutter/flutter/issues/179857

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.

`flutter run -d all` causes the tool to crash if multiple devices are available.

### Changelog Description:
Explain this cherry pick:
* In one line that is accessible to most Flutter developers.
* That describes the state prior to the fix.
* That includes which platforms are impacted.
See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples.

`flutter run -d all` causes the tool to crash if multiple devices are available.

### Workaround:
Is there a workaround for this issue?

No.

### Risk:
What is the risk level of this cherry-pick?

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

### Validation Steps:
What are the steps to validate that this fix works?

Run `flutter run -d all` with multiple non-web devices available and verify the application is deployed to all non-web devices.
2026-01-21 19:16:24 +00:00
Nour
93cba59cee
flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (#177888)
# flutter_tools: Auto-generate ExportOptions.plist for manual iOS code
signing

## Summary

Enhance `flutter build ipa` to automatically generate a complete
ExportOptions.plist for manual code signing configurations, eliminating
the need for users to create and maintain one manually.

**Fixes:** #177853

## Problem

When using manual code signing (`CODE_SIGN_STYLE=Manual`) with `flutter
build ipa` for Release/Profile builds, the archive succeeds but the
export step fails with:

```
error: exportArchive: "Runner.app" requires a provisioning profile with the Push Notifications and Sign in with Apple features.
```

**Root cause:** Flutter generated an incomplete ExportOptions.plist that
only included `method` and `uploadBitcode`. When using manual signing,
`xcodebuild -exportArchive` requires:
- `teamID` (from project's `DEVELOPMENT_TEAM`)
- `signingStyle=manual`
- `provisioningProfiles` (mapping bundle ID to provisioning profile
UUID)

Without these, Xcode cannot resolve the provisioning profile for export,
even if the profile is correctly configured and contains the required
entitlements.

## Solution

Enhanced `_createExportPlist()` in `BuildIOSArchiveCommand` to
automatically generate a complete ExportOptions.plist when:
1. `CODE_SIGN_STYLE=Manual` is detected for the main app target
2. Build mode is Release or Profile (production builds only)
3. A valid provisioning profile can be located and parsed

The generated plist includes:
- `method` (app-store, ad-hoc, enterprise, etc. - respects user's
`--export-method` flag)
- `teamID` (from `DEVELOPMENT_TEAM` build setting)
- `signingStyle=manual`
- `provisioningProfiles` mapping main app bundle ID to provisioning
profile UUID

**Fallback behavior:**
- If profile lookup fails: silently fall back to simple plist (no
regression)
- For Automatic signing: unchanged behavior
- For Debug builds: unchanged behavior (not App Store export)
- For multi-target apps (extensions): falls back to simple plist today
(see TODO below)

## Changes

### Core Implementation
- Added `ProfileData` class to encapsulate provisioning profile info
(UUID and name)
- Refactored profile handling into reusable static methods for
testability
- Enhanced `_createExportPlist()` with manual signing detection and
profile lookup
- Added `_findProvisioningProfileUuid()` to locate provisioning profiles
by specifier
- Added `_parseProvisioningProfileInfo()` to decode provisioning profile
data once
- Added comprehensive trace logging for debugging

### Testing
- Created `build_ipa_export_plist_test.dart` with 7 unit tests covering:
  - Manual signing with profile found → enhanced plist generated ✓
  - Automatic signing → simple plist (unchanged behavior) ✓
  - Debug builds → simple plist (unchanged behavior) ✓
  - Different export methods → respected in generated plist ✓
  - Profile lookup failures → fallback to simple plist ✓
  - Null codeSignStyle → handled gracefully ✓
- All existing flutter_tools tests continue to pass

## Documentation

Added extensive inline comments explaining:
- Enhancement conditions and fallback behavior
- Provisioning profile search strategy and error handling
- Performance and security considerations
- Future enhancements (multi-target support)

## Safety & Scope

### What This Fixes
-  Manual signing export failures for apps with Push Notifications /
Sign in with Apple
-  Auto-generates correct plist for **any** entitlements covered by
provisioning profile
-  Unblocks users from manual `--export-options-plist` workaround
-  Improves iOS build UX for enterprise teams doing manual signing

### What This Does NOT Change
-  Automatic signing behavior (unchanged)
-  Debug builds (unchanged)
-  CLI interface (no new flags)
-  Ad-hoc / enterprise distributions (unchanged if not using manual
signing)

### Known Limitations (Future Enhancements)
- Currently only supports single-target apps (main app bundle ID only)
- TODO: Multi-target apps with extensions (notification service,
widgets, watch, etc.) - each extension target bundle ID may need
separate entry in provisioningProfiles dict
- TODO: Support for multiple provisioning profiles if app uses multiple
signing identities

---

## Pre-merge Checklist

- [x] I have signed the CLA
- [x] I read the Contributor Guide and Tree Hygiene docs
- [x] I linked the issue this fixes (#177853) and explained the failure
scenario
- [x] I added documentation and trace logs so developers understand what
changed
- [x] I added comprehensive unit tests for the new behavior
- [x] All existing and new tests pass locally (`flutter test
packages/flutter_tools`)
- [x] Code passes linting (`dart analyze`)

## Safety Notes

- [x] This code only runs for manual code signing in `flutter build ipa`
for Release/Profile builds
- [x] Debug builds and automatic signing behavior are completely
unchanged
- [x] If no provisioning profile UUID is found, we silently fall back to
the old exportOptions.plist logic instead of failing
- [x] Added trace-level logging explaining success/fallback scenarios
for debugging
- [x] No breaking changes - existing workarounds continue to work
- [x] Minimal blast radius - only affects manual signing export path

## Verification

Users can verify the fix by:
1. Creating an iOS app with `CODE_SIGN_STYLE=Manual`, `DEVELOPMENT_TEAM`
set, and Push Notifications entitlements
2. Running `flutter build ipa --release --verbose`
3. Confirming the trace log shows "Generated ExportOptions.plist with
teamID, signingStyle=manual, and provisioningProfiles"
4. Verifying the IPA is successfully created without needing
`--export-options-plist`

---

## Related Issues
- #106612 - Support `flutter build ipa` with manual signing and
provisioning profiles
- #113977 - Flutter build IPA with --export-options-plist not working

---------

Co-authored-by: Elijah Okoroh <okorohelijah@google.com>
2026-01-08 12:09:39 +00:00
Victoria Ashworth
941130b9f1
Revert "Directly generate a Mach-O dynamic library using gen_snapshot [reland] (#174870) (#180639)
This reverts commit 4b6e0bdcfacd39f01fad4529217188db3ce516c8.

Fixes https://github.com/flutter/flutter/issues/178602.

## 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
2026-01-07 18:39:55 +00:00
Michael Goderbauer
a5b3c4bd69
Run hook_user_defines and link_hook integration tests on CI (#180622)
Fixes https://github.com/flutter/flutter/issues/180575.

As per the
[readme](https://github.com/flutter/flutter/blob/master/dev/integration_tests/README.md#:~:text=Adding%20code%20to%20this%20directory%20will%20not%20automatically%20cause%20it%20to%20be%20run%20by%20any%20already%20existing%20ci%20tooling.),
tests in dev/integration_tests are not automatically run on CI:

> Adding code to this directory will not automatically cause it to be
run by any already existing ci tooling.

This PR fixes the problem by running the `hook_user_defines` and
`link_hook` integration tests as part of the tools integration test
shard.

One of the tests actually broke while it wasn't running on CI. This is
fixed by removing it from the workspace to ensure the local user-defines
in its pubspec are applied.
2026-01-07 16:52:25 +00:00
Michael Goderbauer
55b609466f
Unpin DDS (#180571)
Fly-by clean-up: My understanding from the
[changelog](https://pub.dev/packages/dds/changelog) is that the change
causing the bug in 5.0.4 has been reverted in 5.0.5. Therefore, the pin
should be no longer necessary? Unpinning to find out...

> 5.0.5 
[DAP] The change in DDS 5.0.4 to individually add/remove breakpoints has
been reverted and may be restored in a future version.
>
>5.0.4 
[DAP] Breakpoints are now added/removed individually instead of all
being cleared and re-added during a setBreakpoints request. This
improves performance and can avoid breakpoints flickering between
unresolved/resolved when adding new breakpoints in the same file.
2026-01-07 09:32:44 +00:00
Ben Konyi
15c48f2922
[ Widget Preview ] Add support for dart:ffi imports (#180586)
Adds logic to pass `--include-unsupported-platform-library-stubs` to the
CFE when launched via `flutter widget-preview start`, as well as logic
to ensure the flag can't be passed as an extra frontend option to bypass
compile time errors due to imports of unsupported libraries.

Fixes https://github.com/flutter/flutter/issues/166431
2026-01-07 01:47:22 +00:00
🧙‍♂️ O Mago do Flutter 🪄
9766a97c54
Add --web-define flag for template variable injection in Flutter web builds (#175805)
<!--
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
-->

## Add --web-define option for runtime variable injection in Flutter web
templates

This PR adds support for injecting environment-specific variables into
Flutter web templates during development and build processes through a
new `--web-define` command-line option.

### What this changes

**Before**: Developers had to manually edit HTML templates or use
build-time workarounds to inject environment-specific values (API URLs,
feature flags, etc.) into Flutter web applications.

**After**: Developers can now use `--web-define KEY=VALUE` to inject
variables directly into web templates using `{{VARIABLE_NAME}}`
placeholders.

### Key features

- **Template variable substitution**: Support for `{{VARIABLE_NAME}}`
placeholders in `index.html` and `flutter_bootstrap.js`
- **Runtime validation**: Throws clear errors when required variables
are missing with helpful suggestions
- **Command-line integration**: Works with both `flutter run` and
`flutter build web` commands
- **Multiple variable support**: Can define multiple variables in a
single command
- **Built-in variable protection**: Ignores Flutter's built-in template
variables during validation

### Usage examples

```bash
# Development with API configuration
flutter run -d chrome --web-define=API_URL=https://dev-api.example.com --web-define=DEBUG_MODE=true

# Production build with environment variables
flutter build web --web-define=API_URL=https://api.example.com --web-define=ANALYTICS_ID=GA-123456 --web-define=DEBUG_MODE=false

# Multiple environments
flutter run -d chrome --web-define=ENV=staging --web-define=FEATURE_X=enabled
```

### Template usage

In your `web/index.html`:
```html
<script>
  window.config = {
    apiUrl: '{{API_URL}}',
    environment: '{{ENV}}',
    debugMode: {{DEBUG_MODE}}
  };
</script>
```

### Error handling

If a variable is missing, the tool provides clear feedback:
```
Missing web-define variable: API_URL

Please provide the missing variable using:
flutter run --web-define=API_URL=VALUE
or
flutter build web --web-define=API_URL=VALUE
```

## Issues fixed

Fixes https://github.com/flutter/flutter/issues/127853

## Additional Usage Examples

### Environment-Specific Configurations (Flavors)
```bash
# Development
flutter run -d chrome --web-define=ENV=dev --web-define=API_URL=http://localhost:3000 --web-define=DEBUG=true

# Production
flutter build web --web-define=ENV=prod --web-define=API_URL=https://api.example.com --web-define=DEBUG=false
```

**Template:**
```html
<script>
  window.config = {
    environment: '{{ENV}}',
    apiUrl: '{{API_URL}}',
    debugMode: {{DEBUG}}
  };
</script>
```

### Dynamic Asset Loading
```bash
flutter build web --web-define=CDN_URL=https://cdn.example.com --web-define=LOGO_PATH=/assets/logo.png
```

**Template:**
```html
<link rel="icon" href="{{CDN_URL}}{{LOGO_PATH}}">
<link rel="stylesheet" href="{{CDN_URL}}/styles/theme.css">
```

### Analytics Integration
```bash
flutter build web --web-define=GA_ID=G-XXXXXXXXXX --web-define=SENTRY_DSN=https://xxx@sentry.io/123
```

**Template:**
```html
<script async src="https://www.googletagmanager.com/gtag/js?id={{GA_ID}}"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', '{{GA_ID}}');
</script>
```

### Feature Flags
```bash
flutter run -d chrome --web-define=FEATURE_X=true --web-define=FEATURE_Y=false
```

**Template:**
```html
<script>
  window.features = { featureX: {{FEATURE_X}}, featureY: {{FEATURE_Y}} };
</script>
```

### Multi-Tenant/White-Label Apps
```bash
flutter build web --web-define=TENANT=acme --web-define=PRIMARY_COLOR=#FF5733 --web-define=LOGO_URL=https://cdn.acme.com/logo.png
```

**Template:**
```html
<head>
  <title>{{TENANT}} Portal</title>
  <link rel="icon" href="{{LOGO_URL}}">
  <style>:root { --primary: {{PRIMARY_COLOR}}; }</style>
</head>
```

### Backend Service URLs
```bash
flutter build web \
  --web-define=API_URL=https://api.example.com \
  --web-define=WS_URL=wss://ws.example.com \
  --web-define=AUTH_DOMAIN=auth.example.com
```

**Template:**
```html
<script>
  window.services = {
    api: '{{API_URL}}',
    websocket: '{{WS_URL}}',
    auth: '{{AUTH_DOMAIN}}'
  };
</script>
```

### SEO & Meta Tags
```bash
flutter build web --web-define=APP_TITLE="My App" --web-define=APP_DESC="Description" --web-define=OG_IMAGE=https://example.com/og.png
```

**Template:**
```html
<head>
  <title>{{APP_TITLE}}</title>
  <meta name="description" content="{{APP_DESC}}">
  <meta property="og:title" content="{{APP_TITLE}}">
  <meta property="og:image" content="{{OG_IMAGE}}">
</head>
```

### Build Automation
```json
{
  "scripts": {
    "dev": "flutter run -d chrome --web-define=ENV=dev --web-define=API_URL=http://localhost:3000",
    "prod": "flutter build web --web-define=ENV=prod --web-define=API_URL=https://api.example.com"
  }
}
```

### Important Notes
- **Security**: Never expose secrets via `--web-define` (client-side
only)

## 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
Co-authored-by: Mouad Debbar <mdebbar@google.com>
2026-01-07 00:23:39 +00:00
Brahim GUAALI
26788b4a22
Forward proxy 404 responses to client (#179858)
## Description

Forward 404 responses from proxied backend to client instead of serving
index.html fallback.

Fixes https://github.com/flutter/flutter/issues/178754


## 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].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md


Contribution by talabat: 
<img
src="https://talabat-flutterstream.web.app/assets/assets/flutterstream.png"
width=60 />

Co-authored-by: Ben Konyi <bkonyi@google.com>
2026-01-06 22:07:07 +00:00
Muhammad Saqib Javed
fb865310c1
Restore CLI precedence for web headers and HTTPS over web_dev_config.yaml (#179639)
This PR restores the correct precedence behavior for web development
server configuration. Since Flutter 3.38, CLI arguments were being
ignored when `web_dev_config.yaml` was present — specifically for HTTPS
and headers.

According to the design and documentation, the precedence should be:

1. Command-line arguments (highest priority)
2. `web_dev_config.yaml`
3. Built-in defaults (lowest priority)

## Root Cause

The regression affected:

* **HTTP headers** — merge order was reversed, causing file config to
override CLI
* **HTTPS config** — CLI TLS arguments were ignored under certain
conditions

Note:
`--web-port` and `--web-hostname` were already working correctly due to
the `host ?? this.host` and `port ?? this.port` pattern.
The observed issue was due to headers + HTTPS only.

## Changes Made

* Fixed header merge order so CLI takes precedence
* Corrected HTTPS config resolution and precedence logic
* Unified logic across `run` and `drive` commands
* Simplified HTTPS handling using `HttpsConfig.parse()`
* Added tests for CLI precedence behavior

## Before (broken)

```
flutter run -d chrome --web-tls-cert-path cert.pem
```

 CLI TLS args ignored when config file existed
 headers overridden by file config

## After (fixed)

```
flutter run -d chrome --web-tls-cert-path cert.pem
```

 CLI TLS args respected
 headers override config as expected

## Tests

* Added tests verifying CLI takes precedence
* All existing and new tests pass
* No breaking changes introduced

## Fixes

Fixes: #179014

---------

Co-authored-by: Kevin Moore <kevmoo@google.com>
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
2026-01-06 21:11:05 +00:00
Daco Harkes
a0a27839c6
[hooks] Don't require NDK for Android targets (#180594)
When targeting Android, don't fail in Flutter tools if the NDK is not
installed. Instead, pass a `null` c compiler config to the hooks. The
hooks can then decide to fail if they need the NDK. If no hook happened
to require the NDK, Flutter for Android apps can be built without the
NDK installed.

Bug: https://github.com/flutter/flutter/issues/180163

## 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.
2026-01-06 19:02:11 +00:00
Ben Konyi
afb13d8bb7
[ Widget Preview ] Add UUID to registered DTD streams and services (#180140)
DTD only supports a single instance of a registered service with a given
name. For widget preview development, we sometimes want to use a DTD
instance that's attached to an IDE to test IDE integration. However,
IDEs frequently spawn their own widget preview instances which register
services with DTD. In the case where `flutter widget-preview start
--dtd-url=<dtd-url>` is run and `dtd-url` points to a DTD instance with
another widget preview service running, the process simply crashes.

This change adds a unique identifier to the widget preview DTD service
and stream names that allows for each `flutter widget-preview start`
instance to register its own unique widget preview DTD services, even if
other widget preview instances are using the same DTD instance.

Fixes https://github.com/flutter/flutter/issues/179883
2026-01-05 19:52:27 +00:00
Sam Rawlins
0f2514a61d
Remove @override annotations from things which are not overrides (#180417)
These annotations are applied to top-level elements, which override
nothing.

A new warning from the Analyzer will start to report these.
2025-12-31 23:22:20 +00:00
Srujan Gaddam
96ae88f398
Pass canaryFeatures to BuildSettings (#180108)
Previously, this made little difference as DWDS used this only in one
case with expression evaluation but now that the load strategies have
diverged based on this flag, we should correctly always pipe this flag.
This fixes an issue with a future DWDS version.

## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] 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].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-12-19 18:15:01 +00:00
Jackson Gardner
f804fb5b4e
Add explicit --cross-origin-isolation flag to flutter run. (#180026)
Fixes https://github.com/flutter/flutter/issues/163479

This adds a flag,
`--cross-origin-isolation`/`--no-cross-origin-isolation` that allows the
user to explicitly control whether `flutter run`/`drive`/`test` serves
files with COOP/COEP headers. If the user doesn't specify, it uses cross
origin isolation when wasm is enabled and no cross origin isolation when
wasm is disabled.
2025-12-18 20:57:15 +00:00
jesswrd
aafc925958
[AGP 9] Fix-Forward Website URL (#180018)
Need to fix-forward website url. Minor change from 
`https://docs.flutter.dev/release/breaking-changes/update-to-AGP-9` to 
`https://docs.flutter.dev/release/breaking-changes/migrate-to-agp-9`

Should align with the file convention from this website PR:
https://github.com/flutter/website/pull/12825

## 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
2025-12-17 22:18:25 +00:00
jesswrd
abe119cf64
[AGP 9] Added Flutter Errors (#179765)
Added Flutter errors that direct users to Updating to AGP 9 Flutter
docs. The doc outlines the changes that must be made in order to
successfully build Flutter apps on Android using AGP 9+.

As of this moment, the doc has yet to be written. The errors just have
to be cherry picked to stable and beta by Tuesday, 12/16. The Flutter
doc PR [here](https://github.com/flutter/website/pull/12825) can land
later.

Resolves https://github.com/flutter/flutter/issues/179914

## 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.
- [ ] 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
2025-12-17 18:14:12 +00:00
Nate Biggs
aefbf3dce0
Deduplicate wasm dry run entries in analytics. (#179970)
Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-12-17 04:49:26 +00:00
Nate Biggs
4916988374
Add package info to wasm dry run events. (#179826)
Uses new event structure to capture package info from wasm dry run
errors.

Uses the `package_info.json` to gather the set of public packages and
only includes package names when the package is in that set of publicly
available packages.

Prepends "-p" for when an error type is found in a private package (i.e.
a `package:*` that isn't in the set of public packages), a "-h" for
non-public packages (i.e. any non-"package" packages or otherwise
unrecognized uris), or a "-ph" for both.

Adds a special "error" entry when the package_config can't be loaded and
instead includes the findings in the same format as today
(comma-separated codes).

Also adds tests for dry runs.

See https://github.com/flutter/flutter/issues/178894 for more context.

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-12-17 01:17:34 +00:00
Ben Konyi
6634f14f42
[ Tool ] Fix update-packages not accounting for path dependencies (#179951)
Each project's `pubspec.yaml` is copied into a temporary directory
before trying to determine which packages can be updated, but this
`pubspec.yaml` is currently deleted immediately after the dependencies
have been determined for the single package. This means that projects
that have path dependencies on other projects in the repository don't
have their dependencies updated properly as the path dependencies fail
to resolve.

This change updates the `update-packages` logic to copy each project's
`pubspec.yaml` to a temporary directory with a consistent relative
directory structure. The `_upgrade` function has been updated to support
processing multiple projects before deleting the temporary directory,
allowing for projects with path dependencies on each other to have their
pubspecs placed in the correct relative directories for them to resolve
correctly.

Fixes https://github.com/flutter/flutter/issues/179941
2025-12-16 20:59:23 +00:00
Илия
d292cfeed9
Add Cyrillic keyboard layout support for flutter_tools terminal commands (#177855)
## Description

This PR adds support for Cyrillic (Russian ЙЦУКЕН) keyboard layout in
the flutter_tools terminal handler, allowing users to use hot reload,
hot restart, and other terminal commands without switching keyboard
layouts.

## Motivation

Developers working with Cyrillic keyboard layouts currently must switch
to a Latin layout every time they want to use terminal commands like hot
reload (r/R) or help (h). This disrupts the development workflow and
reduces productivity.

## Changes

The implementation maps Cyrillic characters to their corresponding Latin
equivalents based on physical key positions on QWERTY/ЙЦУКЕН layouts:

- **к/К** → r/R (hot reload/restart)  
- **й/Й** → q/Q (exit)
- **ц/Ц** → w/W (dump widget tree)
- **в/В** → d/D (detach)
- **р/Р** → h/H (help)
- **ш/Ш** → i/I (widget inspector/invert images)
- **ы/Ы** → s/S (screenshot/semantics)
- **е/Е** → t/T (render tree)
- **м/М** → v/V (DevTools)
- **а** → f (focus tree)
- **п** → g (source generators)
- **Д** → L (layer tree)
- **щ/Щ** → o/O (platform toggle)
- **з/З** → p/P (debug paint/performance overlay)
- **Г** → U (semantics inverse order)
- **ф** → a (profile widgets)
- **и** → b (brightness)
- **с** → c (clear)

## Testing

- Added comprehensive test coverage for Cyrillic keyboard commands
- All existing terminal_handler tests pass
- Verified that Cyrillic characters trigger the same actions as their
Latin equivalents

## Impact

This change improves the developer experience for users working with
Cyrillic keyboard layouts by eliminating the need for constant layout
switching during development. The implementation follows Flutter code
style guidelines and does not affect existing functionality.

---------

Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-12-16 19:40:34 +00:00
shindonghwi
2b61b85c66
Filter out FrameEvents/updateAcquireFence log spam from adb logcat (#179884)
## Problem

When using platform views like Google Maps on Android, the console gets
flooded with messages like:

```
E/FrameEvents(26685): updateAcquireFence: Did not find frame.
E/FrameEvents(26685): updateAcquireFence: Did not find frame.
E/FrameEvents(26685): updateAcquireFence: Did not find frame.
... (repeats many times)
```

This makes it hard to see actual errors and warnings in the console.

## Cause

This is a HWUI bug in Android, not an actual error. The message doesn't
indicate any problem with the application.

## Fix

Add a regex filter to `_filteredMessagees` in `AdbLogReader` to suppress
these messages, following the same pattern used for similar spam
messages like `SurfaceSyncer` and `ViewPostIme pointer`.

## Fixes

https://github.com/flutter/flutter/issues/104268

## 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.

<!-- 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
2025-12-16 19:33:01 +00:00
Ben Konyi
a78aefa9bc
[ Widget Preview ] Pass DTD URI as a constant in a generated file (#179821)
Passing the DTD URI via a Dart define results in a new
`<hash>.cache.dill.track.dill` being created on each run as the DTD URI
is never the same and the `cache.dill.track.dill` hash is partly based
on the set of Dart defines. These files are not cleaned up
automatically, so they could take up a significant amount of memory over
time.

This change adds an additional code generation step to the widget
previewer which populates
`widget_preview_scaffold/lib/src/dtd/dtd_connection_info.dart` with a
constant containing the DTD URI provided by the tool.

Fixes https://github.com/flutter/flutter/issues/179139
2025-12-15 15:01:29 +00:00
Nicholas Shahan
43f3f920ad
[flutter_tool] Force UTF-8 character set for dev (#179419)
* Set the character set on the response for the index.html
when running the app with flutter tool.
* Add expectation to existing test that verifies the character 
set on the requested index.html reponse.

Fixes: https://github.com/dart-lang/sdk/issues/62090

---------

Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-12-12 18:46:26 +00:00
Felipe Peter
4de6fcc369
Exit with code 1 when calling flutter build without arguments (#175900)
Resolves #5797

## 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.

A whole bunch of tool tests failed locally even before the change, so
I'll have to see CI results to know if something actually broke due to
the change.
2025-12-12 02:32:33 +00:00
Youssef Shamass
927f9ba289
[ Tool ] Assemble: "Improper" validation error when dealing with base64 encoded dart-define value (#178737)
addressing a regression from #172510 that caused the assemble command to
fail in the validation phase when a dart-define was passed as a
base64-encoded value.

Example command: 
```
flutter --verbose assemble --no-version-check \
  --output=<build_output_path>/ \
  -dTargetPlatform=ios \
  -dTargetFile=lib/main.dart \
  -dBuildMode=release \
  -dConfiguration=Debug \
  -dIosArchs=arm64 \
  -dSdkRoot=<xcode_sdk_path>/iPhoneOS.sdk \
  -dSplitDebugInfo= \
  -dTreeShakeIcons=false \
  -dTrackWidgetCreation=true \
  -dDartObfuscation=false \
  -dAction=install \
  -dFrontendServerStarterPath= \
  --ExtraGenSnapshotOptions= \
  --DartDefines=ZW52PXFh \
  --ExtraFrontEndOptions= \
  -dSrcRoot=<project_root> \
  -dTargetDeviceOSVersion= \
  -dCodesignIdentity=<codesign_identity> \
  release_ios_bundle_flutter_assets
 ```

Partially addressing: https://github.com/flutter/flutter/issues/178452

## 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].
- [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-12-12 02:28:21 +00:00
Ben Konyi
c1f134a009
[ Widget Preview ] Add embedded Widget Inspector support (#178116)
This change allows for users to open an instance of the DevTools Widget
Inspector within a web view embedded in the widget previewer. This will
allow for developers to inspect their previews without requiring IDEs to
create a special debug session for the widget previewer application.

DWDS is also rolled as part of this change to add DDS and DevTools
support for the `web-server` device.

Fixes https://github.com/flutter/flutter/issues/166423

**Demo:**


https://github.com/user-attachments/assets/3e3a1098-0526-4c7f-8087-38fb84f28335
2025-12-05 01:03:54 +00:00
Ben Konyi
49b416cf72
Unpin package:dwds dependency (#179462)
Refactoring of code in `package:dwds` `26.2.1` changed execution
ordering enough for a race condition in the web benchmark harness to be
hit. This change updates the web benchmark harness to not rely on
waiting for console output from the spawned browser which can be missed.

Fixes https://github.com/flutter/flutter/issues/178326

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-05 00:59:02 +00:00
Nicholas Shahan
a147aadf7e
[flutter_tools] Fix filename typo (#179427)
web_server_utlities.dart -> web_server_utilities.dart
2025-12-04 00:10:41 +00:00
Tess Strickland
4b6e0bdcfa
Directly generate a Mach-O dynamic library using gen_snapshot. [reland] (#174870)
Instead of generating assembly code that is then compiled to a Mach-O
dynamic library, use the new app-aot-macho-dylib output option for
gen_snapshot to generate the Mach-O dynamic library without the assembly
step.

This is a reland of https://github.com/flutter/flutter/pull/171626, with
the necessary changes to avoid the issue found in
https://github.com/flutter/flutter/issues/174393 where DWARF information
was being retained in the final snapshot. The initial PR state are the
original commits landed in the previous PR, with a followup commit
containing the fix for that issue: the DWARF information is moved into
an associated relocatable object, so the information is still accessible
by dsymutil before the snapshot is stripped.

Related issues:

* https://github.com/dart-lang/sdk/issues/43299
* https://github.com/dart-lang/sdk/issues/60307

## 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.
2025-12-02 11:29:46 +00:00
Ben Konyi
ddb060ee7e
[ Widget Preview ] Ignore changes under ios/.symlinks (#179290)
This directory should have been filtered as part of the fix for
https://github.com/flutter/flutter/issues/178317

Fixes https://github.com/flutter/flutter/issues/179008
2025-12-01 20:00:57 +00:00
Ben Konyi
4c1b7f8e6d
[ Tool ] Don't try to reattach when attach target disappears (#179193)
Before this change, there was logic in `flutter attach` that would try
and listen for a new application to attach to in the scenario the
current target application disappeared. This behavior isn't documented,
and has resulted in a `StateError` being thrown due to the VM service
URIs stream being listened to multiple times.

This change removes this behavior, which also prevents the `StateError`
from being thrown.

Fixes https://github.com/flutter/flutter/issues/156692, which is a
top-10 crasher for the tool.
2025-11-28 21:42:42 +00:00
Ben Konyi
baf781d0ae
[ Widget Preview ] Handle changes to unexpected pubspec.yaml files gracefully (#179157)
This change fixes an issue where the preview command would crash if a
`pubspec.yaml` was added / deleted somewhere under the previewed
directory. It also improves testing for `PreviewManifest` in the context
of pub workspaces and ensures that `FlutterProject` instances are
refreshed based on the latest `pubspec.yaml` contents.

Fixes https://github.com/flutter/flutter/issues/179155

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-27 21:51:19 +00:00
Elijah Okoroh
0b191ba123
Add shared Darwin implementation for plugins (#176495)
This PR introduces support for creating Flutter plugins with a single,
shared implementation for iOS and macOS. This is enabled by a new darwin
platform option in the flutter create command, which simplifies code
maintenance and reduces duplication for plugin authors.

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*
Fixes #161019 

*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
2025-11-26 23:00:42 +00:00
Ben Konyi
17b454204d
[ Tool ] Remove --no-sandbox when launching web apps on Chrome device (#178670)
Fixes https://github.com/flutter/flutter/issues/175227
2025-11-26 22:59:40 +00:00
Simon Binder
43d438f2ac
Build hooks: Don't require toolchain for unit tests (#178954)
To ensure build hooks emit code assets that are compatible with the main
app, Flutter tools pass a `CCompilerConfig` toolchain configuration
object to hooks. This is generally what we want, hooks on macOS should
use the same `clang` from XCode as the one used to compile the app and
native Flutter plugins for instance.

In some cases however, we need to run hooks without necessarily
compiling a full Flutter app with native sources. A good example for
this is `flutter test`, which runs unit / widget tests in a regular Dart
VM without embedding it in a Flutter application. So since `flutter
test` wouldn't invoke a native compiler, running build hooks shouldn't
fail if the expected toolchain is missing.

Currently however, `flutter test` tries to resolve a compiler toolchain
for the host platform. Doing that on Windows already allows not passing
a `CCompilerConfig` if VSCode wasn't found, but on macOS and Linux, this
crashes. This fixes the issue by allowing those methods to return `null`
instead of throwing. They still throw by default, but for the test
target they are configured to not pass a toolchain to hooks if none
could be resolved. This means that hooks not invoking the provided
toolchain (say because they're only downloading native artifacts
instead) would now work, whereas previously `flutter test` would crash
if no toolchian was found.

This closes https://github.com/flutter/flutter/issues/178715 (but only
the part shared in the original issue description, @dcharkes suggested
fixing a similar issue in the same PR but that is _not_ done here).
2025-11-26 22:58:00 +00:00
Daco Harkes
4e250ad4b6
[native assets] Bump minimum iOS version from 12 to 13 (#179079)
We don't have a single place to update the minimum iOS version in the
code base:

* https://github.com/flutter/flutter/issues/145104

So, when the minimum version was bumped, one place was missed.

Thanks for reporting @tnarik!
(https://github.com/flutter/flutter/pull/148504#issuecomment-3575518076)
2025-11-26 22:55:56 +00:00
Victoria Ashworth
4b8e73ba21
Add more templates that the UIScene migrator can match against (#179044)
Converts 2 static strings to a list of 4 options that are looped
through.

Fixes https://github.com/flutter/flutter/issues/178904.

## 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
2025-11-26 22:54:53 +00:00
Felipe Peter
8fed33ab3e
Fix error when generating pt_BR localizations (#175832)
Fixes #138609

The original logic of splitting by underscore doesn't work for locales
like pt_BR where the part after the underscore is itself a valid locale.

<!--
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
-->

## 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.

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: Ben Konyi <bkonyi@google.com>
2025-11-26 22:51:38 +00:00
Kate Lovett
9d96df2364
Modernize framework lints (#179089)
WIP

Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues 
- Run `dart format .` in the right places.

Local analysis and testing passes. Checking CI now.

Part of https://github.com/flutter/flutter/issues/178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)

## 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
2025-11-26 01:10:39 +00:00
Elijah Okoroh
ddba36ac4a
Dynamically set MinimumOSVersion in App.framework (#178253)
Currently, the MinimumOSVersion in App.framework/Info.plist is sourced
from a static template file created during flutter create. This value
can become out of sync with the -miphoneos-version-min flag used to
compile the App.framework binary, especially after a Flutter SDK
upgrade. This mismatch can lead to App Store submission warnings or
rejections.

This change fixes the issue by making the build process the single
source of truth for the MinimumOSVersion.

Fixes #176313 

*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.
- [ ] 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.

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
2025-11-25 03:39:36 +00:00
Ben Konyi
101ace2140
[ Widget Preview ] Always generate scaffold under $TMP (#179039)
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
2025-11-24 20:48:36 +00:00
Abdelaziz Mahdy
1b936203a9
Pass EXCLUDED_ARCHS from Xcode project to xcodebuild for macOS builds (#176948)
<!--
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>
2025-11-24 15:59:21 +00:00
Kevin Moore
153fd7fc60
Manually roll material_color_utilities (#170000)
This updates Flutter to the latest release, which includes a bunch of
code cleanup that should improve compiled code size and (hopefully)
runtime performance.

The changes in https://github.com/flutter/flutter/pull/153385 (discussed
in
https://docs.flutter.dev/release/breaking-changes/material-design-3-token-update)
seem to have been incomplete.

This PR effectively catches up with these changes by updating the "math"
behind primary, secondary, tertiary, error colors.

There is a pending PR on the site to update the corresponding docs:
https://github.com/flutter/website/pull/12125

Fixes https://github.com/flutter/flutter/issues/177285
2025-11-21 20:32:29 +00:00
Victoria Ashworth
a7fd1467d6
Use interactive mode with devicectl to redirect stdout (#178405)
Reverts https://github.com/flutter/flutter/pull/178167 and instead runs
`devicectl` in interactive mode by prefixing command with `script -t 0
/dev/null` to convince `devicectl` it has a terminal attached in order
to redirect stdout.

Fixes b/454953393. Related to
https://github.com/flutter/flutter/issues/178319.

## 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
2025-11-21 17:19:20 +00:00
Jason Simmons
d438df35f9
[ Tool ] Use a separate output directory when the native hooks run the build system (#178840)
FlutterBuildSystem.trackSharedBuildDirectory stores a hash of the most
recently run build configuration in the output directory defined in the
environment.

If the build executed by FlutterHookRunnerNative uses the same output
directory as other builds, then trackSharedBuildDirectory may think that
the hook build's output list replaces the outputs of those previous
builds. trackSharedBuildDirectory will then incorrectly delete files in
the previous output list because they are not part of the hook build's
outputs.

See https://github.com/flutter/flutter/issues/178529
2025-11-21 15:45:53 +00:00
Simon Binder
17e65b6f51
Fix layout for macOS frameworks for code assets (#178625)
To implement code assets, Flutter tooling converts `.dylib` files
emitted by hooks into Apple frameworks. The format of frameworks is
slightly different between macOS and other Apple platforms, and this
comment explains the correct format for macOS:


f954fb79dd/packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart (L134-L142)

Currently, the link from `Resources` to `Versions/Current/Resources` is
incorrectly generated to `Versions/A/Resources`. This fixes that to
generate both links to `Versions/Current`.

Closes https://github.com/flutter/flutter/issues/178623.
2025-11-19 17:43:00 +00:00
Kevin Moore
b1f4694258
[tool] Further cleanup of proxy logic (#178683)
Move getFinalTargetUri to ProxyRule class
Fix doc comments
Pares URI immediately when creating RegexProxyRule

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-18 20:06:57 +00:00