7744 Commits

Author SHA1 Message Date
Ben Konyi
3d6b5994b8
[ Widget Preview ] Improve IDE integration support (#176114)
This change adds support for two DTD Editor service RPCs and makes
functionality that's dependent on the availability of the Editor service
reactive to the service availability changing.

The newly added `getActiveLocation` Editor RPC now allows for us to
properly determine which source file is selected at startup, removing
the need for special casing around initializing the filtered preview
set.

The `navigateToCode` Editor RPC is now supported, and URIs in stack
traces can now be clicked to navigate to the source location in the IDE.

Both filtering previews by selected file and stack frame navigation
links are only enabled when the Editor service is available.

Fixes https://github.com/flutter/flutter/issues/176113
2025-09-29 15:05:53 +00:00
Reid Baker
f4879f03ec
Add warn java evaluation to android_workflow (#176097)
Related to #176027

Needs to land after https://github.com/flutter/flutter/pull/176094
- **Add java warn and error to android workflow**

## 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-26 20:37:47 +00:00
Reid Baker
7ba7fffff3
Add kotlin/kgp 2.2.* evaluation criteria. (#176094)
This pr assumes https://github.com/flutter/flutter/pull/176049 lands
first.

- **Update java version ranges with the top end limitation for java pre
17**
- **change default for unknown agp version to true for java support**
- **Add kotlin 2.2* support for analyze --suggestions**
- 
Related to https://github.com/flutter/flutter/issues/175669 and
https://github.com/flutter/flutter/issues/176027

## 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-09-26 17:33:11 +00:00
Paul Berry
57b7c46d01
Ignore upcoming experimental_member_use warnings. (#175969)
In an upcoming Dart SDK change
(https://dart-review.googlesource.com/c/sdk/+/450970), I intend to add
logic to the analyzer for generating a warning if an API marked
`@experimental` is used. This will allow experimental analyzer features
to be developed without creating a risk of breaking changes downstream.

It looks like there are two existing uses of an experimental API in the
flutter codebase: the method `XmlDocument.xpath`. This is probably safe,
since Flutter pins its use of `package:xml` to an exact version. But to
avoid breaking buildbots when the new analyzer logic rolls out, we need
to keep Flutter warning-clean.

So this PR proactively adds `// ignore:` comments to suppress the
upcoming warnings.

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-25 13:48:42 +00:00
Reid Baker
c121890a58
Update AGP/Java/Gradle comparison when using analyze --suggestions (#175808)
Update the maxKnownAndSupported versions of Java (now 26), AGP (from
8.9.1 to 8.13), and Gradle (now 9.1).

Add tests for new codepaths and expand existing test coverage. Some
typos and changes to aid debugging included as well.

AGP 9 was made available for preview last week
https://developer.android.com/build/releases/agp-preview.

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


Commits: 
- **update max known and supported java, gradle and agp**
- **make tests in a loop and add testing for get java version for and
validate java and agp**
- **move some tests to gradle_utils, make debugging easier**
- **Migrated gradle_utils tests from gradle_test to gradle_utils_test**

---------

Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
2025-09-24 21:37:46 +00:00
Ben Konyi
b9ffd90bb7
[ Widget Preview ] Fix filter by file on Windows (#175783)
Windows file URIs reported by IDEs can be percent encoded. This change
decodes all URIs for `TextDocument` instances to ensure they're
consistent with the URIs provided by the tool.

Fixes https://github.com/flutter/flutter/issues/175524
2025-09-24 16:45:43 +00:00
Mohellebi abdessalem
8dd9ff1b59
Introduce a getter for Project to get gradle-wrapper.properties directly (#175485)
follow up to [this
comment](https://github.com/flutter/flutter/pull/174760#discussion_r2353508903)

## 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 updated/added relevant documentation (doc comments with `///`).
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-24 15:17:40 +00:00
Mohellebi abdessalem
6cd85a973a
Fix typo in tests README (#175788)
fix simple link to file
`../../..test/general.shard/android/gradle_utils_test.dart`

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-23 15:51:24 +00:00
Byoungchan Lee
dbeb08ad9d
Update maximum known Gradle version to 9.1.0 (#175543)
Gradle 9.1.0 was released on 2025-09-18.

## 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].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
2025-09-23 14:55:31 +00:00
Mohellebi abdessalem
d8c26193ef
Remove name field form SupportedPlatform enum (#175611)
so as it appears `SupportedPlatform` enum have a field `name` which
already exists in `enum` so it can be removed
example of usage in
`packages/flutter_tools/lib/src/project_validator.dart`:
```dart
  String _getSupportedPlatforms(FlutterProject project) {
    return project
        .getSupportedPlatforms()
        .map((SupportedPlatform platform) => platform.name)
        .join(', ');
  }
```

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-22 20:16:08 +00:00
Ben Konyi
610c06fae6
[ Widget Preview ] Allow for custom Preview annotations, add support for runtime transformations (#175535)
This change updates `Preview` to be a `base` class instead of `final`,
allowing for developers to extend `Preview` and create their own custom
preview annotations.

To reduce friction associated with working with `const` constructors,
two new methods have been added: `MultiPreview.transform()` and
`Preview.transform()`. These methods are invoked at runtime by the
preview environment, allowing for developers to create or modify
`Preview` instances with non-constant values. This also relaxes
restrictions around `Preview`'s callback parameters (e.g., `wrapper`),
which do not need to be static or public when provided to a `Preview` in
the context of a `*.transform()` method. This makes it possible to
create custom preview classes that completely encapsulate their
callbacks, removing the need for separate public, static function
declarations.

To make transforming `Preview`s simpler, a `PreviewBuilder` utility
class has also been added.

Fixes https://github.com/flutter/flutter/issues/175534
2025-09-22 20:10:48 +00:00
Ben Konyi
643c2e9410
[ Tool ] Serve DevTools from DDS, remove ResidentDevToolsHandler (#174580)
This PR contains the initial work to prepare for the removal of
instances of DevTools being served manually by the flutter_tool, instead
relying on DDS to serve DevTools. This will be consistent with how the
standalone Dart VM serves DevTools, tying the DevTools lifecycle to a
live DDS instance. This will allow for the removal of much of the logic
needed to properly manage the lifecycle of the DevTools server in a
future PR. Also, by serving DevTools from DDS, users will no longer need
to forward a secondary port in remote workflows as DevTools will be
available on the DDS port.

There's two remaining circumstances that will prevent us from removing
`DevtoolsRunner` completely:

  - The daemon's `devtools.serve` endpoint
- `flutter drive`'s `--profile-memory` flag used for recording memory
profiles
2025-09-18 20:04:10 +00:00
Victoria Ashworth
09387f2b8b
Filter out unexpected process logs on iOS with better regex matching. (#175452)
This PR modifies the pattern matching on what logs to ignore from
`devicectl`. Basically any log that starts with a timestamp/process
prefix should be ignored unless it has the Flutter engine FML syntax or
is prefixed with `flutter:`. See comment in code for examples.

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

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-17 21:06:03 +00:00
Mohellebi abdessalem
8f94cb0d8f
fix typo in comments to mention settings.gradle/.kts instead of build.gradle/.kts (#175486)
fix typo above function that have mentions `build.gradle/.kts` while the
function returns `settings.gradle/.kts` file

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

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-17 15:00:23 +00:00
Mohellebi abdessalem
a9c3aa12c2
Update gradle_errors.dart to use constants defined in gradle_utils.dart (#174760)
updates `packages/flutter_tools/lib/src/android/gradle_errors.dart` to
use constants defined in
`flutter\packages\flutter_tools\lib\src\android\gradle_utils.dart`
so that :
`gradleDirectoryName` replaces `gradle`
`gradleWrapperDirectoryName` replaces `wrapper`
`gradleWrapperPropertiesFilename` replaces `gradle-wrapper.properties`

## Pre-launch Checklist

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-16 21:40:19 +00:00
Mohellebi abdessalem
637cd0ab9c
Update gradle_utils.dart to use constant instead of final (#175443)
## 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.
- [ ] 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].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-16 21:23:52 +00:00
Gregory Conrad
bbb2362a47
[native_assets] Find more CCompilerConfig on Linux (#175323)
Sometimes the necessary binaries `code_assets` expects alongside
`clang++` have differing names than the current code expects (e.g., `ld`
instead of `ld.lld`) on Linux. This change is necessary on some systems
with atypical installs, such as NixOS.

These binaries are gathered by the flutter tool and are eventually sent
to the build hook for native code assets as the `CCompilerConfig`.

Note that the only other reference to `clang`/`clang++` in the linux
build system is where it is used to invoke `cmake`, where they are set
as the values of the `CC`/`CXX` environment variables.

Fixes #175311

CC @dcharkes, this is take two of #175312

> This PR also fixes my CI using only the `llvmPackages_20.clangUseLLVM`
Nix package, for reference

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-16 08:18:41 +00:00
Elijah Okoroh
1eab8e1d13
Deprecate Objective-C plugin template (#174003)
This PR marks the `--ios-language objc` flag as deprecated for plugin
creation. It introduces a warning message in the `flutter create` tool
when the flag is used, but **does not** remove the functionality at this
time. This is the first step towards its eventual removal.

## Context

As discussed in the issue, usage metrics show that Objective-C is used
in less than 4% of newly created plugins. To streamline the tool and
align with modern iOS development practices (i.e., Swift), we are
beginning the process of phasing out this option

**Changes:**
-   Adds a deprecation warning to the CLI when the `objc` flag is used.
-   Updates the `--help` text to reflect the deprecation.
- Removes obsolete tests for Objective-C plugin creation and usage
tracking.

## Testing

I have validated these changes by:

1. Manually running `flutter-dev create` with the `objc` flag to confirm
the new deprecation warning appears.
2. Verifying that creating a plugin without the --ios-language flag does
**not** trigger the warning.
3. Running the tests in the `test/commands.shard` to ensure no
regressions were introduced.
4.  CI will validate the changes to the devicelab tests.

Fixes #169683 

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-15 22:13:52 +00:00
Daniil
41e3968ad0
Remove 'v' Open DevTools from help on web in profile/release mode (#172829)
This change:
- Hides `v` from the help menu on web in profile/release mode
- Keeps `v` available in debug and on native platforms
- Change command order: `v` now appears before `s` in help
- Updates `_commonTerminalInputHandler` to block `v` on web in release
mode

Testing:
- Added new test: `printHelpDetails hides v on web in profile mode`
- Added new test: 'v - does not launchDevToolsInBrowser on web in
profile mode'
- Fixed existing test to match correct command order (`v` before `s`)

fixes #143451

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Daniil Lipatkin <nt4f04uNd@gmail.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-09-15 17:40:03 +00:00
Lau Ching Jun
1586c0c318
Fix crash when attaching to a device with multiple active flutter apps (#175147)
`vmServiceUri` is a stream, and might emit multiple values. But
`discoveryStatus.stop()` can only be called once.
2025-09-12 20:44:36 +00:00
Ben Konyi
e4b7bdbe22
[ Widget Preview ] Improve --machine output (#175003)
This change adds the following events:

- `widget_preview.initializing`: sent immediately after the widget
previewer starts. This event includes the PID of the process starting
the widget previewer for use by tooling to explicitly kill the tool
process.
- `widget_preview.logMessage`: sent for calls to `Logger` methods when
in machine mode. This follows the same format as `daemon.logMessage`.

This change also fixes and improves testing of
`WidgetPreviewMachineAwareLogger` in `widget_preview_machine_test.dart`
as the existing test validator did not cause tests to fail correctly.

Fixes https://github.com/flutter/flutter/issues/175002
2025-09-08 12:37:39 +00:00
Mouad Debbar
cc0b0471b9
[web] Reuse chrome instance to run all flutter tests (#174957)
Web test shards take a significant time to run in CI compared to their
VM counterparts. One theory is that launching and shutting down Chrome
repeatedly is a major part of the slowness.

This PR makes `flutter test --platform=chrome` reuse the same Chrome
instance for all test files instead of launching a new one for each test
file.

At first glance, it may seem like we aren't shutting down Chrome
anymore, but we actually do in `closeEphemeral` and `close` methods.

Thanks @eyebrowsoffire for the idea!
2025-09-04 21:27:24 +00:00
Victoria Ashworth
8a5c6df06f
Make every LLDB Init error message actionable (#174726)
Fixes https://github.com/flutter/flutter/issues/172170.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-09-04 20:26:29 +00:00
Ben Konyi
2965567997
[ Widget Preview] Add group property to Preview (#174849)
This change adds support for creating groups of widget previews.
Previews with the same `group` parameter will be grouped together in a
collapsable tile in widget previewer. Previews without a provided
`group` will be placed in the `Default` group.

This change also slightly reworks the UI to make individual previews
more easily distinguishable from preview groups, moves the controls for
the previewer to the bottom of the preview window, and adds a divider
between the preview name and preview content if a name is provided.

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

**Example:**

<img width="767" height="640" alt="image"
src="https://github.com/user-attachments/assets/80dc202c-77d3-42a5-be9d-e0d9a9a0f28b"
/>
2025-09-04 18:51:19 +00:00
Ben Konyi
48b053aadb
[ Tool ] Remove leftover Android x86 deprecation warning constant (#174941)
Android x86 support has already been removed.

Found during a post merge investigation of
https://github.com/flutter/flutter/issues/157543
2025-09-04 18:15:18 +00:00
Moritz
661b8edef2
Add data assets (#174685)
Refiling of #169273 (reverted in
https://github.com/flutter/flutter/pull/170034), which is a refiling of
#164094, which itself is a rebase of #159675.

This PR adds bundling support for the experimental dart data asset
feature: Dart packages with hooks can now emit data assets which the
flutter tool will bundle.

It relies on flutter's existing asset bundling mechanism (e.g. entries
in AssetManifest.json, DevFS syncing in reload/restart, ...).

The support is added under an experimental flag (similar to the existing
native assets experimental flag).

Also, kNativeAssets is removed to also bundle data assets on flutter
build bundle.

The chrome sandbox is disabled as per #165664.

## 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-09-02 23:00:30 +00:00
Ben Konyi
33edd49421
[ Tool ] Remove support for experimental --fast-start feature (#173576)
This feature never worked correctly and has been disabled by default for
years.

Fixes https://github.com/flutter/flutter/issues/49499
2025-09-02 19:50:01 +00:00
Ben Konyi
1d19f97833
[ Widget Preview ] Respond to IDE navigation events and show previews from the currently focused script (#174466)
This change allows for the widget previewer to react to
`activeLocationChanged` events sent over the `Editor` DTD service to
automatically filter the set of visible previews based on the currently
selected file in the IDE. This functionality can be turned on or off
depending on whether or not the developer wants to see all previews in
the project at once.

This change also includes some minor refactoring and UI changes to move
the widget preview environment controls to a reserved area at the bottom
of the preview window.

**Demo:**


https://github.com/user-attachments/assets/c3b93826-8437-4655-8264-6beed6651fe7
2025-09-02 16:49:11 +00:00
Victoria Ashworth
b039be55b3
Remove build configuration mismatch warning (#174715)
A build configuration mismatch warning was introduced in
https://github.com/flutter/flutter/pull/169395 to help handle
dev_dependencies relying on the build configuration. However, we
disabled dev_dependencies from being excluded per configuration in
https://github.com/flutter/flutter/pull/171015. This warning therefore
can also be removed.

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

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-08-29 18:55:08 +00:00
Ben Konyi
89ba8a06a5
[ Tool ] Only listen for DebugConnectionInfo if the service protocol is supported (#174664)
Fixes https://github.com/flutter/flutter/issues/174330
2025-08-29 01:05:21 +00:00
Mouad Debbar
2edf7786fc
Don't fail when hot restarting web-server and there are no connected clients (#174600)
Fixes https://github.com/flutter/flutter/issues/173971
2025-08-28 19:47:03 +00:00
Dev TtangKong
f604188a45
Retry "Implements the Android native stretch effect as a fragment shader (Impeller-only)." (#173885)
This PR retries the previously reverted PR #169293.

> [!NOTE]
> This feature was originally intended to be Impeller-only, and it was
agreed that no additional engine changes were necessary. However, during
testing on the Metal backend, a shader loading issue occurred. In my
view, this seems to be a simple problem caused by the shader not being
included in the engine’s runtime_stages.

## 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: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Kate Lovett <katelovett@google.com>
2025-08-27 22:17:05 +00:00
Daco Harkes
da5523afc3
[native assets] Roll dependencies (#174522)
Rolls the dependencies to the once published today.

Covered by existing integration tests.
2025-08-27 17:23:11 +00:00
Matan Lurey
6f26959d4e
Fix bug in test_golden_comparator, add an e2e test. (#174459)
Closes https://github.com/flutter/flutter/issues/174267.

The actual fix is 1-line, but of course there is no test suite to verify
that, so that took the bulk of the time.
2025-08-26 23:00:25 +00:00
Victoria Ashworth
f9382a463a
Revert "Directly generate a Mach-O dynamic library using gen_snapshot (#171626) (#174392)
This reverts commit 0c0148b00eedd3467ea6522d5c39acc679a065c9.

Fix for https://github.com/flutter/flutter/issues/174393.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-08-26 14:55:26 +00:00
Victoria Ashworth
91c2300a78
Stream logs from devicectl and lldb (#173724)
When debugging with `devicectl` and `lldb` (exclusive to Xcode 26+),
stream logs from both processes instead of using `idevicesyslog`, which
does not work with Xcode 26.

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

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-08-25 19:09:21 +00:00
Ben Konyi
699f21a4fe
[ Tool ] Don't emit artifact downloading messages when --machine is provided (#174301)
Fixes https://github.com/flutter/flutter/issues/154119
2025-08-22 20:08:27 +00:00
Ben Konyi
35eb77f9a1
[ Widget Preview ] Add support for DevTools configuration (#174272)
Adds support for the `--devtools-server-address=<uri>` and `--devtools`
options.

Also fixes an issue where the VM service + DevTools connection
information was not printed to STDOUT for web devices.

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

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-22 17:27:51 +00:00
Ben Konyi
bdea526c66
[ Tool ] Ensure --dds-port=<port> is respected when targeting web devices (#174278)
Fixes https://github.com/flutter/flutter/issues/159157
2025-08-22 17:09:40 +00:00
Nate Biggs
2b82bc985b
Skip wasm build when dry run is disabled and --wasm is not specified. (#174184)
This fixes an issue where the wasm build was still getting executed when
`--no-wasm-dry-run` was specified.

Also adds a test to verify the expected behavior.

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-08-22 07:00:40 +00:00
Elijah Okoroh
45f8c327a5
Improve xcresult comment and naming (#173129)
The function `_parseIssuesFromNewFormat` is renamed to
`_parseIssuesFromXcode16Format`. The term "new" is relative and would
become obsolete on the next format change, forcing a rename. The new
name is specific and stable.


Fixes #172596 

*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 `///`).
- [] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Jenn Magder <magder@google.com>
2025-08-21 22:30:07 +00:00
Ben Konyi
c3265413d5
[ Widget Preview ] Fix crash when attempting to provide non-const params to a Preview (#174242)
Instead of crashing, invalid previews should just be ignored.

Fixes https://github.com/flutter/flutter/issues/173710
2025-08-21 22:13:14 +00:00
Ben Konyi
d88140fe5e
[ Tool ] Throw ToolExit when asset entries use absolute paths (#174230)
Our documentation states that "the value of an asset is a relative path
from the pubspec.yaml file", but this was never actually verified by the
tool. On systems with POSIX semantics, this would simply result in
invalid asset paths being built, but on Windows this could cause an
exception to be thrown as the built URI would not be a valid `file://`
URI.

This change adds checks to ensure that asset paths are relative and that
they are valid file paths.

Fixes https://github.com/flutter/flutter/issues/173405
2025-08-21 22:05:44 +00:00
Ben Konyi
19498462c7
[ Tool ] Cleanup widget preview and frontend server shutdown (#173863)
Prevents the frontend server from throwing ToolExit with the "The Dart
compiler exited unexpectedly." on shutdown via a signal.
2025-08-21 21:06:08 +00:00
Matan Lurey
e45fd36aac
Use an alternative to git describe for master version resolution (#174088)
Closes https://github.com/flutter/flutter/issues/173904.

It's not clear to me how `git describe --tags HEAD` ever ... worked to
determine a fallback. From what I can tell, the _intent_ was to use the
latest (newest? closest?) tag as the base version, and then append
`-{commitCount}-{shortHash}` as the fallback version number when on
`master` (or any non-published branch).

So, I rewrote the implementation, unfortunately with 4 separate calls
out to `git ...` instead of a single one.

There are 20+ tests that fail as a result of this change, mostly because
they make specific expectations around `git describe` being invoked, and
of course that is no longer the case - putting those aside, I'd like to
double check that:

1. I understand what the original command was _intending_ to do
2. We like the _output_ of the updated command
3. ... we either are okay with the implementation, or have an
alternative in mind (I'm no `git` master)

Wdyt?

At this commit:
```sh
$ flutter-dev --version                                                            
Flutter 3.36.0-1.0.pre-170 • channel [user-branch] • https://github.com/matanlurey/flutter
Framework • revision 250381a185 (5 minutes ago) • 2025-08-19 18:57:36 -0700
Engine • hash f278b0aa3b8c6732ab636563eb8e896c35fc9c79 (revision 9ac4facf7e) (2 hours ago) • 2025-08-19 23:42:28.000Z
Tools • Dart 3.10.0 (build 3.10.0-115.0.dev) • DevTools 2.49.0
```

/cc @zanderso @jmagman for historics.
2025-08-21 20:04:32 +00:00
Tess Strickland
0c0148b00e
Directly generate a Mach-O dynamic library using gen_snapshot. (#171626)
Instead of generating assembly code that is then compiled to a Mach-O
dynamic library, use the new app-aot-macho-dylib output option for
gen_snapshot to generate the Mach-O dynamic library without the assembly
step.

Related issues:

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

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
2025-08-21 15:05:55 +00:00
Ben Konyi
796fb74325
[ Widget Preview ] Report an error if a web device is unavailable (#174036)
Fixes https://github.com/flutter/flutter/issues/173960

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-19 21:57:25 +00:00
Simon Pham
25094b9961
fix: Android build fails when minSdk is set below 24 in build.gradle.kts (#173823) (#173825)
fix: Android build fails when minSdk is set below 24 in build.gradle.kts
(#173823, #173829)

<!--
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 separates the regex for determining minSdkVersion in groovy or
kotlin gradle file when doing Android minSdkVersion migration.

Fixes #173823.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Reid Baker <1063596+reidbaker@users.noreply.github.com>
2025-08-19 17:36:11 +00:00
Ben Konyi
02bf6d36c3
[ Widget Preview ] Don't crash when directory watcher restarts on Windows (#173987)
Fixes https://github.com/flutter/flutter/issues/173895

This is a top-10 crasher for `3.35.{0,1}`.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-18 20:07:26 +00:00
Ben Konyi
8b2b9d7c8d
[ Widget Preview ] Don't try to instantiate invalid @Preview() applications (#173984)
Applying `@Preview()` to an invalid AST node shouldn't cause the preview
environment to throw an exception due to invalid generated code.

This change adds some additional checks to ensure that invalid
`@Preview()` applications are ignored.

Related issue: https://github.com/flutter/flutter/issues/173959
Related stable hotfix: https://github.com/flutter/flutter/pull/173979
2025-08-18 19:49:29 +00:00