10029 Commits

Author SHA1 Message Date
Ben Konyi
f8e8a8dce9
[ Widget Preview ] Add --machine mode (#173654)
Currently only outputs a single event with information about where the
widget preview environment is served from:


`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`

Fixes https://github.com/flutter/flutter/issues/173545
2025-08-13 19:08:53 +00:00
Ben Konyi
1eb2f68da5
[ Widget Preview ] Move --dtd-url from a global flag to a widget-preview start option (#173712)
`--dtd-url` is only used by widget previews and has no current usage, so
this is a safe change.
2025-08-13 16:14:22 +00:00
Jamil Saadeh
f26eddba00
Null aware elements clean-ups (#173074)
<!--
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
-->
Converted more null checks to null aware elements.
The analyzer had many false negatives and the regex became pretty wild
to find many of them 😂

I've found more in the engine folder but I'll apply the changes in a
separate PR

Part of #172188 

*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-08-13 15:36:14 +00:00
hellohuanlin
b581cda7b9
[ios][tools]do not log "bonjour not found" at all (unless verbose) (#173569)
The previous PR https://github.com/flutter/flutter/pull/172913 avoids
compilation error by not having the "error: " prefix. However, it's
still very confusing to have "key not found" printed out in the terminal
(either stderr or stdout), despite that it doesn't cause compilation
error anymore.

This PR introduces a new flag "skipErrorLog" which skips logging the
`stderr` if set to true. We set it for plist extraction, because "not
having bonjour key" should be one of the expected "normal" states

<s> We don't want to pipe it to `stdout` either, because it would be
confusing too. I figured people would still file issue if they see it in
terminal, even if it's a completely normal state. But not a strong
opinion, so let me know if you disagree. </s>

However, under verbose mode, we would pipe it to `stdout`. This will be
consistent with our previous behavior before macOS 26.

*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 https://github.com/flutter/flutter/issues/172627

*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-08-12 22:00:09 +00:00
Ben Konyi
c4ce6a8ef7
Reapply "Make device debuggable if useDwdsWebSocketConnection is true … (#173551)" (#173628)
This reverts commit
17c92b7ba6.

Also added Chrome + `chromedriver` dependencies for the
`chrome_dev_mode` configurations.
2025-08-12 17:23:19 +00:00
Ben Konyi
fbba4becf6
[ Tool ] Fix crash from possible DDS startup race (#173362)
It's possible (but unlikely) that two DDS instances can try and start at
the same time (e.g., a "flutter run" is initiated while an existing
"flutter attach" is waiting for a target to attach to). This can lead to
DDS failing to initialize for one of the processes when the VM service
disconnects it after the other process successfully invokes the
"_yieldControlToDDS" RPC.

This change adds some retry logic to avoid crashing in this scenario.

Fixes https://github.com/flutter/flutter/issues/169265
2025-08-12 14:55:33 +00:00
auto-submit[bot]
17c92b7ba6
Reverts "Reapply "Make device debuggable if useDwdsWebSocketConnection is true … (#173551)" (#173568)" (#173587)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#173568
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: bkonyi
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Chrome isn't configured for the test configuration
and is causing failures.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bkonyi
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {jyameo, matanlurey}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
This reverts commit e2a347b14a18729dd24c2cf3240ef22562195e2d.

Previously reverted due to `*_chrome_dev_mode` tests failing on all
platforms.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-08-11 22:15:48 +00:00
Ben Konyi
a9fc145a3d
Reapply "Make device debuggable if useDwdsWebSocketConnection is true … (#173551)" (#173568)
This reverts commit e2a347b14a18729dd24c2cf3240ef22562195e2d.

Previously reverted due to `*_chrome_dev_mode` tests failing on all
platforms.
2025-08-11 20:43:29 +00:00
John "codefu" McDole
e2a347b14a
Revert "Make device debuggable if useDwdsWebSocketConnection is true … (#173551)
Reverts #171648 for multiple failing tests

<img width="624" height="347" alt="image"
src="https://github.com/user-attachments/assets/affc7820-bd1a-408a-822c-3bc0df5f985d"
/>
2025-08-11 14:31:15 +00:00
Jessy Yameogo
1590543f67
Make device debuggable if useDwdsWebSocketConnection is true and added simple test case (#171648)
- Make device debuggable if useDwdsWebSocketConnection is true - This
change is needed to support hot reload on web-server devices over
websocket-based DWDS.
- Added simple test case to test hot reload over websocket

related to https://github.com/dart-lang/webdev/issues/2605,
https://github.com/dart-lang/webdev/issues/2645 and
https://github.com/dart-lang/webdev/issues/2646

---------

Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-08-09 03:18:19 +00:00
Matt Boetger
e0660cfb5e
Fix null value reference in flutter logs path (#173437)
The `flutter logs` path for a module does not pass the buildInfo to the
`fromAndroidProject` function. This will cause an exception to be thrown
when `buildInfo!` is invoked. Instead, just allow the buildInfo to be
null and check for the manifest with the code that already exists.

Fixes: #172884

## 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: Reid Baker <reidbaker@google.com>
2025-08-08 19:22:16 +00:00
Reid Baker
fde479c2ee
Remove jetifier usages from framework and engine (#173459)
Justification this is safe: 
useAndroidX which I left in this pr was added in 2018 and is one of 2
flags that control what compile behavior is used as android migrated
from the support library to androidx.
We (flutter android) believe we have migrated all support library usages
to android x.
Android Studio does not automatically insert the Jetifier flag in newly
created projects, suggesting a move towards less reliance on it.

I think even if plugins were using the support libraries this pr would
not break them because the targets being modified are tests in this repo
and the engine build which only uses androidx dependencies.

## 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 `///`).
- [ ] 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-08-08 19:20:23 +00:00
Victoria Ashworth
38217906e9
Use LLDB as the default debugging method for iOS 17+ and Xcode 26+ (#173443)
This PR introduces a new feature flag called `lldb-debugging`, which is
turned on by default. When this feature is turned on, if deploying to a
physical iOS 17+ device with Xcode 26+, it will use a mixture of
`devicectl` and `lldb` to install, launch, and debug the app.

If LLDB fails, it will fallback to use Xcode automation. If LLDB times
out, it will warn the user they may want to disable it. If LLDB is
disabled, it will use Xcode automation.

This PR also adds analytics to track what deployment method is used and
if it's successful.

Part 2 and 3 of https://github.com/flutter/flutter/issues/173416.

Fixes https://github.com/flutter/flutter/issues/144218. Fixes
https://github.com/flutter/flutter/issues/133465.

## 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-08-08 17:13:24 +00:00
Wdestroier
e4c07e8ab2
Support launching a HTTPS URL (#164720)
I setup a reverse proxy, but this piece of code only allows launching
HTTP URLs. I'm submitting a patch to fix the error.

See issue comment
https://github.com/Dart-Code/Dart-Code/issues/5322#issuecomment-2704159264
for context.

## 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].
- [X] 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.

<!-- 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-08-08 14:38:38 +00:00
Salem Iranloye
796c62bd76
Web dev proxy (#172175)
Adding a development Proxy and dedicated Web configuration File

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

Flutter's current web development configuration relies on CLI arguments
and does not have a development proxy. This PR adds a development proxy
to flutter and a designated web_dev_config.yaml where web configuration
settings are loaded from.

Issues:
https://github.com/flutter/flutter/issues/170834

Document:

[HERE](https://docs.google.com/document/d/1Ud9D3F0GxB5Ocoo5NnAy7PH5oo3qxvALxUlAXMCANJ0/edit?usp=sharing)

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

<!-- 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: Sydney Bao <s.bao2115@gmail.com>
Co-authored by: Salem Iranloye <salemiranloye@gmail.com>

---------

Co-authored-by: Kevin Moore <kevmoo@google.com>
Co-authored-by: Sydney Bao <sydneybao@google.com>
2025-08-07 22:42:16 +00:00
Reid Baker
052b903e8e
[Android templates] Remove jetifier usage (#173431)
Fixes #173430

## 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-08-07 21:27:51 +00:00
Victoria Ashworth
b57c9742f3
Prepare for iOS debugging with lldb and devicectl (#173417)
This PR introduces new classes and methods needed to transition to using
`devicectl` (for installing and launching) and `lldb` (for debugging)
for deploying apps to iOS 17+ physical devices.

The new classes/methods are not used yet to reduce risk for
cherry-picking. A follow up PR will adopt them.

Part 1 of https://github.com/flutter/flutter/issues/173416.

## 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-08-07 20:14:31 +00:00
hellohuanlin
c4b0be1a6c
[ios26]Do not report error for Info.plist key not found (#172913)
In xcode_backend's `runSync` function, there's a flag parameter
`allowFail`. The purpose of this flag is that, when enabled, even if
command fails, we should not fail Xcode.

However, the current implementation has a bug, that even when `allowFail
= true`, we still prefix `"error:"` string to `stderr`, which causes
Xcode compilation error.

Before macOS 26, plutil used `stdout` rather than `stderr`, so the bug
was not surfaced. On macOS 26, pltuil uses `stderr` instead (which makes
sense), so the bug is surfaced now.

Note: even if plutil doesn't change behavior on macOS 26, if I randomly
come across this code, I'd still fix the logic error.

*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 https://github.com/flutter/flutter/issues/172627

*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: Jenn Magder <magder@google.com>
2025-08-07 19:17:19 +00:00
Micael Cid
3be04414e9
[web] add --static-assets-url argument to build web (#171638)
Closes https://github.com/flutter/flutter/issues/171637

As mentioned in the issue, I am proposing a new argument to the flutter
build web command: `--static-assets-url`.

This argument would accept a full URL string ending with `/` as its
value. During the build process, the Flutter tool would use this value
to replace a dedicated placeholder within the `web/index.html` file
(inspired by `--base-href` approach).

Example Implementation:

A developer would modify their `web/index.html` to use a new
placeholder, for instance, `$FLUTTER_STATIC_ASSETS_URL`:

```html
...
<body>
  <script>
    {{flutter_js}}
    {{flutter_build_config}}

    _flutter.loader.load({
      config: {
        entryPointBaseUrl: "$FLUTTER_STATIC_ASSETS_URL",
      },
      onEntrypointLoaded: async function (engineInitializer) {
        const appRunner = await engineInitializer.initializeEngine({
          assetBase: "$FLUTTER_STATIC_ASSETS_URL",
        });

        await appRunner.runApp();
      },
    });
  </script>
</body>
...
 ```

The build command would be run with the new flag: `flutter build web --static-assets-url="https://static.company.com/some-webapp/“` - and the resulting `build/web/index.html` would have the placeholder replaced: 

```html
...
<body>
  <script>
    {{flutter_js}}
    {{flutter_build_config}}

    _flutter.loader.load({
      config: {
        entryPointBaseUrl: "https://static.company.com/some-webapp/",
      },
      onEntrypointLoaded: async function (engineInitializer) {
        const appRunner = await engineInitializer.initializeEngine({
          assetBase: "https://static.company.com/some-webapp/",
        });

        await appRunner.runApp();
      },
    });
  </script>
</body>
...
```
2025-08-07 17:05:56 +00:00
Reid Baker
f15262c9f7
[android][tool] Consolidate minimum versions for android projects. (#171965)
I discovered we had a duplicate entry for what the min sdk api level
flutter supports along with duplicate code for telling the user.
This pr keeps the duplicate warnings but removed duplicate definitions. 
Updates the related tests
Updates workflow_test and android_workflow to compare against the
compile sdk version since the validation was ensuring that the lastest
of the installed sdks was at least what was needed for flutter to
compile. This make this pr more than a formatting/refactoring change and
an actual user facing change. Requesting re-review.
## 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-08-07 14:12:43 +00:00
Ben Konyi
024a80bf42
[ Widget Preview ] Cleanup for experimental release (#173289)
Widget previews are being released as an experimental feature in the
next stable release.

This change has some minor last minute changes to prepare for release:
  - Makes `flutter widget-preview` visible
  - Adds documentation links to docs.flutter.dev (not yet staged)
- Fixes minor bug with asset loading due to `AssetManifest.bin.json` not
being accounted for in the asset path mapping logic
2025-08-05 18:10:06 +00:00
Jason Simmons
40fcfc7686
In "flutter create", use the project directory in the suggested "cd" command instead of the main source file path (#173132) 2025-08-04 19:12:12 +00:00
Matthew Kosarek
69264e4a60
Add the 'windowing' feature flag and use to wrap an implementation for regular windows that always throws (#172478)
## What's new?

- Added the `windowing` feature flag to the project
- Created the internal `_window.dart` API with support for regular
windows
- Implemented a `_WindowingOwnerUnsupported` implementation of the
`WindowingOwner` interface
- Marked all points of the public API as `@internal` with a
corresponding warning documentation
- Threw an `UnsupportedError` where it is appropriate to do so

Note that this PR does **NOT** include a real implementation of
`WindowingOwner` (e.g. for win32 or macOS). That work will be opened as
a follow up.

This work is based off of https://github.com/flutter/flutter/pull/168697
and http://github.com/flutter/flutter/pull/168437, as well as this
design document:
https://docs.flutter.dev/go/multi-window-experimental-apis

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

---------

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2025-08-04 17:54:53 +00:00
Reid Baker
561c3d27d3
Improve robustness of comment detection when using flutter analyze --suggestions (#172977)
Fixes #172055

~For some reason a trailing slash at the end of a comment or a line
below the commented out line that otherwise would match would cause the
regex to match that should be ignored.~

~I could not reason about why the trailing slash would cause a match but
the primary change apart from more robust tests is adding `^\s*` which
pins the match on lines that start with some amount of space before
excluding lines that use `//`~

The regex was overbroad at matching and we were getting lucky that the
second "version" was the one being selected a trailing slash broke the
overbroad match and selected the smaller match that was inside the
comment. The new fix was to pin the multi line regex to the start of a
line that way we can still handle newlines in the definition while
ensuring that commented out lines are not included.

The bug was for AGP version in plugins but the fix was applied to all of
the regular expressions in this area of code along with adversarial
units tests to prevent regression.

Note for other contributors https://regex101.com/ was a great resource
for debugging what was happening here.

## 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-08-04 16:49:07 +00:00
Derek Xu
28481edd6b
Add --profile-startup flag to flutter run (#172990)
This PR adds a `--profile-startup` flag to `flutter run` that can be
used to set [the Flutter Engine's `--profile-startup`
switch](https://github.com/flutter/flutter/pull/172879).
2025-08-01 17:29:05 +00:00
Jenn Magder
af294893d9
Move android_obfuscate_test from devicelab into tools integration.shard (#169798)
`android_obfuscate_test` is currently being schedule to run on a limited
devicelab physical phone bot. However, it's only checking if
`--obfuscate` works, not running anything on the device, so can move
into the tools test integration shard.


https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20android_obfuscate_test/7722/overview

The test only takes < 2 minutes, spinning up an entire build for it,
especially on a devicelab bot, is wasteful.

Similar to https://github.com/flutter/flutter/pull/80161

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

<!-- 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-08-01 04:02:40 +00:00
Ben Konyi
da8bd2865b
[ Tool ] Mark IOOverrides subclasses as final (#173078)
IOOverrides will be marked as an abstract base class and will cause
analysis errors when the Dart SDK rolls into Flutter.

Related issue: https://github.com/dart-lang/sdk/issues/56468
2025-07-31 21:19:08 +00:00
Ben Konyi
b1d2636936
[ Widget Preview ] Add --web-server support (#172978)
This allows for the widget preview environment to be launched using the
`web-server` device instead of just opening Chrome.
2025-07-31 00:22:12 +00:00
Ben Konyi
b58151f885
[ Widget Previews ] Add support for MultiPreviews (#172852)
`MultiPreview` is an abstract class that allows for developers to create
custom preview annotations that can be used to easily create multiple
previews from a single annotation.

Fixes https://github.com/flutter/flutter/issues/166447
2025-07-30 20:31:25 +00:00
Ricardo Dalarme
56d5389456
Migrate to null aware elements - Part 5 (#172418)
## Description

Continuing the work from @jamilsaadeh97 to replace verbose null checks
with modern
[null_aware_elements](https://dart.dev/tools/linter-rules/use_null_aware_elements)
syntax.

This PR cleans up the remaining files not covered in the previous parts,
making the code more concise.

## Related PRs

- https://github.com/flutter/flutter/pull/172198
- https://github.com/flutter/flutter/pull/172306
- https://github.com/flutter/flutter/pull/172307
- https://github.com/flutter/flutter/pull/172322

## 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-07-30 18:40:09 +00:00
gaaclarke
ea378cfb6b
Made android_gradle_print_build_variants_test.dart more robust (#172910)
issue: https://github.com/flutter/flutter/issues/172908

It's uncertain if this will fix the issue since we don't know why the
old matcher failed. This may fix it, or it may just give us more
information to debug with.

## 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-07-29 19:33:37 +00:00
Lau Ching Jun
7832d840b6
Revert "Remove 2023 deprecated 'platforms' key from daemon output (#172593)" (#172883)
This reverts commit cfe6f3d95b3fb1ccf2cf944eab0273efc944bcf3.

The change broke the vscode extension. The extension has been updated in
https://github.com/Dart-Code/Dart-Code/pull/5610 but it is worth keeping
this for a little while longer.
2025-07-29 00:47:32 +00:00
auto-submit[bot]
4d060aeb34
Reverts "[flutter_tools] Add --no-codesign support for macOS build (#169034)" (#172878)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169034
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: vashworth
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: failing in post-submit
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8708074284638575793/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: knopp
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {bkonyi, vashworth}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Unlike iOS, the macOS build currently does not support `--no-codesign`
option to skip signing of application bundle. Having this option is
useful for situation where the code-signing step is happens separately
after the bundle is built (i.e. on CI).

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

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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-07-28 20:07:47 +00:00
Matej Knopp
3ac59c9859
[flutter_tools] Add --no-codesign support for macOS build (#169034)
Unlike iOS, the macOS build currently does not support `--no-codesign`
option to skip signing of application bundle. Having this option is
useful for situation where the code-signing step is happens separately
after the bundle is built (i.e. on CI).

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

<!-- 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-07-28 18:13:12 +00:00
stuartmorgan-g
3c9b1280a7
Add --config-only build option for Linux and Windows (#172239)
Adds a `--config-only` option for Linux and Windows, which generates the
native build files (ninja and Visual Studio respectively) without
actually doing the build. This brings them into alignment with Android,
iOS, and macOS, which already have this flag, and will allow some
workflow improvements when running native plugin tests in environments
like the flutter/packages CI.

Fixes https://github.com/flutter/flutter/issues/93407
Fixes https://github.com/flutter/flutter/issues/172029

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

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-07-28 18:05:24 +00:00
René Kilczan
cfbaa18bde
Remove shortner (#172844)
Replacing shortner urls with the long versions. Fixes #172843

## 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 `///`).
- [ ] 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].

<!-- 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-07-28 15:07:11 +00:00
Matan Lurey
0125d95f7e
Update flutter pub get to use flutter.version.json (instead of version) (#172798)
Towards https://github.com/flutter/flutter/issues/171900.

Discovered during https://github.com/flutter/flutter/pull/172793.

It's unfortunate that `DefaultPub` (and tests) need some massaging to
work, but the fact the tool is so inconsistent about global versus local
state is not a new thing, so I didn't worry about it in the context of
this PR.
2025-07-28 14:17:38 +00:00
Matan Lurey
e5b78fe6e5
Remove deprecated --[no-]-disable-dds (#172791)
Closes https://github.com/flutter/flutter/issues/150279.

Made a warning in https://github.com/flutter/flutter/pull/172595 and
cherry-picked into the next beta (will be stable) as
https://github.com/flutter/flutter/pull/172790.
2025-07-25 22:10:55 +00:00
Matan Lurey
ca7c95ceec
Check file contents, remove tests that are now invalid (: 'none') (#172788)
Closes https://github.com/flutter/flutter/issues/171919.

The tests removed are covering cases no longer supported, but we never
caught them.
2025-07-25 21:39:58 +00:00
Matan Lurey
0e7da1d019
Remove deprecated AssetManifest.json file (#172594)
Closes https://github.com/flutter/flutter/issues/143577.
2025-07-25 20:20:34 +00:00
Matan Lurey
3e86cb8773
Rename AppRunLogger, stop writing status messages that break JSON (#172591)
Closes https://github.com/flutter/flutter/issues/118907.

It looks like some of the work around splitting had already happened
(`DaemonLogger`), so this ... seems right?
2025-07-25 19:14:01 +00:00
Matan Lurey
465b21cee1
Add --dart-define, -D to assemble, deprecate --define, -d. (#172510)
Closes https://github.com/flutter/flutter/issues/98593.
Towards https://github.com/flutter/flutter/issues/97505.
2025-07-25 18:55:01 +00:00
Matan Lurey
7d13988cee
Fix an omit-type lint that is breaking the tree (#172776)
https://github.com/flutter/flutter/pull/169445 was stale (not re-based),
causing a tree failure.

Let's just land this versus reverting.
2025-07-25 17:39:31 +00:00
Reynaldo
aea660d5cd
feat(tool): Respect user-data-dir flag from web-browser-flag (#169445)
### Respect user-data-dir flag from web-browser-flag

Currently, it's already possible to pass `web-browser-flag` when
launching Chrome, but the `user-data-dir` flag doesn't work as expected,
and there are some reasons for that.

In the implementation made in [PR
#104935](https://github.com/flutter/flutter/pull/104935), the
`web-browser-flag` is appended at the end of the Chrome launch
arguments.

For most scenarios, this works fine, as demonstrated in the Chrome unit
test below:

https://source.chromium.org/chromium/chromium/src/+/main:base/command_line_unittest.cc

```
TEST(CommandLineTest, MultipleSameSwitch) {
  const CommandLine::CharType* argv[] = {
      FILE_PATH_LITERAL("program"),
      FILE_PATH_LITERAL("--foo=one"),  // --foo first time
      FILE_PATH_LITERAL("-baz"),
      FILE_PATH_LITERAL("--foo=two")   // --foo second time
  };
  CommandLine cl(std::size(argv), argv);

  EXPECT_TRUE(cl.HasSwitch("foo"));
  EXPECT_TRUE(cl.HasSwitch("baz"));

  EXPECT_EQ("two", cl.GetSwitchValueASCII("foo"));
}
```
In this scenario, the parser will consider the last occurrence of a
flag.

However, this behavior does not apply to certain flags, because Chrome
processes some of them based on the first occurrence, not the last. This
is the case for `--user-data-dir`, which is parsed very early during
Chrome startup.

The proposed code checks whether `--user-data-dir` was provided via
`web-browser-flag`, and if so, it uses that value instead of the default
`%temp%\flutter_tools_chrome_device.xpto` temporary directory.

This also resolve this comment:
https://github.com/flutter/flutter/pull/104935#issuecomment-1694486157

Example: `launch.json`
```
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "flutter",
      "request": "launch",
      "type": "dart"
    },
    {
      "name": "flutter (profile mode)",
      "request": "launch",
      "type": "dart",
      "flutterMode": "profile"
    },
    {
      "name": "flutter (release mode)",
      "request": "launch",
      "type": "dart",
      "flutterMode": "release"
    },
    {
      "name": "Flutter for web (hot reloadable)",
      "type": "dart",
      "request": "launch",
      "program": "lib/main.dart",
      "args": [
        "-d",
        "chrome",
        "--web-port=5000",
        "--web-experimental-hot-reload",
        "--web-browser-flag=--user-data-dir=D:\\_Desenv\\flutter_tests\\chrome_profile"
      ]
    }
  ]
}
```

`chrome://version`

| Before | After  |
|--------|--------|
|
![before](https://github.com/user-attachments/assets/b3f33419-fbf1-446e-a471-745df2e8c4f6)
|
![after](https://github.com/user-attachments/assets/ea74a203-c269-4ce1-8a9b-f97e9a4cdc78)
|

Folder
| Before | After  |
|--------|--------|
|
![before_files](https://github.com/user-attachments/assets/8522e60b-d0eb-4b66-a4b6-c2d6ed34c15b)
|
![after_files](https://github.com/user-attachments/assets/ff94b498-b319-474c-89e5-c55f6e1c4383)
|

## 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-07-25 15:43:06 +00:00
Jamil Saadeh
6937b0c35a
Migrate to null aware elements - Part 3 (#172307)
<!--
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
-->

Replace null checks with null aware elements - part 3

Part of #172188

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

<!-- 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-07-25 14:20:55 +00:00
Matan Lurey
cfe6f3d95b
Remove 2023 deprecated 'platforms' key from daemon output (#172593)
Closes https://github.com/flutter/flutter/issues/140473.
2025-07-25 00:24:42 +00:00
Matan Lurey
28f63a398d
Remove support for pluginClass: none (on master; > 3.35.0) (#172579)
Closes https://github.com/flutter/flutter/issues/57497.

Warning was added to `3.35.0`-branch here:
https://github.com/flutter/flutter/pull/172315

... so this will only apply on `master`, and then the stable/beta
releases _after_ `3.35.0` ships to stable (quite some time).
2025-07-24 20:45:51 +00:00
flutter-pub-roller-bot
11e75ea82d
Roll pub packages (#172677)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-07-24 00:54:12 +00:00
Gray Mackall
df99f53bc0
[android] Fix broken --android-skip-build-dependency-validation flag (#172581)
The way I was parsing the boolean previously was just not working. This
works.

Also restores a set of tests that was deleted in
https://github.com/flutter/flutter/pull/171776 that I don't think should
have been (missed this in review), and adds a test case for the fix.

Added as bringup because the name is changed, but I ran the tests
locally and they pass.

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

<!-- 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: Gray Mackall <mackall@google.com>
2025-07-23 23:57:50 +00:00
Elijah Okoroh
fdc1b5cd29
Adapt xcresult parser for Xcode 16 changes (#172596)
This PR updates the iOS build process to support breaking changes in
Xcode 16's xcresulttool. The xcresulttool get command, which Flutter
uses to parse native build issues, is deprecated and replaced by the new
xcresulttool get build-results command. This new command also introduces
a completely new, flatter JSON output format.

To address this while maintaining backwards compatibility, this change
introduces a two-part solution:
- The XCResultGenerator now detects the Xcode version and conditionally
calls the appropriate command (get build-results for Xcode 16+ and get
for older versions).
- The XCResult parser has been refactored to be "bilingual," meaning it
can intelligently detect the JSON structure and parse both the old
(nested) and new (flat) formats correctly.
- This ensures that native iOS build errors and warnings continue to be
correctly parsed and displayed to the user on all supported Xcode
versions.

Fixes #151502 

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

<!-- 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-07-23 23:14:52 +00:00