Commit Graph

5735 Commits

Author SHA1 Message Date
Polina Cherkasova
eea3fdf2a8
Increase pinned version of leak tracker to enable access to experimental tracking on web. (#167502) 2025-04-21 23:48:15 +00:00
gaaclarke
66c8316f97
Android doctor: more robust canrun (#167489)
Fixes error found in rolling to google.

```
[☠] Android toolchain - develop for Android devices (the doctor check crashed)
    ✗ Due to an error, the doctor check did not complete. If the error message
      below is not helpful, please let us know about this issue at
      https://github.com/flutter/flutter/issues.
    ✗ type 'Null' is not a subtype of type 'String' of 'executable'
    • #0      LocalProcessManager.canRun
      (package:process/src/interface/local_process_manager.dart:124)
      #1      getEmulatorVersion
      (package:flutter_tools/src/android/android_workflow.dart:64)
      #2      AndroidValidator.validateImpl
      (package:flutter_tools/src/android/android_workflow.dart:200)
      #3      DoctorValidator.validate
      (package:flutter_tools/src/doctor_validator.dart:58)
      #4      Doctor.startValidatorTasks.<anonymous closure>
      (package:flutter_tools/src/doctor.dart:244)
      #5      asyncGuard.<anonymous closure>
      (package:flutter_tools/src/base/async_guard.dart:109)
      #6      _rootRun (dart:async/zone.dart:1525)
      #7      _CustomZone.run (dart:async/zone.dart:1422)
      #8      _runZoned (dart:async/zone.dart:2033)
      #9      runZonedGuarded (dart:async/zone.dart:2019)
      #10     runZoned (dart:async/zone.dart:1952)
      #11     asyncGuard (package:flutter_tools/src/base/async_guard.dart:106)
      #12     Doctor.startValidatorTasks
      (package:flutter_tools/src/doctor.dart:234)
      #13     Doctor.diagnose (package:flutter_tools/src/doctor.dart:372)
      #14     DoctorCommand.runCommand
      (package:flutter_tools/src/commands/doctor.dart:59)
      #15     FlutterCommand.verifyThenRunCommand
      (package:flutter_tools/src/runner/flutter_command.dart:1897)
      <asynchronous suspension>
      #16     FlutterCommand.run.<anonymous closure>
      (package:flutter_tools/src/runner/flutter_command.dart:1551)
      <asynchronous suspension>
      #17     AppContext.run.<anonymous closure>
      (package:flutter_tools/src/base/context.dart:154)
      <asynchronous suspension>
      #18     CommandRunner.runCommand (package:args/command_runner.dart:212)
      <asynchronous suspension>
      #19     FlutterCommandRunner.runCommand.<anonymous closure>
      (package:flutter_tools/src/runner/flutter_command_runner.dart:501)
      <asynchronous suspension>
      #20     AppContext.run.<anonymous closure>
      (package:flutter_tools/src/base/context.dart:154)
      <asynchronous suspension>
      #21     FlutterCommandRunner.runCommand
      (package:flutter_tools/src/runner/flutter_command_runner.dart:438)
      <asynchronous suspension>
      #22     run.<anonymous closure>.<anonymous closure>
      (package:flutter_tools/runner.dart:98)
      <asynchronous suspension>
      #23     AppContext.run.<anonymous closure>
      (package:flutter_tools/src/base/context.dart:154)
      <asynchronous suspension>
      #24     AppContext.run.<anonymous closure>
      (package:flutter_tools/src/base/context.dart:154)
      <asynchronous suspension>
      #25     run (package:mobile.flutter.cli/flutter_tools.dart:106)
      <asynchronous suspension>
      #26     main (google3:///mobile/flutter/cli/bin/cli_usage_aot.dart:4)
```

## 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-04-21 18:10:20 +00:00
Jason Simmons
ab7a990dc8
Throw an error if --local-engine-host is used without --local-engine (#166948)
The artifact selector will only use artifacts from the local engine if
both of these flags are provided.
2025-04-18 17:00:57 +00:00
Reid Baker
f20bc39cc0
Add kotlin compatability to build file validation (#167143)
Fixes https://github.com/flutter/flutter/issues/161443 

* adds a new gradle task like `javaVersion` named `kgpVersion` that
prints the version of kgp.
* adds gradle_utils.dart method for getting kgp version
* * kgp method is moved to utilities and we attempt to use a plugin
method before reflection.
* adds methods or  evaluating KGP + gradle and KGP + AGP compatibility. 
* * It turns out that we have been using incompatible versions that
happen to work with the subset of kotlin we are using.
* Uses new kgp methods in flutter analyze --suggestions as part of the
existing agp/java/gradle compatibility matrix.
* adds new tests for all new functionality
* Adds comments to sections of the code I found could use them. 
* Modifies flutter gallery to use a compatible version of kotlin and
update its lockfiles.


## 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-04-18 16:32:08 +00:00
Victoria Ashworth
ecabb1a052
Hide error on mDNS registration failure and print warning in flutter attach (#166782)
Publishing an mDNS service stopped working on macOS 15.4 for the iOS
Simulator. `DNSServiceRegister` always returns a callback with error
code `kDNSServiceErr_PolicyDenied`, as if the user had rejected the
permissions popup (except no popup is ever shown). mDNS is used to
discover the Dart VM when running `flutter attach`.

This PR does not display the error message when `DNSServiceRegister`
fails for iOS Simulators. Instead, it prints a warning if `flutter
attach` takes too long with instructions to either use `--debug-url` or
to run `flutter attach` before running the app.

If `DNSServiceRegister` works again in a future macOS update, mDNS will
continue to work the way it did previously.

Workaround for https://github.com/flutter/flutter/issues/166333.

## 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-04-17 14:20:23 +00:00
Gray Mackall
4884722b21
Add a gradle_errors.dartentry for missing NDK source.properties file (#167320)
Adds an error handler for
https://github.com/flutter/flutter/issues/164085, based on the suggested
workaround.

The only related Android issue I could find is
http://issuetracker.google.com/issues/201557284, which suggests it is
due to an incorrect path for the NDK within the Android directory, which
means that allowing AGP to re-download would fix the issue. Users also
suggest that doing that fixes the issue in this comment
https://github.com/flutter/flutter/issues/164085#issuecomment-2684252849,
so the handler suggests that as the official workaround.

## 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-04-17 03:13:09 +00:00
Victoria Ashworth
e841350bfc
Don't throw on error for mDNS when searching for Dart VML url on core devices (#167135)
When we discover the Dart VM for iOS Core Devices (iOS 17+), we use both
the device logs and mDNS simultaneously. Since mDNS is having issues
with macOS 15, don't throw if mDNS errors - this will allow the Dart VM
to have a chance to be found by the device logs instead.

Improving experience for
https://github.com/flutter/flutter/issues/150131.

Also should unblock https://github.com/flutter/flutter/issues/166843.

## 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-04-16 22:46:13 +00:00
Jason Simmons
7493583def
When using --local-web-sdk, use a locally built Dart SDK if one is available (#166732)
If flutter_tools is run with both a local Web SDK and a local engine,
then use the Dart SDK from the local engine instead of the prebuilt Dart
SDK.

This enables testing of a local Wasm build with a locally patched Dart
SDK by setting --local-web-sdk to the Wasm engine output and
--local-engine/--local-engine-host to a local engine built with
--no-prebuilt-dart-sdk.
2025-04-16 19:09:23 +00:00
gaaclarke
290701f5ed
Added emulator version to doctor (#167236)
fixes https://github.com/flutter/flutter/issues/146297

## 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-04-16 19:05:48 +00:00
Ben Konyi
3595e7dad0
[ Widget Preview ] Add support for theme and brightness properties on Preview (#167001)
The `theme` parameter of `Preview(...)` allows for developers to provide
a callback that returns a `PreviewThemeData` instance which can contain
theming data for Material and Cupertino widgets in both light and dark
modes. The provided theme data will be injected into the widget tree and
applied to the previewed widget.

The `brightness` parameter allows for developers to specify an initial
brightness setting (e.g., light vs dark mode) for the previewed widget.
If not provided, the current system default is used.

A new button has also been added to each widget preview card that allows
for toggling between light and dark mode for individual previews.

**Demo:**


https://github.com/user-attachments/assets/f0a4a3bc-25d2-49b0-a5f6-9149eccfc1d4

Fixes https://github.com/flutter/flutter/issues/166436
Fixes https://github.com/flutter/flutter/issues/166275
Fixes https://github.com/flutter/flutter/issues/166279
Fixes https://github.com/flutter/flutter/issues/166437
2025-04-15 17:51:40 +00:00
Loïc Sharma
37e79eb90c
[iOS/macOS] Add Xcode error if dev dependencies are incorrect (#165916)
Recently, the Flutter tool was updated to remove dev dependencies for
release builds and add dev dependencies for debug/profile builds.

However when building from Xcode directly, dev dependencies are not
enabled/disabled. As a result, it was possible for debug builds to not
have dev dependencies (or vice versa). Example:

1. `flutter build ios --release` - Release build using Flutter tool.
Disables dev dependencies
2. `open ios/Runner.xcworkspace` - Open the iOS project in Xcode
3. In Xcode, **Product** > **Build** - Do a debug build

Previously, step 3 would result in debug artifacts that are missing dev
dependencies. This PR now makes this an error:


![image](https://github.com/user-attachments/assets/621c4a8f-1c19-44b9-8866-93bef6b4a384)

Part of https://github.com/flutter/flutter/issues/163874

## Implementation

The Flutter tool now writes a `FLUTTER_DEV_DEPENDENCIES_ENABLED` in the
generated config file. This tracks whether the currently generated
project has dev dependencies.

In the Xcode build:

1. The Xcode backend script passes the
`FLUTTER_DEV_DEPENDENCIES_ENABLED` config to `flutter assemble` using
the `DevDependenciesEnabled` define
6. The new `CheckDevDependencies` target verifies dev dependencies:
1. It checks if the dev dependencies status is correct for the current
build mode
2. It checks whether the app has dev dependencies by reading the
`.flutter-plugins-dependencies` file. If the app has no dev
dependencies, the error is suppressed.

## 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-04-11 19:34:38 +00:00
Ben Konyi
ac6ab205b5
Reland "[ Widget Preview ] Add initial support for communications over the Dart Tooling Daemon (DTD) (#166698)" (#166877)
This reverts commit 059326d49d and updates
the `widget-preview` command to always spawn the previewer using a local
canvaskit binary.

Fixes https://github.com/flutter/flutter/issues/166865
2025-04-11 14:55:29 +00:00
Daco Harkes
0d64c7292c
[native assets] Support user-defines in pubspec (#166940)
This PR is the dual of
https://dart-review.googlesource.com/c/sdk/+/420700 in the Dart SDK.

This PR adds support for user-defines for hooks in the root package
`pubspec.yaml`.

```yaml
hooks:
  user_defines:
    hook_user_defines: # package name
      magic_value: 1000
```

For more design considerations see:

* https://github.com/dart-lang/native/issues/39

### Testing

This PR is covered by
`test/integration.shard/isolated/native_assets_test.dart`.

In this PR, we add a new test project
`dev/integration_tests/hook_user_defines/` and add a dependency on that
project in the mentioned test.

The integration test already covers `flutter run`, `flutter test`, and
`flutter build`.
2025-04-11 06:20:42 +00:00
Ben Konyi
4e027f789d
[ Widget Preview ] Link to placeholder documentation when no previews are defined (#166869)
Fixes https://github.com/flutter/flutter/issues/166443


![image](https://github.com/user-attachments/assets/04870f1c-109d-4aa8-aebf-d204e44250df)
2025-04-10 17:40:59 +00:00
Ben Konyi
6dbbfe671f
[ Widget Preview ] Add support for "soft" restart of individual previews (#166846)
A soft restart simply removes the previewed widget from the widget tree
for a frame before re-inserting it on the next frame. This has the
effect of re-running local initializers in `State` objects, which would
normally require a hot restart to accomplish. This reduces the number of
cases where a full hot restart of the preview environment would be
needed to pick up state-related changes.

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

**Updated Controls:**


![image](https://github.com/user-attachments/assets/616f8fc4-0b57-4a1c-85e7-ef36126cdffe)

**Demo:** updates a string initialized in `initState`, triggering a hot
reload. The updated string isn't rendered until the restart button is
pressed, causing the widget to be reloaded with the new state
initialized.


https://github.com/user-attachments/assets/ab4abf8a-7823-491a-ad90-f83d877600ec
2025-04-10 16:20:11 +00:00
Daco Harkes
f35d118814
[native assets] Roll dependencies (#166862)
Updating the dart-lang/native dependencies to the ones published
yesterday.

Incorporates a fix for:

* https://github.com/dart-lang/native/issues/2149
* Note that a bunch of tests were relying on ignoring build assets. The
tests have been fixed.

And the new `AssetRouting` syntax in the build hook for sending assets
to the link hook:

* https://github.com/dart-lang/native/pull/2164

Does not include support for user-defines in the pubspec yet. Will do
this in a follow up PR.

* https://github.com/dart-lang/native/pull/2165
2025-04-10 06:46:25 +00:00
Matan Lurey
d14ff81588
Handle missing placeholders in gen-l10n, add a regression test. (#166867)
Closes https://github.com/flutter/flutter/issues/165794.
2025-04-10 01:28:40 +00:00
auto-submit[bot]
059326d49d
Reverts "[ Widget Preview ] Add initial support for communications over the Dart Tooling Daemon (DTD) (#166698)" (#166866)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#166698
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jonahwilliams
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: tests are timing out in presubmit
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bkonyi
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
This will eventually be used as the main communication channel between
the widget preview scaffold, the Flutter tool, and other developer
tooling (e.g., IDEs).

Fixes #166417
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-04-09 18:11:18 +00:00
Valentin Hăloiu
0321ef5587
Add buildMode, icuDataPath and engineRevision interpolations for custom devices (#164455)
<!--
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
-->

Make 3 additional string interpolated values available to the
`postBuild` and `runDebug` custom device commands:
- `${icuDataPath}`
- `${engineRevision}`
- `${buildMode}`

#164454 provides some additional context and the main motivation for
this change.

Fixes #164454.

## 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-04-09 16:22:33 +00:00
Matan Lurey
54b3a97f53
Allow dart pub deps --json to fail without causing an explicit crash. (#166778)
Closes https://github.com/flutter/flutter/issues/166648.

I think a better fix is to stop using `dart pub deps --json` and use
@sigurdm's new `.dart_tool/` vendored solution, but that can be a
follow-up change.
2025-04-09 01:53:02 +00:00
Ben Konyi
30e53b0d9c
[ Widget Preview ] Add initial support for communications over the Dart Tooling Daemon (DTD) (#166698)
This will eventually be used as the main communication channel between
the widget preview scaffold, the Flutter tool, and other developer
tooling (e.g., IDEs).

Fixes #166417
2025-04-08 18:10:50 +00:00
flutter-pub-roller-bot
cc556aecae
Roll pub packages (#166503)
This PR was generated by `flutter update-packages --force-upgrade`.

---------

Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-04-08 00:41:20 +00:00
Ben Konyi
86525bcce4
[ Widget Preview ] Update generated test files (#166701) 2025-04-07 18:26:17 +00:00
Liam Appelbe
09367adce2
Make coverage collection aware of workspaces (#166389)
By default, `CoverageCollector.libraryNames` was being set to the name
of the current `FlutterProject`. This means that only tests in the
current project are included in the coverage report. So if the project
is a workspace, tests in its subprojects were being excluded. I've
changed it so that it also allows tests that are part of any of the
subprojects.

Fixes #159390
2025-04-06 22:27:08 +00:00
Ben Konyi
d6c0d6fee7
[ Widget Previews ] Add widget_preview_scaffold.shard to test the widget_preview_scaffold template contents (#166358)
Adds a new `widget_preview_scaffold.shard` directory which contains a
hydrated `widget_preview_scaffold` template. This will allow for us to
write widget tests against the widgets defined in the templates.

This PR doesn't add any widget tests and is only adding the ability to
run these tests in follow up changes.

Fixes https://github.com/flutter/flutter/issues/166416
2025-04-04 18:43:52 +00:00
Daco Harkes
dec31cbab6
[native_assets] Roll dependencies (#166282)
Updating the dart-lang/native dependencies to the ones published today.

No functional changes, but `CodeAsset` does not expose an `architecture`
and `os ` anymore (https://github.com/dart-lang/native/issues/2127).
Instead these should be taken from what is passed in for the
`CodeConfig`. This PR refactors the `DartBuildResult` to carry around
the `Target` with `CodeAsset`s as `FlutterCodeAsset`s.

(This PR avoid refactoring relevant code due to
https://github.com/flutter/flutter/pull/164094 already refactoring this
code.)
2025-04-03 05:42:31 +00:00
Victoria Ashworth
dbef1314b1
Trim any text before osascript JSON response (#166296)
Fixes https://github.com/flutter/flutter/issues/164772.

## 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-04-01 15:54:24 +00:00
Bent Hillerkus
0befaaafc9
[Gen-l10n] Add Message.resourceId and locale to all L10nException error messages (#163654)
<!--
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
-->

I've had this problem today
https://github.com/flutter/flutter/issues/163627 where the generator
would display me this error message:

> Error: The placeholder, count, has its "type" resource attribute set
to the "null" type in locale "en", but it is "num" in the template
placeholder. For compatibility with template placeholder, change the
"type" attribute to "num".

Unfortunately this isn't really actionable as it omits to which message
it's actually referring to!

So I added the id of the message to all error message and the locale of
the message to all messages that hadn't had it already.

## 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-04-01 15:07:03 +00:00
Nils Reichardt
70cd54c3fd
Add --ignore-timeouts flag for flutter test command (#164437)
As in #105913 described, running integration tests of your app often
times out. The issue for this is that the `test` package has their own
timeout for loading the test suite:


db8cf09150/pkgs/test_core/lib/src/runner/load_suite.dart (L23-L29)

This timeout is not configurable. However, you can bypass this timeout
using `--ignore-timeouts` when running `dart test`. This PR adds the
`--ignore-timeouts` flag to the `flutter test` command and passes it to
the `test` package.

Adding the flag would be the easiest fix for #105913. I will later add
documentation to the integration test docs, that passing this flag will
fix the timeout issue. Otherwise, we would need to make the load test
suite timeout configurable in the `test` package and then somehow set it
in the `flutter test` command.

Fixes #105913

![Screenshot 2025-03-02 at 00 08
59](https://github.com/user-attachments/assets/af84efe3-2174-4531-919f-bffdf1500430)

A screenshot of running `flutter test integration_test
--ignore-timeouts` which surpasses the previous timeout of 12 minutes.

## 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-04-01 14:17:20 +00:00
Loïc Sharma
a48a1f07b8
[tool] Improve using project files in build targets (#166211)
The Flutter tool's build system executes targets that take inputs and
produces outputs. Previously, targets would hardcode paths if they
needed to use Flutter project files as inputs/outputs. For example:

```dart
class FooTarget extends Target {
  @override
  List<Source> get inputs => <Source>[
    Source.pattern('{PROJECT_DIR}/foo/bar'),
  ];
}
```

This is problematic as the
[`FlutterProject`](05b5e79105/packages/flutter_tools/lib/src/project.dart (L89))
is the source of truth for where a Flutter project's files are located:

1. If we change a project file's location, we need to update
`FlutterProject` as well as any hardcoded target inputs/outputs.
2. Project files' location can be dynamic. For example, a Flutter app
puts iOS files in the `ios/` directory, but a Flutter module puts iOS
files in the `.ios/` directory. Targets need to duplicate
`FlutterProject`'s logic to determine the project file's location.

As a result, hardcoding project file paths in targets can be
error-prone.

This introduces a new `Source` factory that lets you use the
`FlutterProject` to create the source:

```dart
class FooTarget extends Target {
  @override
  List<Source> get inputs => <Source>[
    Source.fromProject((FlutterProject project) => project.fooFile),
  ];
}
```

Part of https://github.com/flutter/flutter/issues/163874

Next pull request: https://github.com/flutter/flutter/pull/165916

## 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-04-01 05:15:25 +00:00
Loïc Sharma
9b4164035b
[tool] Don't write the .flutter-plugins-dependencies file if it is unchanged (#166164)
Currently, `refreshPlugins` always updates the
`.flutter-plugins-dependencies` file. In a future change, `flutter
assemble` will use the `.flutter-plugins-dependencies` file as an input.
Unnecessary writes to this file will invalidate build targets.

This updates the logic to only write .flutter-plugins-dependencies if it
has "significant" changes.

Part of https://github.com/flutter/flutter/issues/163874

Next pull request: https://github.com/flutter/flutter/pull/165916

## 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-03-31 22:39:05 +00:00
Bent Hillerkus
0cc606cc5f
[Gen-l10n] Infer placeholder types on both templates and localizations (#163690)
<!--
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
-->

This fixes https://github.com/flutter/flutter/issues/163627 by trying to
the infer the type of a placeholder on both the template messages and
their localised versions.

This way, if the placeholder is being referenced in the localisation,
but the type is omitted in both the template and the localisation, the
check for if the template and the localisation have the same type will
not fail anymore.

## 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: Ben Konyi <bkonyi@google.com>
2025-03-31 20:00:08 +00:00
Ben Konyi
0db5aaf8d7
[ Tool ] Correctly select entrypoint target for web build from positional argument list (#166260)
`BuildWebCommand` was accessing the value of `target` directly from the
argument parser rather than using the `targetFile` getter defined on
`FlutterCommand` which handles file paths provided in the positional
argument list.

Fixes https://github.com/flutter/flutter/issues/136830.
2025-03-31 17:23:58 +00:00
Ben Konyi
edf0322cf0
Remove <meta content="IE=Edge" http-equiv="X-UA-Compatible"> (#166252)
Fixes https://github.com/flutter/flutter/issues/166166
2025-03-31 16:03:56 +00:00
Ben Konyi
943dd30bfd
[ Widget Previews ] Default to using Flutter Web for the widget preview environment (#166091)
Desktop support is now behind `--desktop` as an escape hatch for now,
but will eventually be removed.
2025-03-28 17:12:09 +00:00
Byoungchan Lee
ffcc383848
[flutter_tools] Fix VS Code package.json path on macOS with case-sensitive file system (#163409)
This PR corrects the path to VS Code's `package.json` in `flutter
doctor` for macOS with a case-sensitive file system. The correct
directory name is `Resources`, but the existing code incorrectly uses
`resources`.

On a case-insensitive file system (the macOS default), this issue does
not appear. However, on a case-sensitive file system, `flutter doctor`
fails to detect the VS Code version correctly.

Fixes #163408.

<!--
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 this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*

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

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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-03-28 16:35:15 +00:00
Andrew Kolos
cb40f1b8fd
Get analytics welcome message under test (#162627)
Fixes https://github.com/flutter/flutter/issues/160374

For this I resorted to a unit test directly against `exitWithHooks`
(which is called when the tool is shutting down). An integration test
against a "fresh" tool checkout would probably be more resilient, but
I'm not sure if a more heavyweight test is worth it.


<details>

<summary> Pre-launch checklist </summary> 


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

</details>


<!-- 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-03-28 13:41:28 +00:00
Ben Konyi
3efb8cc359
[ Widget Preview ] Display an error widget when an exception is thrown while defining the widget tree (#166005)
Example exception thrown trying to invoke `Directory.current` in a
widget constructor:


![image](https://github.com/user-attachments/assets/f9038fa0-9e6e-4037-bc33-a304861c6a22)
2025-03-27 18:47:51 +00:00
Danny Tuppeny
53b87635b0
[flutter_tool] Handle RPCErrorKind.kConnectionDisposed (#164299)
There's currently a lot of code that handles RPC Errors that contain the
text "Service connection disposed" because the error originally did not
have a unique error code.

A new error code was added in
https://dart-review.googlesource.com/c/sdk/+/381501 but it's not
currently used because it won't be caught by existing code.

This change updates all places that check for this text, and now also
handle the new error code in preperation for the code changing in
future.

See https://github.com/flutter/flutter/issues/153471

cc @bkonyi 

## 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.
Issue listed, but this change does not directly fix it, it just prepares
for a related future change that will simplify handling these errors
without string checks
- [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].
2025-03-27 08:51:38 +00:00
Ben Konyi
8297e44993
[ Hot Restart ] Fix possible hang due to unhandled exception in UI isolates on hot restart (#165693)
Possible fix for https://github.com/flutter/flutter/issues/161466
2025-03-26 16:50:07 +00:00
Matan Lurey
46969e531b
Allow generate: true as long as synthetic packages are not being used. (#165838)
Closes https://github.com/flutter/flutter/issues/164864.
2025-03-25 14:54:22 +00:00
jesswrd
807ccd7f9d
Update Java Versions to 21 on CI (#165210)
Updated java versions to 21 on CI. Monitor to see if anything breaks.

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

## 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 <34871572+gmackall@users.noreply.github.com>
2025-03-24 22:43:22 +00:00
Ben Konyi
a664992fe0
Re-enable bash_entrypoint_test.dart (#165809)
The test was fixed in
d443df008b
but never re-enabled.

Fixes https://github.com/flutter/flutter/issues/160689
2025-03-24 18:47:17 +00:00
Ben Konyi
41c427c6de
[ Widget Preview ] Remove WidgetPreview in favor of using annotation properties (#165500)
This change reworks how users define previews in their code, expands the
number of valid 'functions' that can be used to create previews, and
allows for specifying a 'wrapper' function to wrap the previewed widget
with

The `WidgetPreview` class has been removed from the framework, with its
properties being added to the `Preview` annotation class instead to
remove some boilerplate from the preview declaration workflow.

Before:

```dart
@Preview()
List<WidgetPreview> previews() => <WidgetPreview>[
      WidgetPreview(
        name: 'Top-level preview',
        child: Text('Foo'),
      ),
  ];
```

After:

```dart
@Preview(name: 'Top-level preview')
Widget previews() => Text('Foo');
```

Previews can now be defined using top-level functions, constructors and
factories which take no arguments, and static methods within classes:

Examples:

```dart
@Preview(name: 'Top-level preview')
Widget previews() => Text('Foo');

class MyWidget extends StatelessWidget {
  @Preview(name: 'Constructor preview')
  MyWidget.preview();

  @Preview(name: 'Factory preview')
  factory MyWidget.factoryPreview() => MyWidget.preview();

  @Preview(name: 'Static preview')
  static Widget previewStatic() => Text('Static');

  @override
  Widget build(BuildContext context) {
    return Text('MyWidget');
  }
}
```

Users can also provide a `wrapper` function with the signature `Widget
Function(Widget)` to easily wrap previewed widget with shared
bootstrapping logic.

Example:

```dart
Widget testWrapper(Widget child) {
  return Provider<int>.value(
    value: 42,
    child: child,
  );
}

@Preview(name: 'Preview with wrapper', wrapper: testWrapper)
Widget preview() {
  return Text('Attributes');
}
```

Which is effectively the same as:

```dart
@Preview(name: 'Preview with wrapper')
Widget preview() {
  return Provider<int>.value(
    value: 42,
    child: Text('Attributes'),
  );
}
```

Finally, for situations where a `BuildContext` is needed, users can
return a `WidgetBuilder` from their preview function:

```dart
@Preview('Builder preview')
WidgetBuilder builderPreview() {
  return (BuildContext context) {
    // TODO: retrieve state from context.
    return Text('Foo');
  };
}
```
2025-03-22 01:35:36 +00:00
Gray Mackall
c9667e07ac
More FlutterPlugin static method conversion (#165506)
Moves a lot more functionality from `flutter.groovy` to
`FlutterPluginUtils.kt` that could be made static.

## 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 `///`).
- [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-03-22 01:34:05 +00:00
Daco Harkes
ff97c28f20
[native assets] Roll dependencies (#165574)
Updating the dart-lang/native dependencies to the ones published today.
2025-03-21 20:46:08 +00:00
Victoria Ashworth
673d9979e7
Save a provisioning profile to flutter config for manual code-signing (#164984)
This adds the ability to save a provisioning profile to the flutter
config. It introduces a flag `flutter config
--select-ios-signing-settings` which prompts the user to select either
Automatic or Manual code-signing and then select a code-signing
identity/cert for Automatic or a provisioning profile for Manual.


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

## 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-03-21 20:44:03 +00:00
Sigurd Meldgaard
95843ca334
Normalize path before searching for package config (#165392)
If we don't normalize the `.absolute.path` will look like `/child/.`
And `Directory('/child/.').parent` is `Directory('/child)`.
2025-03-20 10:07:32 +00:00
Kamil Szczęk
4c35308ccf
fix(doctor): add an alternative path for the Dart plugin (#163215)
It seems like with some recent plugin/IDE version, the path for the Dart
plugin has changed from `<base path>/Dart` to `<base path>/dart`,
causing `flutter doctor` to incorrectly assume that the plugin is not
installed.

Add `dart` as an alternative to the existing `Dart` package name.

Fixes #163214.

## 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].
- [ ] 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-03-18 09:35:34 +00:00
Jason Simmons
212d7d8209
[native assets] Add the native asset manifest to the bundle dependencies in non-debug modes (#165023)
Fixes https://github.com/flutter/flutter/issues/164149
2025-03-13 20:57:59 +00:00
Victoria Ashworth
03f1208721
Fix SwiftPM scheme migration to handle when there are no BuildActionEntries (#164660)
An Xcode scheme may or may not have `BuildActionEntries`. When migrating
to SwiftPM, if Flutter cannot find `BuildActionEntries` in the xcscheme,
append the `PreAction` to the end of the `BuildAction`.

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

## 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-03-12 20:53:50 +00:00
Jason Simmons
a7a4d0bd2b
Write macOS universal gen_snapshot binaries to a separate output directory (#164667)
Also use the name "gen_snapshot" when building for Android targets
instead of appending a target architecture to the filename.

This allows flutter_tools to find the universal gen_snapshot binary when
using a locally built engine. Previously the tools would search
directories like "clang_x64" and find build outputs that may not match
the host architecture.

Moving the universal gen_snapshot binary to a separate directory avoids
conflicts with Dart's gen_snapshot binary, which is placed at the root
of the target output directory.
2025-03-12 19:02:55 +00:00
Srujan Gaddam
0bdb4d68b5
[flutter_tools] Call reassemble with DWDS 24.3.7 and update hot reload and restart analytics (#165006)
https://github.com/dart-lang/webdev/issues/2584

Reassemble was being called in DWDS in the injected client until
v24.3.7. Flutter tools should now instead be the one to call the service
extension. Now that it's in Flutter tools, we can also report how long
it took. Similarly, we should update analytics on various things like,
whether there was a reload rejection, how long the compile took, and
more.

Adds test to check that these analytics are being reported correctly.

## 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-03-12 15:16:49 +00:00
Kevin Moore
292496f80d
[tools, web] Make sure to copy the dump-info file if dump-info is used (#165013)
Also fixed the wording of the dump-info build flag
2025-03-11 22:52:06 +00:00
Reid Baker
463e751640
Convert AppLinkSettings to kotlin (#164391)
Fixes #162107

Commands that were helpful when working on this pr. 
`dart dev/tools/bin/generate_gradle_lockfiles.dart
--no-gradle-generation` from flutter/flutter root.
`./gradlew test` from packages/flutter_tools/gradle. 
`git add -- ":*.lockfile"` for adding only lockfile changes. 
`../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t
android_java11_dependency_smoke_tests` from dev/devicelab
`ktlint --editorconfig=dev/bots/test/analyze-test-input/.editorconfig
--baseline=dev/bots/test/analyze-test-input/ktlint-baseline.xml
packages/flutter_tools/gradle/src/ --format` formatting kotlin code.
Need ktlint 1.5


## 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-03-11 17:00:17 +00:00
Victoria Ashworth
84b38b8dfc
Make LLDB check a warning instead of a failure (#164828)
We added LLDB file in https://github.com/flutter/flutter/pull/164344.
This adjusts it so if the LLDB file is missing it gives a warning rather
than an error that fails the build.

## 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-03-10 23:27:53 +00:00
Victoria Ashworth
eb07c51230
Add lldb init file (#164344)
Adds an .lldbinit file to iOS app xcscheme.

Adding to scheme files can be error prone since a developer may be using
custom schemes (flavors). If we can't add it to the scheme, we print an
error without failing.

Since it is part of the scheme, it will be added to the project and will
be used on every run regardless of the device type/version. The Dart
side handles limiting to specific devices. If needed, we can alter the
.lldbinit file during `flutter assemble` to rewrite it since it doesn't
read the file until launch time (therefore it can be changed during
build time).

During `flutter assemble`, if the project doesn't have an LLDB Init File
set for any schemes, it'll throw an error if running in debug mode with
an iOS 18.4+ device.

## 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 `///`).
- [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-03-06 21:21:52 +00:00
Jason Simmons
8876bccf3a
Use separate artifacts for arm64 and x64 versions of gen_snapshot on Apple platforms (#164419)
Fixes https://github.com/flutter/flutter/issues/156175
2025-03-06 20:14:08 +00:00
Matan Lurey
71d50a1616
Start using bin/cache/engine.{stamp|realm} instead of bin/internal/engine.{realm|version}. (#164352)
Towards https://github.com/flutter/flutter/issues/164315.

See also:
https://github.com/flutter/flutter/blob/master/docs/tool/Engine-artifacts.md.

There are more usages in `flutter/flutter`, but some will require more
specialized review (i.e. from release folks, or the Dart SDK team), so
I'll split those off.

~~Requires https://github.com/flutter/flutter/pull/164317 to merge
first.~~ 
2025-03-02 00:54:33 +00:00
Mikhail Novoseltsev
b8902e6a17
[tool] Allow using archiveName in android bundle build (#162390)
fixes #126971 

Also, for some reason, fixes #147261 , which shouldn't have been ever
broken since this case tested here:

b007899d3a/packages/flutter_tools/test/general.shard/android/gradle_find_bundle_test.dart (L153-L173)

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

Key change here is replacing the optimistic approach of guessing the
filename based on buildInfo parameters with the actual discovery of
built artifacts on the filesystem. This change is needed because there
is no way the build can determine the archiveName from Gradle, which
differentiates this part from other parameters such as buildType and
flavor. Flutter build contains information about them, but not about the
base name.

<img width="673" alt="Screenshot 2025-01-29 at 22 42 29"
src="https://github.com/user-attachments/assets/ab530a00-031f-48e2-962c-ed010b4009c9"
/>


## 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: Reid Baker <hamilton.reid.baker@gmail.com>
Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
Co-authored-by: Reid Baker <reidbaker@google.com>
2025-02-28 14:57:20 +00:00
Jonas Uekötter
556ae54358
Fix incorrectly checking for invalid environment variables in the tool (#164101)
<!--
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
-->

This PR removes a check that looks for the use of Flutter version
related Dart define keys in the environment variables (not Dart defines)
of the user of the Flutter tool. We don't need to check the environment
variables, we only need to check the user defined Dart defines.

Here's how it currently works:

1. User builds a Flutter app via tool
2. tool checks environment variables for Flutter version related Dart
define keys and throws if it finds and (_and_)
3. tool checks list of user defined Dart defines for Flutter version
related Dart define keys and throws if it finds any

This PR removes the check in step 2, since step 3 is what we actually
care about.

The `FLUTTER_GIT_URL` environment variable is set on forks and the Dart
define is used to make that information available to applications at
runtime. However, environment variables don't propagate to be Dart
defines, thus the above mentioned check is not needed.

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

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

<!-- 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-02-28 14:48:15 +00:00
Robert Ancell
887d5dd9c2
Fix flutter doctor usage of eglinfo in failure cases. (#164334)
Ignore return value from eglinfo - it doesn't indicate failure.
Discovered when using an X11 system where Wayland is not available. It
returns 1 in this case, but the output is still valid. Confirmed by
looking at the eglinfo source - we should parse the output regardless of
what it returns.

Catch exception correctly when eglinfo is not installed.

Fixes for https://github.com/flutter/flutter/pull/163980
2025-02-28 13:07:55 +00:00
Sigurd Meldgaard
45b21ec3bb
Refactor writing of package config in tests (#163734)
Seems like each test had its own way of doing this.

Extracted from https://github.com/flutter/flutter/pull/160443
2025-02-28 08:51:59 +00:00
Matan Lurey
d8856b9e50
Remove the last vestiges of null-unsafety in flutter_tools. (#164026)
The internal code using this was deleted in `cl/730558889`.
2025-02-27 16:31:22 +00:00
Robert Ancell
d64b8e29c3
Show Linux driver information in flutter doctor (#163980)
I have attempted to cherry pick some useful information from eglinfo
which is often requested when resolving issues with rendering.

This information is not required to compile an Flutter application, so
it is a little different to the other displayed information.
2025-02-26 23:40:07 +00:00
Victoria Ashworth
aa113bd69c
Intercept error when iOS 18.4 crashes with JIT mode and give guided error (#164072)
Adds listener to device logs during launch (before Dart VM is found) and
check if iOS 18.4+ JIT crash log and give guided error message:

```
════════════════════════════════════════════════════════════════════════════════
A change to iOS has caused a temporary break in Flutter's debug mode on
physical devices.
See https://github.com/flutter/flutter/issues/163984 for details.

In the meantime, we recommend these temporary workarounds:

* When developing with a physical device, use one running iOS 18.3 or lower.
* Use a simulator for development rather than a physical device.
* If you must use a device updated to iOS 18.4+, use Flutter's release or
  profile mode via --release or --profile flags.
════════════════════════════════════════════════════════════════════════════════
```

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

## 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-02-26 05:07:58 +00:00
Jenn Magder
898ab2479e
Check if simctl is installed before trying to list devices or runtimes (#163895)
After https://github.com/flutter/flutter/pull/163785 there was still an
unexpected `xcrun simctl` output on a machine with Xcode only half
installed https://github.com/flutter/flutter/issues/161655.

Check `simctl` is installed before trying to list booted simulator
devices or runtimes.

Should address https://github.com/flutter/flutter/issues/161655.

## 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-02-25 22:24:49 +00:00
Matan Lurey
5a8f23c3dc
Fix and test an edge case in findPackageConfigFile. (#163902)
Closes https://github.com/flutter/flutter/issues/163901.

I'm not aware of a case where this causes user crashes, but it could,
and seems easy to fix/test.
2025-02-25 15:01:51 +00:00
Jonas Uekötter
a8d1b62382
Reland "Make Flutter version information accessible at runtime (#140783)" (#163761)
Reverts https://github.com/flutter/flutter/pull/163753
Relands https://github.com/flutter/flutter/pull/140783

Original PR description below

------

This makes various Flutter version information available at runtime.
It's basically the same as executing `flutter --version`. This is
especially useful for tools like Crashlytics or Sentry (see for example
https://github.com/getsentry/sentry-dart/issues/416).

Usage example:
```dart
FlutterVersion.version;           // 3.16.5
FlutterVersion.channel;           // stable
FlutterVersion.gitUrl;            // https://github.com/flutter/flutter.git
FlutterVersion.frameworkRevision; // 78666c8dc5
FlutterVersion.engineRevision;    // 3f3e560236
FlutterVersion.dartVersion;       // 3.2.3
```

This approach has prior art as seen in #134179.

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

<!-- *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] 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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2025-02-24 20:17:08 +00:00
Jenn Magder
404655aae1
Update gradle memory properties in example and test projects (#163798)
Match the example and integration test apps to the the properties in the
`flutter create` template, updated in
https://github.com/flutter/flutter/pull/156201.

We discussed perhaps making this an auto-migration for existing Flutter
apps (if they've never edited the template from the old values), but it
probably makes sense for devs to manage this themselves depending on how
beefy the machine they are running on is.

Filed https://github.com/flutter/flutter/issues/163801 to show a nicer
message when the user hits this so they can manage
`java.lang.OutOfMemoryError: Java heap space` errors themselves.

Speculatively hoping this helps with the `Java heap space` build test
flakes
https://github.com/flutter/flutter/issues/163121#issuecomment-2665783740



## 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-02-21 21:08:20 +00:00
Jenn Magder
bb306c53a3
Suppress stderr during Xcode command line installation check (#163785)
Xcode is in some kind of half-installed state (missing a cert? unknown)
on some devicelab Macs https://github.com/flutter/flutter/issues/161655.
As of https://github.com/flutter/flutter/pull/163685 Xcode cipd
installation isn't requested as part of the builder configuration, so it
seems like Xcode is just hanging out on that devicelab bot
quasi-installed, unrelated to the recipe.

In any case, the tool is actually doing the right thing and detecting
that Xcode isn't in a good state and continuing as if it isn't
installed, but is logging a wall of error text about it to stderr, which
that Android test doesn't like. Instead of updating the test to allow
stderr, instead swap the Xcode installation path to `exitsHappySync` to
only check the exit code (or exception), which is the original intention
behind the Xcode command line checks.


e6730613c9/packages/flutter_tools/lib/src/base/process.dart (L596-L601)

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

## 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-02-21 18:36:35 +00:00
Brandon DeRosier
911aa7547e
Remove legacy scenec stuff from flutter_tool (#163569)
o7

Removes the legacy scenec logic from flutter_tool. We removed scenec
from the engine/shipped artifacts long ago. Originally added in
https://github.com/flutter/flutter/pull/118157. This has since been
replaced by
[flutter_scene_importer](https://pub.dev/packages/flutter_scene_importer/versions)!
2025-02-21 17:41:02 +00:00
Matan Lurey
178749b970
Reland #163711 after #163780 (#163812)
Closes https://github.com/flutter/flutter/issues/163767.
Closes https://github.com/flutter/flutter/issues/163706.

It just works after, but added more test cases.
2025-02-21 03:35:14 +00:00
Matan Lurey
f6543c3d45
Make releaseMode explicit, inform determineDevDependencies entirely on the flag (#163780)
Closes https://github.com/flutter/flutter/issues/163770.

This simplifies understanding "when I called function X, how is it
determining release mode and/or dev-dependencies?"

AFAICT, at HEAD, this is a NOP (will let integration tests run), but
would have avoided cases such as
https://github.com/flutter/flutter/issues/163706.
2025-02-21 00:07:48 +00:00
Kevin Moore
7819cee8d6
[web] DRY up access to headers required for multi-threaded WebAssembly (#163555) 2025-02-20 22:26:57 +00:00
auto-submit[bot]
e6730613c9
Reverts "Avoid implicitly setting determineDevDependencies: true (it's not a safe operation) (#163711)" (#163762)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#163711
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: victorsanni
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: This is closing the tree. See
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20android_release_builds_exclude_dev_dependencies_test/889/overview
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: matanlurey
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
Closes https://github.com/flutter/flutter/issues/163706.

Before this PR, the macOS workflow (or, others, but only macOS had a
test) would fail because it calls `refreshPluginsList` manually, and
sometimes it would be `determineDevDependencies: null` and sometimes
`determineDevDependencies: false`.

A value of `determineDevDependencies: null` was interpreted later on as
"find dev dependencies", which is not a safe operation. The only real
change in this PR is `bool determineDevDependencies = false`, so
omitting that parameter means we don't determine dev dependencies.

Added some tests, and opted-in an integration test that was failing.
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-02-20 19:57:25 +00:00
auto-submit[bot]
fc9f5b0a54
Reverts "Make Flutter version information accessible at runtime (#140783)" (#163753)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#140783
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: This broke presubmit (which was skipped using
`added this pull request to the merge queue 2 hours ago`).

See https://github.com/flutter/flutter/issues/162715. Adding to the
merge queue manually is _not_ safe currently.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: ueman
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
This makes various Flutter version information available at runtime.
It's basically the same as executing `flutter --version`. This is
especially useful for tools like Crashlytics or Sentry (see for example
https://github.com/getsentry/sentry-dart/issues/416).

Usage example:
```dart
FlutterVersion.version;           // 3.16.5
FlutterVersion.channel;           // stable
FlutterVersion.gitUrl;            // https://github.com/flutter/flutter.git
FlutterVersion.frameworkRevision; // 78666c8dc5
FlutterVersion.engineRevision;    // 3f3e560236
FlutterVersion.dartVersion;       // 3.2.3
```

This approach has prior art as seen in #134179.

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

<!-- *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] 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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-02-20 18:00:48 +00:00
Matan Lurey
7df3f8fc06
Add FlutterVersion.engineCommitDate, helps signal engine artifact SHA issues (#163652)
Closes #163644.

Before this change:
```sh
flutter-dev --version                                                                         
Flutter 3.30.0-1.0.pre.215 • channel [user-branch] • https://github.com/matanlurey/flutter
Framework • revision cead517e4e (79 seconds ago) • 2025-02-19 13:00:11 -0800
Engine • revision 39b4951f8f
Tools • Dart 3.8.0 (build 3.8.0-92.0.dev) • DevTools 2.43.0
```

After this change:
```sh
flutter-dev --version                                                                         
Flutter 3.30.0-1.0.pre.215 • channel [user-branch] • https://github.com/matanlurey/flutter
Framework • revision cead517e4e (79 seconds ago) • 2025-02-19 13:00:11 -0800
Engine • revision 39b4951f8f (79 seconds ago) • 2025-02-18 13:42:53 -0800
Tools • Dart 3.8.0 (build 3.8.0-92.0.dev) • DevTools 2.43.0
```

/cc @jtmcdole as this could be helpful for sleuthing artifact mismatch.
2025-02-20 16:31:29 +00:00
Matan Lurey
281612e648
Avoid implicitly setting determineDevDependencies: true (it's not a safe operation) (#163711)
Closes https://github.com/flutter/flutter/issues/163706.

Before this PR, the macOS workflow (or, others, but only macOS had a
test) would fail because it calls `refreshPluginsList` manually, and
sometimes it would be `determineDevDependencies: null` and sometimes
`determineDevDependencies: false`.

A value of `determineDevDependencies: null` was interpreted later on as
"find dev dependencies", which is not a safe operation. The only real
change in this PR is `bool determineDevDependencies = false`, so
omitting that parameter means we don't determine dev dependencies.

Added some tests, and opted-in an integration test that was failing.
2025-02-20 15:56:08 +00:00
Jonas Uekötter
ae100a265b
Make Flutter version information accessible at runtime (#140783)
This makes various Flutter version information available at runtime.
It's basically the same as executing `flutter --version`. This is
especially useful for tools like Crashlytics or Sentry (see for example
https://github.com/getsentry/sentry-dart/issues/416).

Usage example:
```dart
FlutterVersion.version;           // 3.16.5
FlutterVersion.channel;           // stable
FlutterVersion.gitUrl;            // https://github.com/flutter/flutter.git
FlutterVersion.frameworkRevision; // 78666c8dc5
FlutterVersion.engineRevision;    // 3f3e560236
FlutterVersion.dartVersion;       // 3.2.3
```

This approach has prior art as seen in #134179.

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

<!-- *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] 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/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

---------

Co-authored-by: Greg Price <gnprice@gmail.com>
2025-02-20 15:23:31 +00:00
Ben Konyi
9c7e2c2563
[ Widget Preview ] Move preview_detector_test.dart from general.shard to commands.shard (#163619)
Tests under the `general.shard` have a 2000ms timeout and these tests
write to the real file system and watch directories for changes. This
can be slow on heavily loaded machines and cause flaky failures.
2025-02-19 22:53:35 +00:00
Nate Biggs
4b2a52fdfd
Allow flutter tools to detach a running Chrome session (#163349)
https://github.com/flutter/flutter/issues/163329

Tested locally to ensure pressing 'd' in a running `flutter run` session
detaches and leaves Chrome open. Hitting 'q' or stopping with a signal
both terminate Chrome as expected.

## 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: Nate Biggs <natebiggs@google.com>
2025-02-19 22:00:14 +00:00
Victoria Ashworth
8d100a6416
Get flavor/scheme in assemble command from the build configuration (#162907)
This moves the logic for `FLUTTER_APP_FLAVOR` into `flutter assemble`,
so that it also works when ran through Xcode and not just through the
Flutter CLI.

However, there's no definitive way to get the the flavor/scheme in
`flutter assemble`, so this makes a best effort to get it by parsing it
out of the `CONFIGURATION`. `CONFIGURATION` should have the name of the
scheme in it, although, this is only
[semi-enforced](1d85de0fc8/packages/flutter_tools/lib/src/ios/mac.dart (L201-L203)),
so may not always work. If it's unable to get the scheme name from the
`CONFIGURATION`, it falls back to using the `FLAVOR` environment
variable, which is set by the Flutter CLI and used currently.

Verified `Mac_ios flavors_test_ios` passes:
https://ci.chromium.org/ui/p/flutter/builders/prod.shadow/Mac_ios%20flavors_test_ios/7/overview

Verified `Mac flavors_test_macos` passes:
https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Mac%20flavors_test_macos/2/overview

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

## 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-02-19 20:37:35 +00:00
Ben Konyi
cccb49d3e6
[ Widget Preview ] Invalidate scaffold project if SDK changes and regenerate pubspec on change (#163343)
If the Flutter SDK is updated we need to invalidate the widget preview
scaffold project to, at the very least, rebuild the precompiled
application. Similarly, if the root project's `pubspec.yaml` is updated,
the scaffold project's pubspec should be regenerated.

This change adds a `preview_manifest.json` to the scaffold project which
contains information related to:

- The manifest schema version
- The Dart SDK version the project was generated with
- The last known hash of the root project's pubspec.yaml

This information is used to determine whether or not the scaffold
project needs to be regenerated or the scaffold pubspec needs to be
updated to reflect changes to the root project's pubspec since the
previewer was last run.
2025-02-19 20:02:57 +00:00
Matan Lurey
29d1e10a02
Invalidate pod install output if .flutter-plugins-dependencies content changes. (#163275)
Closes https://github.com/flutter/flutter/issues/162399.
Closes https://github.com/flutter/flutter/issues/163272.

`refreshPluginsList` is commonly called in iOS/macOS apps, more times
than you expect (and load bearing);
https://github.com/flutter/flutter/issues/157391.

With `--explicit-package-dependencies`, we no longer write (or compare)
the output of `.flutter-plugins`. The iOS/macOS workflows required `pod
install` output to be invalidated when plugins when change, but the
logic that was being used to see if plugins changed _only_ worked for
the `.flutter-plugins` file format.

In the original code:

```txt
# oldPluginsFileStringContent
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"/Users/matanl/Developer/flutter/packages/integration_test/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"ios_objc_cocoapods_plugin","path":"/var/folders/qw/qw_3qd1x4kz5w975jhdq4k58007b7h/T/swift_package_manager_enabled.XrEWXS/ios_objc_cocoapods_plugin/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"integration_test","path":"/Users/matanl/Developer/flutter/packages/integration_test/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"ios_objc_cocoapods_plugin","dependencies":[]}],"date_created":"2025-02-13 17:01:11.023097","version":"3.30.0-1.0.pre.163","swift_package_manager_enabled":{"ios":true,"macos":false}}

# pluginsMap
{ios: [{name: integration_test, path: /Users/matanl/Developer/flutter/packages/integration_test/, native_build: true, dependencies: [], dev_dependency: false}, {name: ios_objc_cocoapods_plugin, path: /var/folders/qw/qw_3qd1x4kz5w975jhdq4k58007b7h/T/swift_package_manager_enabled.XrEWXS/ios_objc_cocoapods_plugin/, native_build: true, dependencies: [], dev_dependency: false}], android: [{name: integration_test, path: /Users/matanl/Developer/flutter/packages/integration_test/, native_build: true, dependencies: [], dev_dependency: false}], macos: [], linux: [], windows: [], web: []}
```

As you can see, `pluginsChanged =
oldPluginsFileStringContent.contains(pluginsMap.toString());` was
_always_ `false`, but we never knew because we'd always just fall back
to using the `.flutter-plugins` content comparison (which always
worked).

I added a test as well.

This also appears to fix
https://github.com/flutter/flutter/issues/162399.

/cc @jmagman @jonahwilliams
2025-02-18 15:35:07 +00:00
Ben Konyi
6e7e36fdd3
[ Widget Preview ] Add experimental support for web-based widget preview environment (#163154)
`flutter widget-preview start --web` will cause the widget preview
scaffold to be run as a Flutter Web application using experimental hot
reload support. This will eventually be the default, with the desktop
environment being put behind a flag for use as a fallback under the
assumption that the desktop environment will be removed in the future.
2025-02-14 20:16:02 +00:00
Srujan Gaddam
9393aae393
Align web terminal messages with the VM (#163268)
- Adds better instructions for hot reload (if using the right flags),
hot restart, quitting, clearing, and more. These were already being
printed when using the VM, so this aligns with that.
- Adds an extra parameter for `CommandHelp` to `ResidentRunner` so
`ResidentWebRunner` can pass a version of it that uses its separate
logger and not `globals`. In order to support this, classes up the stack
also provide a `Terminal`, `Platform`, and `OutputPreferences`.
- Fixes up use of `globals` from an earlier change to implement hot
reload to use the logger instead. Same with `globals.platform`.
- Adds tests to check that only hot restart is printed when not using
the extra front-end flags, and both hot restart and hot reload is
printed when you are.

## 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-02-14 19:57:53 +00:00
Matan Lurey
441bb070fe
Add .flutter-plugins-dependencies to FlutterBuildSystem; update logic, add tests. (#163278)
I happened to run into this while chasing other bugs, and noticed
`.flutter-plugins-dependencies` is omitted.

I am guessing this is probably quite stale, but something something
[Chesterton's
fence](https://en.wiktionary.org/wiki/Chesterton%27s_fence), and added
tests.
2025-02-14 05:40:03 +00:00
Mohellebi abdessalem
571d495ff6
convert resolve_dependencies.gradle to resolve_dependencies.gradle.kts (#159399)
converting `resolve_dependencies.gradle` to
`resolve_dependencies.gradle.kts`
## 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 followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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].

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 <34871572+gmackall@users.noreply.github.com>
Co-authored-by: Reid Baker <reidbaker@google.com>
2025-02-13 21:19:14 +00:00
Mouad Debbar
5fa05ab6df
[web] Cleanup everything HTML from the flutter tool and test harness (#162836)
- Delete code paths that handle screenshots for the HTML renderer
- Delete artifact enums for the HTML/AUTO renderers (and all their
usages).
- Remove HTML/AUTO renderers warnings.
- Delete the HTML/AUTO renderer enums (and all their usages).
- Delete tests for all the above.
2025-02-13 20:53:37 +00:00
Jonah Williams
a7c6cc19a3
[flutter_tools] remove SkSL target for iOS builds. (#163144)
Skia is no longer supported on iOS targets, so runtime shaders don't
need to bundle SkSL.

Fixes https://github.com/flutter/flutter/issues/138919
2025-02-13 01:00:07 +00:00
Matan Lurey
1c0a76d031
Opt-out of --explicit-package-dependencies for flutter_gen_test. (#163174)
Unblocks https://github.com/flutter/flutter/pull/160289.
2025-02-13 00:40:30 +00:00
Matan Lurey
055f6c1a49
Forward fix package:flutter_gen removal in resident_runner_test.dart (#163170)
Unblocks https://github.com/flutter/flutter/pull/160289.
2025-02-12 23:53:55 +00:00
Matan Lurey
1e32c00349
Remove synthetic package qualifier for flutter: generate: error. (#163145)
`generateLocalizations` should fail (`flutter gen-l10n`) if `flutter:
generate:` does not exist.

The previous logic was faulty, because it was totally possible to
opt-out of synthetic packages (i.e. in a `l10n.yaml` file), but still
not be specifying `flutter: generate:`, which I _believe_ is supposed to
still be an error.

This came up in https://github.com/flutter/flutter/pull/160289 as
`flutter config --explicit-package-dependencies` is enabled by default,
as the error is no longer thrown. Made a few other small test
forward-fixes that otherwise would break with the switch (but are
expected) as well.
2025-02-12 22:20:50 +00:00
Matan Lurey
063f80d40f
Finish removing null-safety mode, checks, and reporting. (#163153)
Closes https://github.com/flutter/flutter/issues/162846.

At HEAD, including before this PR, it was impossible to use, or pass-in,
an unsound null-safety mode, but we still had code checking for it, and
reported analytics (I think? Some of these are `package:usage` specific
which is defunct).

This PR eradicates the otherwise unused code.
2025-02-12 21:52:02 +00:00
Matan Lurey
90a4323cab
Make developing flutter_tools nicer: Use fail instead of throw StateError. (#163094)
Closes https://github.com/flutter/flutter/issues/163091.
2025-02-12 17:24:26 +00:00
Matan Lurey
b728c4c06a
Remove unsound artifacts, remove *Sound qualifier. (#163015)
Towards https://github.com/flutter/flutter/issues/162846.

Removes all of the unsound host artifacts, and then uses their name for
the sound artifacts.

That is, for something like `webPlatformDDCKernelDill`, this PR:

- Changes the web GN builders to only emit the sound SDK, without the
`-sound` suffixes
- Deletes `webPlatformDDCKernelDill` and all usages of it (implicitly
unsound, and unused).
- Renames `webPlatformDDCKernelSoundDill` to `webPlatformDDCKernelDill`.

No user impact expected, as there was no way to use the unsound
artifacts from the Flutter tool.
2025-02-12 02:40:18 +00:00
Ben Konyi
e7e5480a57
[ Widget Preview ] Update generated scaffold project to include early preview rendering (#162847)
With this change, `flutter widget-preview start` will launch a working
widget preview environment that can render previews from a target
project.

Also fixes an issue where `--offline` wasn't being respected by some pub
operations.
2025-02-11 16:41:28 +00:00
Jackson Gardner
30b8eb635b
Change the default optimization level to -O2 for wasm in release mode. (#162917)
As per the investigation in
https://github.com/flutter/flutter/issues/162620, we determined that the
soundness we gain from using `-O2` outweighs the perf benefits of `-O4`.
2025-02-10 21:29:35 +00:00
Nate Biggs
1d766ed8d9
Add experimental hot reload flag support to flutter tools (#162889)
Rather than ask users to pass the complicated and long string
`--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc`
we want a simpler flag to enable the new DDC module system/hot reload.

Technically this flag enables the new module system, not necessarily hot
reload directly. But we only expect people to use the flag to enable hot
reload so I've chosen the name based on that.

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-02-10 17:23:47 +00:00