9974 Commits

Author SHA1 Message Date
Matan Lurey
6d62770d08
Omit instruction to cd . after flutter create (#172513)
Closes https://github.com/flutter/flutter/issues/100588.
2025-07-22 22:45:14 +00:00
jesswrd
e12d263d3d
Update warnGradleVersion to 8.7.0 (#172576)
When using a lower Gradle version, a warning to update to at least 8.7.2
is shown, but 8.7.2 is not a valid version. Changed warnGradleVersion
from 8.7.2 to 8.7.0.

## 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
2025-07-22 21:20:08 +00:00
Matan Lurey
3038239932
Use a fake representation of cache/artifacts/gradle_wrapper (#172503)
... so that it doesn't require downloading cache artifacts to run
`general.shard/project_test.dart`.

Closes https://github.com/flutter/flutter/issues/83275.
2025-07-22 21:13:03 +00:00
Michael Goderbauer
6b7d92852c
Bump meta to 0.17.0 (#172541)
Unclear why the bot didn't bump this.
2025-07-22 17:51:20 +00:00
John "codefu" McDole
ff983d3598
feat: start using the content aware hash for downloading artifacts (#172552)
reland of https://github.com/flutter/flutter/pull/171927
towards https://github.com/flutter/flutter/issues/171790

Use the content aware hash when downloading engine artifacts. These are
currently produced when changes to DEPs, engine/, or the release file
are changed in a not-seen-before way.

We can eventually remove engine.version being tracked in release
branches as an optimization.

FLUTTER_PREBUILT_ENGINE_VERSION will stay for overriding the
engine.version for testing. Though Cocoon does not need to actually set
it for framework only PRs anymore.

fxies post submit tests for content_hash download:
SHARD=framework_tests SUBSHARD=misc dart --enable-asserts
dev/bots/test.dart
SHARD=tool_host_cross_arch_tests dart --enable-asserts
dev/bots/test.dart

```
  ╔═╡ERROR https://github.com/flutter/flutter/pull/1╞════════════════════════════════════════════════════════════════════
  ║ Expected "Flutter Engine Version: 45b085ab2118f30441ae6e2daab4b8eb3e4a063c", but found "Flutter Engine Version: 407c051ec9".
  ╚═══════════════════════════════════════════════════════════════════════════════
```

```
  Expected: contains '45b085ab2118f30441ae6e2daab4b8eb3e4a063c'
     Which: does not contain '45b085ab2118f30441ae6e2daab4b8eb3e4a063c'
```
2025-07-22 17:35:26 +00:00
Matan Lurey
d16e5b9971
Hide flutter assemble unless --verbose (#172508)
Towards https://github.com/flutter/flutter/issues/97505.
2025-07-22 05:34:22 +00:00
Matan Lurey
359b29382a
Omit w (widget tree), t (render tree) from flutter run --profile h (#172506)
Closes https://github.com/flutter/flutter/issues/91690.
2025-07-22 00:41:09 +00:00
Matan Lurey
ffd1baa342
Refactor checks for --machine (#172504)
Was already fixed in https://github.com/flutter/flutter/pull/150138, so
removes duplicate flag.

Already tested by existing test suite.
2025-07-22 00:41:08 +00:00
auto-submit[bot]
c5465e9eb7
Reverts "feat: start using the content aware hash for downloading artifacts (#171927)" (#172505)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#171927
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke the tree, due to naughty tests but too
intensive to fix forward.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jtmcdole
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
towards #171790 

Use the content aware hash when downloading engine artifacts. These are
currently produced when changes to DEPs, engine/, or the release file
are changed in a not-seen-before way.

We can eventually remove `engine.version` being tracked in release
branches as an optimization.

`FLUTTER_PREBUILT_ENGINE_VERSION` will stay for overriding the
engine.version for testing. Though Cocoon does not need to actually set
it for framework only PRs anymore.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-07-21 23:09:47 +00:00
Matan Lurey
852760424a
Wrap ShutdownHook calls to avoid crashing the tool (#171917)
Closes https://github.com/flutter/flutter/issues/57351.
2025-07-21 18:41:08 +00:00
Srujan Gaddam
932cb033e6
Use baseUri always when doing a hot reload or hot restart (#172271)
We already use the baseUri when computing hot reload sources metadata as
it can never be null. The member is changed to be non-nullable to
reflect that.

To be consistent, we also use the baseUri (full url) for a hot restart
when running with the DDC library bundle format.

Related PR: https://github.com/dart-lang/webdev/pull/2650

## 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-07-21 17:40:57 +00:00
John "codefu" McDole
40992ec4f8
feat: start using the content aware hash for downloading artifacts (#171927)
towards #171790 

Use the content aware hash when downloading engine artifacts. These are
currently produced when changes to DEPs, engine/, or the release file
are changed in a not-seen-before way.

We can eventually remove `engine.version` being tracked in release
branches as an optimization.

`FLUTTER_PREBUILT_ENGINE_VERSION` will stay for overriding the
engine.version for testing. Though Cocoon does not need to actually set
it for framework only PRs anymore.
2025-07-21 17:41:44 +00:00
Matan Lurey
80f4a0f251
Add support for /? to alias to --help (#172328)
Closes https://github.com/flutter/flutter/issues/70616.
2025-07-21 17:20:08 +00:00
Jason Simmons
99b69feaca
Upgrade flutter_lints in project template pubspec.yaml files (#172400)
The version of flutter_lints used by newly created projects should match
the version used by flutter_tools. This ensures that "pub get --offline"
will work on a project that was generated by "flutter create".

Also restore the Mac tool_tests_commands that were temporarily disabled
in https://github.com/flutter/flutter/pull/172388

Fixes https://github.com/flutter/flutter/issues/172375
2025-07-21 17:11:59 +00:00
Matan Lurey
8667c183af
Adds (defaults to ___) when using flutter config --help (#172329)
Closes https://github.com/flutter/flutter/issues/81665.
2025-07-21 17:09:17 +00:00
Matan Lurey
5ed913b2db
Add a warning on usage of dartPluginClass: 'none'. (#172315)
Towards https://github.com/flutter/flutter/issues/57497.

Supersedes https://github.com/flutter/flutter/pull/171922 based on
@stuartmorgan-g's advice for a warning release.

I'll CP this into `3.35` (beta) so that we can clean it up on `master`
anytime.
2025-07-21 17:08:51 +00:00
Matan Lurey
599ed5252e
Skip [tool] crash reporting on --local-engine (#172326)
Closes https://github.com/flutter/flutter/issues/70238.
2025-07-21 17:08:51 +00:00
Matan Lurey
1c1f234b87
Remove IDE validation from flutter doctor (#171924)
Closes https://github.com/flutter/flutter/issues/61246.

I open to doing this behind a flag, but given we decided already 5 years
ago to do this, I'm leaning limiting this to an announcement
(`flutter-announce@`) and just landing this cleanup.

Open to suggestions.
2025-07-21 17:08:50 +00:00
flutter-pub-roller-bot
e2a46f0e30
Roll pub packages (#172332)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-07-18 00:32:29 +00:00
Matan Lurey
032b0f00b5
Refactor and forbid base/exit.dart outside of lib/runner.dart (#171923)
Closes https://github.com/flutter/flutter/issues/59338.
2025-07-17 23:16:25 +00:00
flutter-pub-roller-bot
151eeb0e38
Roll pub packages (#172193)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-07-16 01:05:07 +00:00
Mikhail Novoseltsev
adca65f43f
[Android] remove obsolete gradle api in FGP (#172085)
fixes #170791 

This PR replaces the deprecated (and removed in 9.0) Gradle fileMode API
in favor of filePermissions.
This change finally unlocks builds with gradle 9 (confirmed in smoke
tests, 9.0.0-rc.2 is the latest prerelease version to the date).

**Testing strategy**

There's an attempt to add a Kotlin unit test that confirms that
`filePermissions` were called during plugin application. I failed to
find a more precise way to check if the new code works as intended (such
as testing that permissions were really changed or something like that),
but on the other hand, it should not be required since it will transform
the test in a way that it will start to test Gradle APIs and their
behavior, and I believe it's a bit out of scope: Gradle APIs are tested
in Gradle tests :)

Anyway, this new test is a bit cumbersome because it's required to mock
all the behaviours related to variants configuration and capturing calls
– If it is not desired im not hesitant to remove it.

<!--
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.
- [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-15 21:11:53 +00:00
Ben Konyi
ec9e07d9b9
[ Tool ] Fix flutter upgrade stating that an upgrade is available on main when up to date (#172141)
The `frameworkVersion` string written to the version files wasn't
actually parsable by `GitTagVersion` as it didn't match the format
output by `git`.

This change updates the `frameworkVersion` format to use a `-` instead
of a `.` before the commit count and adds support to the version parsing
regex to handle both `.` and `-` separators before the commit count.

Fixes https://github.com/flutter/flutter/issues/172091
2025-07-15 01:00:38 +00:00
Loïc Sharma
6474b04e6d
Reland "Add feature flags to the framework" (#171545)
This relands https://github.com/flutter/flutter/pull/168437. The google3
fixes were landed in: https://github.com/flutter/flutter/pull/171547,
https://critique.corp.google.com/cl/781275353,
https://github.com/flutter/flutter/pull/171933.

This PR is split into two commits:

1. d6253794e8982348c5c21cb63e8f6bf785664be6, code from
https://github.com/flutter/flutter/pull/168437 without any changes
2. f35d29e4af630d2d4fdb0cda8686b6ff9f77227a, updates the PR to omit
obvious types.

Original PR description:

## Motivation

We'd like to let users opt-in to experimental features so that they can
give early feedback while we iterate on the feature. For example:

Example feature flags:

1. Android sensitive content:
https://github.com/flutter/flutter/pull/158473. When enabled, Flutter
will tell Android when the view contains sensitive content like a
password.
3. Desktop multi-window. When enabled, Flutter will use child windows to
allow things like a context menu to "escape" outside of the current
window.

### Use case

Users will be able to turn on features by:

* **Option 1**: Run `flutter config --enable-my-feature`. This enables
the feature for all projects on the machine
* **Option 2**: Add `enable-my-feature: true` in their `pubspec.yaml`,
under the `flutter` section. This would enable the for a single project
on the machine.

Turning on a feature affects _both_ development-time (`flutter run`) and
deployment-time (`flutter build x`). For example, I can `flutter build
windows` to create an `.exe` with multi-window features enabled.

## How this works

This adds a new
[`runtimeId`](https://github.com/flutter/flutter/pull/168437/files#diff-0ded384225f19a4c34d43c7c11f7cb084ff3db947cfa82d8d52fc94c112bb2a7R243-R247)
property to the tool's `Feature` class. If a feature is on and has a
`runtimeId`, its `runtimeId` will be [stamped into the Dart application
as a Dart
define](https://github.com/flutter/flutter/pull/168437/files#diff-bd662448bdc2e6f50e47cd3b20b22b41a828561bce65cb4d54ea4f5011cc604eR293-R327).
The framework uses this Dart define to [determine which features are
enabled](https://github.com/flutter/flutter/pull/168437/files#diff-c8dbd5cd3103bc5be53c4ac5be8bdb9bf73e10cd5d8e4ac34e737fd1f8602d45).

### Multi-window example

https://github.com/flutter/flutter/pull/168697 shows how this new
feature flag system can be used to add a multi-window feature flag:

1. It adds a new [multi-window
feature](https://github.com/flutter/flutter/pull/168697/files#diff-0ded384225f19a4c34d43c7c11f7cb084ff3db947cfa82d8d52fc94c112bb2a7R189-R198)
to the Flutter tool. This can be turned on using `flutter config
--enable-multi-window` or by putting `enable-multi-window: true` in an
app's .pubspec, under the `flutter` section.
2. It adds a new
[`isMultiWindowEnabled`](https://github.com/flutter/flutter/pull/168697/files#diff-c8dbd5cd3103bc5be53c4ac5be8bdb9bf73e10cd5d8e4ac34e737fd1f8602d45R7-R11)
property to the framework.
4. The Material library can use this new property to determine whether
it should create a new window.
[Example](https://github.com/flutter/flutter/pull/168697/files#diff-2cbc1634ed6b61d61dfa090e7bfbbb7c60b74c8abc3a28df6f79eee691fd1b73).

## Limitations

### Tool and framework only

For now, these feature flags are available only to the Flutter tool and
Flutter framework. The flags are not automatically available to the
embedder or the engine.

For example, embedders need to configure their surfaces differently if
Impeller is enabled. This configuration must happen before the Dart
isolate is launched. As a result, the framework's feature flags is not a
viable solution for this scenario for now. For these kinds of scenarios,
we should continue to use platform-specific configuration like the
`AndroidManifest.xml` or `Info.plist` files.

This is a fixable limitation, we just need to invest in this plumbing :)

### Tree shaking

Feature flags are not designed to help tree shaking. For example, you
cannot conditionally import Dart code depending on the enabled feature
flags. Code that is feature flagged off will still be imported into
user's apps.
2025-07-15 00:02:16 +00:00
Ben Konyi
b40f19b7ed
[ Widget Preview ] Initial work to support reacting to IDE events (#172040)
Adds support for a subset of the DTD `Editor` service registered by IDEs
for use by the widget preview scaffold. Currently, this feature subset
includes support for listening for:

 - Source file selection events
 - Editor theme change events

This change does not introduce any new functionality that makes use of
these new DTD `Editor` events.
2025-07-14 19:35:59 +00:00
Ben Konyi
b95fd07576
[ Tool ] Downgrade and pin DDS to 5.0.3 (#172120)
The sole change in 5.0.4 can cause memory leaks in the VM. Pinning to
5.0.3 for the release cut.

See https://github.com/Dart-Code/Dart-Code/issues/4678 for details.
2025-07-14 18:10:07 +00:00
Mohellebi abdessalem
977901f19a
fix android studio lint about lambda function (#172063)
android studio is prompting :
<img width="618" height="219" alt="AS_01"
src="https://github.com/user-attachments/assets/d4c4c84d-f7d4-4a07-96a0-00d992c0d6d8"
/>

## 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] All existing and new tests are passing.
- [ ] 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.

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-14 17:43:56 +00:00
Mouad Debbar
a930ec1a6c
Run hot_restart_web_ddc_library_bundle_test.dart on Mac/Windows (#171282)
Part of https://github.com/flutter/flutter/issues/171276
2025-07-14 14:30:24 +00:00
Loïc Sharma
5154d16d1f
[tool] Make google3 have to override feature flags (#171933)
_⚠️ Landing this is blocked until: 1)
https://critique.corp.google.com/cl/781275353 lands and 2) google3 is
updated to add the new feature flag introduced in
https://github.com/flutter/flutter/pull/171903._

Currently, google3's `Google3Features` extends `FeatureFlags`. As a
result, google3 automatically gets the same feature flag values as in
Flutter.

This makes Flutter's feature flag values abstract, thereby requiring
that google3's `Google3Features` must explicitly set each feature flag's
value.

Discussion that motivated this change:
https://github.com/flutter/flutter/pull/171797
Internal CL: https://critique.corp.google.com/cl/781275353
Part of: https://github.com/flutter/flutter/issues/167668

## 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-11 20:42:08 +00:00
Ben Konyi
1709c884aa
[ Tool ] Enable omit_obvious_*_types and specify_nonobvious_*_types lints (#172018)
Sources under `packages/flutter_tools/` aren't accessible to the average
Flutter user by navigating through sources from their projects, so it
doesn't need to be as explicitly verbose with types for readability
purposes. The `always_specify_types` lint results in extremely verbose
code within the tool which adds little value.

This change disables `always_specify_types` in favor of a new set of
lints that aim to reduce verbosity by removing obvious types while also
maintaining readability in cases where variable types otherwise wouldn't
be obvious:

  - `omit_obvious_local_variable_types`
  - `omit_obvious_property_types`
  - `specify_nonobvious_local_variable_types`
  - `specify_nonobvious_property_types`
2025-07-11 19:32:57 +00:00
Mouad Debbar
255e8c20a0
Run hot_reload_with_asset_web_test.dart on Mac/Windows (#171280)
Part of https://github.com/flutter/flutter/issues/171276
2025-07-11 15:09:07 +00:00
Mouad Debbar
cbe78368ee
Run stateless_stateful_hot_reload_web_test.dart on Mac/Windows (#171283)
Part of https://github.com/flutter/flutter/issues/171276
2025-07-10 15:38:33 +00:00
Matan Lurey
89ed67d7b0
Add flutter config --enable-omit-legacy-version-file (#171903)
Towards https://github.com/flutter/flutter/issues/171900.

We can decide how quickly to move here, but a feature flag will make it
easier to try out/rollback.
2025-07-09 21:30:01 +00:00
Danny Valente
953b6e4a28
Allow flutter attach to discover flutter engine running on Custom Device (#170635)
## Summary

A Custom Device's log reader doesn't do anything, and thus `flutter
attach` will fail to ever find the flutter engine's VM service.

This change adds a new `readLogs` command to the CustomDeviceConfig, and
which allows a custom device to read the logs from the running flutter
app on the actual custom device, and then allow flutter attach to work.

Fixes #170634

## Testing

Created a custom device, and added the following readLogs command in the
`custom_devices.json` file:
```
"readLogs": [
        "sshpass",
        "-f",
        "/home/dvalente/player.txt",
        "ssh",
        "root@10.0.0.20",
        "tail -Fn +1 /opt/log/flutter.log"
      ]
```

Then, running `flutter attach` works every time.

**Tested the following scenarios:**
* Launched `flutter attach` before app is running on device, and once
app runs, flutter attach succeeds
* Launched `flutter attach` after app is already running on device, and
flutter attach succeeds.
* Used `flutter attach` in Android Studio, and hot reload works just
like any Android device.
2025-07-09 21:28:49 +00:00
Matan Lurey
4abe4d35f5
Hide the rarely direct used --sample argument by default (#171898)
Closes https://github.com/flutter/flutter/issues/51859.
2025-07-09 21:28:49 +00:00
Matan Lurey
f13c1d0dad
Support NO_COLOR to opt-out of flutter tool ANSI colors (#171892)
Closes https://github.com/flutter/flutter/issues/49444.
2025-07-09 21:28:49 +00:00
Nate Biggs
06ce4bb187
Add analytics events for wasm dry runs on web builds (#171818)
Follow up to https://github.com/flutter/flutter/pull/171682
Depends on https://github.com/dart-lang/tools/pull/2125

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-07-09 21:25:52 +00:00
Matan Lurey
e212d3dcd8
Add total execution time to the flutter upgrade command (#171475)
Closes https://github.com/flutter/flutter/issues/47090.
2025-07-09 21:23:49 +00:00
Reid Baker
0843e6f693
[Documentation] When updating kgp minimum document additional changes that are required (#171819)
## 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-08 22:08:05 +00:00
Nate Biggs
b5b3636106
Add support for running dart2wasm in dry run mode on js compilations (#171682)
Example message with findings:

```

Wasm dry run findings:
Found incompatibilities with WebAssembly.

package:counter1/main.dart 3:1 - dart:html unsupported (0)


Consider addressing these issues to enable wasm builds. See docs for more info: https://docs.flutter.dev/platform-integration/web/wasm


Compiling lib/main.dart for the Web...                             10.9s
✓ Built build/web
```

Example message without findings:

```

Wasm dry run succeeded. Consider building and testing your application with the `--wasm` flag. See docs for more info: https://docs.flutter.dev/platform-integration/web/wasm

Compiling lib/main.dart for the Web...                             10.8s
✓ Built build/web
```

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-07-08 21:39:50 +00:00
Matan Lurey
968b657788
Remove now duplicate un-forward ports for Android (#171473)
Closes https://github.com/flutter/flutter/issues/46114.

Cleans up the `attach_test` suite a bit to be more reflective of the
real code.
2025-07-08 21:00:01 +00:00
Reid Baker
7762b4cf32
Bump warn and error versions of agp, kotlin and gradle versions in preparation for gradle 9 (#171776)
- **Relands "Bump warn and error versions of agp, kotlin and gradle
versions in preparation for gradle 9 (#171399)"**
- **bump lockfile generator to use kotlin 2.1.0**
- **Update formatting of lockfile to pass ktlint** 

Updated lockfiles with
`JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/
dart dev/tools/bin/generate_gradle_lockfiles.dart` after
dev/tools/bin/generate_gradle_lockfiles.dart to bump the versions of
kotlin.

Failing tests from first attempt
https://flutter-dashboard.appspot.com/#/build?hashFilter=84a5ce765d193a9c79ab4297f367d5ad7efc5dac&showMac=false&showWindows=false&showiOS=false&showLinux=false&showBringup=true&repo=flutter&branch=master

Verified example test that cause revert was passing by running the
following

- `../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
run_debug_test_android.dart` from `dev/devicelab`
- `../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
run_release_test` from `dev/devicelab`
- `SHARD=android_engine_vulkan_tests bin/cache/dart-sdk/bin/dart
dev/bots/test.dart` from root with an android emulator. Hard to actually
verify because the emulator is closed as part of the tests but no
failures were from failures to compile.
- `flutter test
test/general.shard/android/android_project_migration_test.dart` from
`packages/flutter_tools/`

## 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-08 18:40:35 +00:00
Matan Lurey
8449573549
Add/use addMachineOutputFlag/outputsMachineFormat instead of strings (#171459)
Prepares to make changes such as
https://github.com/flutter/flutter/issues/10621 easier.
2025-07-08 18:25:22 +00:00
Ben Konyi
922e00ac3d
[ Tool ] Support upgrading to a new Flutter version pointing to the same revision as a previous version (#171783)
In the case of a bad release, we should be able to release a new version
of Flutter that points to the revision of the last good release.

This change updates the tool to not only compare framework revisions
when determining if the current installation is up to date, and also
updates the tag selection logic to pick the most recent version tag
first.

Fixes https://github.com/flutter/flutter/issues/170679
2025-07-08 17:32:15 +00:00
Mouad Debbar
17e63958f2
Run hot_restart_web_amd_test.dart on Mac/Windows (#171281)
Part of https://github.com/flutter/flutter/issues/171276
2025-07-08 16:09:18 +00:00
John "codefu" McDole
13d2219efd
feat: Use engine_stamp.json in flutter tool (#171454)
The flutter tool will now download and use an `engine_stamp.json` file
to determine the engine version, content hash, build date, and commit
date.

The file is treated as a new `DevelopmentArtifact.informative` and is
fetched before flutterVersion is used. This ensures we have build
information for a clean checkout with no bin/cache folder. Users that
download from flutter.dev will have engine_stamp.json, so its a no-op.

This change provides support for content hashed engine artifacts, who's
revision (the hash) is not a git commit sha. A side benefit is "git" is
only used at build time to extract this information.

> [!NOTE]
> Content hashed artifacts are not enabled yet for downloads;
bin/internal/engine.version (releases) and the shell updaters still look
for the git commit sha. One can test this out by setting
`FLUTTER_PREBUILD_ENGINE_VERSION` to the content hash.
2025-07-08 00:16:42 +00:00
Ben Konyi
a5541161e8
[ Tool ] Remove long-deprecated make-host-app-editable (#171715)
Fixes https://github.com/flutter/flutter/issues/59220
2025-07-08 00:09:26 +00:00
auto-submit[bot]
9b0f94aef6
Reverts "Bump warn and error versions of agp, kotlin and gradle versions in preparation for gradle 9 (#171399)" (#171736)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#171399
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Many Gradle/Android related tasks are failing
([one
example](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_mokey%20run_release_test/1347/overview))
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: reidbaker
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {gmackall}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
https://gradle.org/whats-new/gradle-9/ is coming and with it includes
some deprecated methods. Some like
https://github.com/flutter/flutter/pull/171397 can be fixed by
annotations and calling new methods. Some like the deprecation of
minsdkversion on Variant require bumping the minimum versions to be able
to compile code that will work.

b/368604254

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


<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-07-07 23:22:47 +00:00
Reid Baker
84a5ce765d
Bump warn and error versions of agp, kotlin and gradle versions in preparation for gradle 9 (#171399)
https://gradle.org/whats-new/gradle-9/ is coming and with it includes
some deprecated methods. Some like
https://github.com/flutter/flutter/pull/171397 can be fixed by
annotations and calling new methods. Some like the deprecation of
minsdkversion on Variant require bumping the minimum versions to be able
to compile code that will work.

b/368604254

## 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-07 22:11:15 +00:00
Ben Konyi
9de6f68267
[ Tool ] Fix crash when SIGQUIT is sent to enable the VM service for flutter analyze --watch (#171713)
The command was parsing stdout assuming all contents were JSON.

Fixes https://github.com/flutter/flutter/issues/58391
2025-07-07 20:41:26 +00:00