Commit Graph

1893 Commits

Author SHA1 Message Date
auto-submit[bot]
4372bfbc6c
Reverts "Add workspace (#169451)" (#169468)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169451
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke a number of post-submit tests
(ios_app_extension, packages_autoroller).
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: mosuem
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
Reland after #169357.

Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

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

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

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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-26 14:07:27 +00:00
Moritz
3a0897a336
Add workspace (#169451)
Reland after #169357.

Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## 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-05-26 12:46:53 +00:00
auto-submit[bot]
e0c42c6e38
Reverts "Use pub workspace (#168662)" (#169357)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#168662
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Broke integration tests that do not run on
presubmit:

-
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20macos_chrome_dev_mode/8715/overview
-
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20linux_chrome_dev_mode/7617/overview
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: mosuem
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## Pre-launch Checklist

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

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

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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-23 16:00:19 +00:00
Moritz
9a1dc1bd96
Use pub workspace (#168662)
Switch Flutter to use pub workspaces as a preparation to unpin selected
packages.

Assumptions:

1. No packages in this repository are published to pub.dev --> We can
use `any` dependencies in most local pubspecs, as the global constraint
defines the version. An exception are the packages used outside of this
repo with an `sdk` dependency, namely `flutter_localizations`,
`flutter_test`, and `flutter`.
2. The "universes" `{flutter_tools}` and `{flutter,
flutter_localizations, flutter_goldens}` can use different packages
versions, as they are not resolved together. --> We do not need to
upgrade them in sync, we can first do one "universe", then the other.

Based on these assumptions, we use
https://github.com/mosuem/pubspec_merger.dart to merge all packages in
the `flutter` universe into a top-level pub workspace.

The `flutter` and `flutter_tools` workspaces being separate also ensures
that changes to `flutter` will not inadvertently break `flutter_tools`,
with not-so-nice consequences for our users which would be unable to run
`flutter upgrade`.

There is a third "top-level" pubspec besides `./pubspec.yaml` and
`packages/flutter_tools/pubspec.yaml`, namely
`packages/flutter_tools/.../widget_preview_scaffold/pubspec.yaml`. This
is an artifact due to it living under `flutter_tools`, so it can't be
part of the `./pubspec.yaml` workspace. Moving it would be a larger
change, and out of the scope of this PR.

This required a rewrite of the update-packages tool, but the main
functionality stays the same, as well as the argument names, to ensure a
seamless transition.

## 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-05-23 15:01:19 +00:00
auto-submit[bot]
85564cbba9
Reverts "[Reland2] Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#169276)" (#169347)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169276
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: vashworth
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Causing google testing failures
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: gaaclarke
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
## **BREAKING CHANGE**

Adopting Apple's UISceneDelegate protocol shifts the initialization
order of apps. For the common cases we've made sure they will work
without change. The one case that will require a change is any app that
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]` assumes that
`UIApplicationDelegate.window.rootViewController` is a
`FlutterViewController` instance. This is sometimes done to register
platform channels directly on the `FlutterViewController`. Instead users
should use the `FlutterPluginRegistry` API's to create platform channels
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]`, like
`FlutterPlugin`s do.

An example can be seen here:

https://github.com/flutter/flutter/pull/168914/files#diff-9f59c5248b58124beca7e290a57646023cda3ca024607092c6c6932606ce16ee

In extreme cases, like bespoke test harnesses, the startup logic can be
moved to `-[FlutterViewController awakeFromNib]` in a
FlutterViewController subclass.

An example can be seen here:

https://github.com/flutter/flutter/pull/169276/files#diff-dbe39c23a0a380447b90b7559a878dae8564616e0875c4ef0d9e99e02b91adac

## Changes since revert
I changed the init in `//dev/integration_tests/external_textures` from
the UIApplicationDelegate to the FlutterViewController's awakeFromNib.
This is a more appropriate place for initialization post-UISceneDelegate
since it avoids the launch engine altogether. I tried avoiding to make
the big change to prove we could do a small change to migrate that
project. I don't think this big refactor is indicative of what users
will experience. There was a timing assumption in the integration test
that required not using the launch engine at all.

## Description
fixes: https://github.com/flutter/flutter/issues/167267

design doc:


https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0

relands https://github.com/flutter/flutter/pull/168396
relands https://github.com/flutter/flutter/pull/168914

## Pre-launch Checklist

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

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-23 14:59:47 +00:00
gaaclarke
4226470eb6
[Reland2] Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#169276)
## **BREAKING CHANGE**

Adopting Apple's UISceneDelegate protocol shifts the initialization
order of apps. For the common cases we've made sure they will work
without change. The one case that will require a change is any app that
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]` assumes that
`UIApplicationDelegate.window.rootViewController` is a
`FlutterViewController` instance. This is sometimes done to register
platform channels directly on the `FlutterViewController`. Instead users
should use the `FlutterPluginRegistry` API's to create platform channels
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]`, like
`FlutterPlugin`s do.

An example can be seen here:

https://github.com/flutter/flutter/pull/168914/files#diff-9f59c5248b58124beca7e290a57646023cda3ca024607092c6c6932606ce16ee

In extreme cases, like bespoke test harnesses, the startup logic can be
moved to `-[FlutterViewController awakeFromNib]` in a
FlutterViewController subclass.

An example can be seen here:

https://github.com/flutter/flutter/pull/169276/files#diff-dbe39c23a0a380447b90b7559a878dae8564616e0875c4ef0d9e99e02b91adac

## Changes since revert
I changed the init in `//dev/integration_tests/external_textures` from
the UIApplicationDelegate to the FlutterViewController's awakeFromNib.
This is a more appropriate place for initialization post-UISceneDelegate
since it avoids the launch engine altogether. I tried avoiding to make
the big change to prove we could do a small change to migrate that
project. I don't think this big refactor is indicative of what users
will experience. There was a timing assumption in the integration test
that required not using the launch engine at all.

## Description
fixes: https://github.com/flutter/flutter/issues/167267

design doc:


https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0

relands https://github.com/flutter/flutter/pull/168396
relands https://github.com/flutter/flutter/pull/168914

## 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-05-23 00:44:55 +00:00
Felipe Morschel
c15a2c6c47
Removes unnecessary parentheses (#169015)
This is solely a change to allow the CL for
https://github.com/dart-lang/sdk/issues/59069 to land.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [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.
2025-05-23 00:02:01 +00:00
Danny Tuppeny
c8d620e665
Unpin test/test_core/test_api packages (#169198)
These packages were recently pinned (in
https://github.com/flutter/flutter/pull/168916) due to a bug
(https://github.com/dart-lang/test/issues/2498).

That bug was fixed and new versions of the test packages published. This
change unpins and lets them upgrade to the fixed version.
2025-05-22 23:15:08 +00:00
auto-submit[bot]
5fd7aa2ed7
Reverts "Make build_android_host_app_with_module_aar build using an aar (#169171)" (#169287)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#169171
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gmackall
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: this is failing on presubmits of prs that make
engine changes, presumably due to some missing gradle configuration to
handle that special case in resolving the engine binaries.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: gmackall
<!-- end_original_pr_author -->

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

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

`build_android_host_app_with_module_aar` was unfortunately not depending
on the module as an aar, but as source (something we have a different
test for, and something that you would not expect given the name of the
test 🤦 )

## Pre-launch Checklist

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

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

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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-22 17:26:26 +00:00
auto-submit[bot]
88d184dada
Reverts "[Reland] Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396) (#168914)" (#169250)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#168914
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gaaclarke
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting:
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20external_ui_integration_test_ios/16792/overview

The external texture integration test is failing. Running the host app
appeared to work but one of the driver asserts isn't working.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: gaaclarke
<!-- end_original_pr_author -->

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

<!-- start_revert_body -->
This change reverts the following previous change:
## **BREAKING CHANGE**

Adopting Apple's UISceneDelegate protocol shifts the initialization
order of apps. For the common cases we've made sure they will work
without change. The one case that will require a change is any app that
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]` assumes that
`UIApplicationDelegate.window.rootViewController` is a
`FlutterViewController` instance. This is sometimes done to register
platform channels directly on the `FlutterViewController`. Instead users
should use the `FlutterPluginRegistry` API's to create platform channels
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]`, like
`FlutterPlugin`s do.

An example can be seen here:
https://github.com/flutter/flutter/pull/168914/files#diff-9f59c5248b58124beca7e290a57646023cda3ca024607092c6c6932606ce16ee

## Changes since revert
Device lab tests have been migrated to using the FlutterPlugin API for
creating platform channels at process launch.

## Description
fixes: https://github.com/flutter/flutter/issues/167267

design doc:

https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0

relands https://github.com/flutter/flutter/pull/168396

## Pre-launch Checklist

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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-05-22 03:32:21 +00:00
gaaclarke
6d14eb2129
[Reland] Implements UISceneDelegate dynamically w/ FlutterLaunchEngine (#168396) (#168914)
## **BREAKING CHANGE**

Adopting Apple's UISceneDelegate protocol shifts the initialization
order of apps. For the common cases we've made sure they will work
without change. The one case that will require a change is any app that
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]` assumes that
`UIApplicationDelegate.window.rootViewController` is a
`FlutterViewController` instance. This is sometimes done to register
platform channels directly on the `FlutterViewController`. Instead users
should use the `FlutterPluginRegistry` API's to create platform channels
in `-[UIApplicateDelegate didFinishLaunchingWithOptions:]`, like
`FlutterPlugin`s do.

An example can be seen here:
https://github.com/flutter/flutter/pull/168914/files#diff-9f59c5248b58124beca7e290a57646023cda3ca024607092c6c6932606ce16ee

## Changes since revert
Device lab tests have been migrated to using the FlutterPlugin API for
creating platform channels at process launch.

## Description
fixes: https://github.com/flutter/flutter/issues/167267

design doc:

https://docs.google.com/document/d/1ZfcQOs-UKRa9jsFG84-MTFeibZTLKCvPQLxF2eskx44/edit?tab=t.0

relands https://github.com/flutter/flutter/pull/168396

## 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-05-21 22:01:28 +00:00
Gray Mackall
f9795d6f2d
Make build_android_host_app_with_module_aar build using an aar (#169171)
Fixes https://github.com/flutter/flutter/issues/169165.

`build_android_host_app_with_module_aar` was unfortunately not depending
on the module as an aar, but as source (something we have a different
test for, and something that you would not expect given the name of the
test 🤦 )

## Pre-launch Checklist

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

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

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

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2025-05-21 20:56:07 +00:00
flutter-pub-roller-bot
cf1004028c
Roll pub packages (#169181)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-05-21 03:22:27 +00:00
Daco Harkes
899d6e9df6
[native assets] Roll dependencies (#169073)
Roll deps to the ones released today.
2025-05-20 20:14:16 +00:00
Loïc Sharma
4b1d2644cb
Fix keyboard_hot_restart_ios flakes (#168518)
The keyboard hot restart test does these steps:

1. It launches an app that forces the keyboard to be visible
2. It checks that the keyboard is visible by examining the app's logs
3. It updates the app to no longer force the keyboard to be visible and
hot restarts the app
4. It checks that the keyboard is no longer visible by examining the
app's logs

Previously, the test app printed the keyboard status whenever the app
rebuilt. The test would move on as soon as it saw a log that indicates
the keyboard was in the expected state. However, since the app could log
the keyboard's visibility _before_ the Dart VM was available, hot
restart commands could be ignored (or at least, that's my theory from
the DeviceLab logs).

Now, the test app prints the keyboard status non-stop. The test now
waits until the Dart VM is available before checking if the logs
indicate the keyboard is open. Also, the test now waits until the hot
restart has completed before checking if the keyboard is closed. In
theory, this should ensure that hot restart does not happen until after
the Dart VM is available.

Follow-up to: https://github.com/flutter/flutter/pull/167013
Part of: https://github.com/flutter/flutter/issues/10713

## 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-05-19 19:05:09 +00:00
Huy
494b08b420
Normalize BottomAppBarTheme (#168586)
This PR is to make `BottomAppBarTheme` conform to Flutter Material's
conventions for component themes:

- Added a `BottomAppBarThemeData` class which defines overrides for the
defaults for `BottomAppBar` properties.
- Added `BottomAppBarTheme` constructor parameters:
`BottomAppBarThemeData? data` and `Widget? child`. This is now the
preferred way to configure a `BottomAppBarTheme`:

```dart
BottomAppBarTheme(
	data: BottomAppBarThemeData(
	    color: xxx,
	    height: xxx,
	    elevation: xxx,
	    shape: xxx,
	    ...
	  ),
  	child: const BottomAppBar()
)
```
These two properties are made nullable to not break existing apps which
has customized `ThemeData.bottomAppBarTheme`.

- Update `BottomAppBarTheme` to be an `InheritedWidget` subclass.
- Changed the type of component theme defaults from `BottomAppBarTheme`
to `BottomAppBarThemeData`.
- Changed the `BottomAppBarTheme bottomAppBarTheme` property to
`BottomAppBarThemeData bottomAppBarTheme` in `ThemeData` and
`ThemeData.copyWith()`. This may cause breaking changes, a migration
guide will be created on website repo.
- Add new tests for `BottomAppBarThemeData` and update the existing
`BottomAppBarTheme` tests. And also turn to `true` for `useMaterial3`
(along with usages accordingly) at the common method `_withTheme()`
since `useMaterial3` is true by default.
- Addresses the "theme normalization" sub-project within #91772.

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

---------

Signed-off-by: huycozy <huy@nevercode.io>
2025-05-14 17:38:18 +00:00
Gray Mackall
88ce9564c3
Error when trying to use old HC mode when HCPP is enabled (#168027)
Fixes https://github.com/flutter/flutter/issues/164218.

## 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-05-12 18:53:16 +00:00
ash2moon
0145fafb9a
add missing lockfiles not checked in from running generate_gradle_lockfiles.dart (#168600)
<!--
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
-->

These are generated files from using generate_gradle_lockfiles.dart
--no-gradle-generation

They require no unit tests but a follow up PR will address adding a CI
that tests if there are any lockfiles that need to be added.

Partially addresses #163228

## 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-05-09 19:46:52 +00:00
flutter-pub-roller-bot
35bd0b1393
Roll pub packages (#168509)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-05-08 00:50:25 +00:00
Daco Harkes
48f87a5fe7
[native assets] Roll dependencies (#168139)
Roll packages to the ones published today.

Note that `native_assets_cli` was split up into `hooks` and
`code_assets`, and `native_assets_builder` was renamed to
`hooks_runner`.
2025-05-02 08:19:21 +00:00
Victor Sanni
96d1b99211
Condense nav bar large title in landscape mode (#166956)
## Rotation demo



https://github.com/user-attachments/assets/b59d6875-dff7-4b40-9525-565dfd8a2554



### Portrait mode .automatic



https://github.com/user-attachments/assets/88f4f3a2-0f13-4c92-b601-20c20e13f7dc



### Landscape mode .automatic



https://github.com/user-attachments/assets/dd5e2373-82e3-41fc-8e83-4002ce5e848e



### Portrait mode .always



https://github.com/user-attachments/assets/623d131a-f71b-430d-b84c-0b4519919f56



### Landscape mode .always



https://github.com/user-attachments/assets/5980e8fe-a981-482d-9f77-97f9ab7495c7



Fixes [CupertinoSliverNavigationBar doesn't become compact in landscape
mode](https://github.com/flutter/flutter/issues/39254)

<details>
<summary>Sample code</summary>

```dart

import 'package:flutter/cupertino.dart';

void main() => runApp(const NavBarBlueApp());

class NavBarBlueApp extends StatelessWidget {
  const NavBarBlueApp({super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      theme: CupertinoThemeData(),
      home: MainPage(),
    );
  }
}

class MainPage extends StatelessWidget {
  const MainPage({super.key});

  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      child: SafeArea(
        child: CustomScrollView(
          slivers: [
            CupertinoSliverNavigationBar.search(
              stretch: true,
              searchField: CupertinoSearchTextField(
                  suffixMode: OverlayVisibilityMode.always,
                  suffixIcon: Icon(
                    CupertinoIcons.mic_solid,
                  )),
              largeTitle: Text('Lists'),
              bottomMode: NavigationBarBottomMode.always,
            ),
            SliverList(
              delegate: SliverChildBuilderDelegate(
                (BuildContext context, int index) {
                  return CupertinoListTile(
                    title: Text('Entry $index'),
                  );
                },
                childCount: 20,
              ),
            ),
          ],
        ),
      ),
    );
  }
}


```

</details>
2025-05-01 04:42:56 +00:00
flutter-pub-roller-bot
651ff0a8f2
Roll pub packages (#168119)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-05-01 04:42:56 +00:00
Chris Bracken
4c5d0de983
macOS: Update minimum macOS version to 10.15 (#168101)
This updates the Flutter minimum macOS version from 10.14 to 10.15 adds
a migrator for existing apps, and updates our own examples, tests, and
benchmark apps to 10.15. A follow-up patch will drop macOS 10.15
`@available` checks in the embedder.

This is required in order to use Swift in the embedder and not need to
bundle the Swift runtime libs in every app that uses Flutter. Swift
stable ABI was introduced in macOS 10.14.4.

As of March 2025, usage of macOS 10.14 is approximately 1.2~1.8%
depending on source of statistics, see example public usage data here:
https://gs.statcounter.com/macos-version-market-share/desktop/worldwide

This patch makes the following changes:
1. Updates mac_deployment_target from 12.0 to 13.0.
2. Changes templates to `MACOSX_DEPLOYMENT_TARGET`, `MinimumOSVersion`,
and Podfile `platform :osx` to 10.15.
3. Adds migrator for Podfile part to migrate `platform :osx, '10.14'` ->
`platform :osx, '10.15'`
4. Compiles with `-mmacosx-version-min=10.15`
5. Runs the migrator on all example apps and integration tests.
6. Updates examples, tests to macOS 10.15 deployment target

Issue: https://github.com/flutter/flutter/issues/167745

## 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-05-01 04:02:25 +00:00
Daco Harkes
04616f8dde
[native assets] Roll dependencies (#167984)
Roll forward dependencies to the ones published today.
2025-04-29 13:29:16 +00:00
Gray Mackall
ce51065f81
[HCPP] Add filltype support for clipPath mutator (#167571)
Fixes https://github.com/flutter/flutter/issues/164808.

Also overhauls the test app so that we can apply clippers independently
of each other.

Looks like (with a weirdly small box)

<img
src="https://github.com/user-attachments/assets/b290ea2e-79b8-46cd-93c2-5fe6024ba5d2"
width="200" />

## 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-24 20:16:04 +00:00
Chris Bracken
09d4dabd6d
iOS: Update minimum iOS version to 13.0 (#167737)
This updates the Flutter minimum iOS version from 12.0 to 13.0, adds a
migrator for existing apps, and updates our own examples, tests, and
benchmark apps to 13.0. A follow-up patch will drop iOS 13 `@available`
checks in the embedder.

This is required in order to use Swift in the embedder and not need to
bundle the Swift runtime libs in every app that uses Flutter. Swift
stable ABI

As of March 2025, usage of iOS is well below 1%, see example public
usage data here:
https://telemetrydeck.com/survey/apple/iOS/majorSystemVersions/

This patch makes the following changes:
1. Updates ios_deployment_target from 12.0 to 13.0.
2. Changes templates to `IPHONEOS_DEPLOYMENT_TARGET`,
`MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
3. Adds migrator for Podfile part to migrate `platform :ios, '11.0'` ->
`platform :ios, '12.0'`
4. Compiles with `-miphoneos-version-min=12.0`
5. Runs the migrator on all example apps and integration tests.
6. Updates examples, tests to iOS 13 deployment target

It also updates `verify_exported.dart`:
* iOS 13 introduces stricter separation of const and non-const global
symbols. Previously, these were declared in the Mach-O `__DATA` section
which may be mapped read-write, but now they're in a dedicated
`__DATA_CONST` section which is mapped read-only. This adds
`(__DATA_CONST,__const)` to the allowlist with the same enforcement on
exported symbol naming as before.

See also (ios_deployment_target):
* https://github.com/flutter/buildroot/pull/808
* https://github.com/flutter/buildroot/pull/574

See also (template, migrator):
* https://github.com/flutter/flutter/pull/62902
* https://github.com/flutter/flutter/pull/85174
* https://github.com/flutter/flutter/pull/101963
* https://github.com/flutter/flutter/pull/140478

Issue: https://github.com/flutter/flutter/issues/167735

## 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-24 20:15:13 +00:00
Daco Harkes
992b6cb5b1
[native assets] Roll dependencies (#167665)
Roll forward deps to the ones published today.
2025-04-24 15:16:13 +00:00
flutter-pub-roller-bot
e0b5546ebd
Roll pub packages (#167680)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-04-23 21:18:16 +00:00
Loïc Sharma
08a59c2802
[iOS] Hide keyboard on hot restart (#167013)
This hides the keyboard and text input context menu if you hot restart
your iOS app.

Before | After
-- | --
<video
src="https://github.com/user-attachments/assets/7ca5dbfe-a809-478c-9b36-4c168527b176"
/> | <video
src="https://github.com/user-attachments/assets/d1a48c16-f171-4d22-baa4-5c40488d055b"
/>

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

## 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-22 23:33:02 +00:00
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
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
Daco Harkes
de299444bc
[native assets] Roll dependencies (#167287)
Roll for https://github.com/dart-lang/native/issues/2187.
2025-04-16 19:10:40 +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
Daco Harkes
dfa1ee63da
[native assets] Roll dependencies (#166969)
Roll forward deps to the ones published today.

Note: `package:native_assets_cli` has a lower-bound on a Dart SDK dev
version to signal for which version of Dart and Flutter it is compatible
with. This means all these packages now have pre-release versions. Since
native assets is in experimental mode and not available on the
stable/beta branches, this is as expected.

Test exempt: Covered by existing tests, only rolling forward deps.
2025-04-11 10:06:17 +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
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
flutter-pub-roller-bot
b9c2634652
Roll pub packages (#166810)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-04-09 04:55:08 +00:00
flutter-pub-roller-bot
d3be3dec42
Roll pub packages (#166779)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-04-09 01:55:08 +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
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
Kishan Rathore
3bf6754d48
Migrate to Theme.brightnessOf method (#163950)
Refactor: Migrate to Theme.brightnessOf method
fixes: #163837

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-04-03 00:34:53 +00:00
flutter-pub-roller-bot
2976ed00ce
Roll pub packages (#166043)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-04-02 22:38:54 +00:00
Jonah Williams
c68c971e4c
[android_engine_test] disable old HC mode tests. (#166293)
Fixes https://github.com/flutter/flutter/issues/165032

These tests are flaky due to existing bugs in old HC mode.
2025-04-01 00:41:49 +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
16fc684886
Fix build_android_host_app_with_module_source device lab tests (#166077)
Fixes a type error where String was expected but JavaVersion was
inferred.
2025-03-27 17:42:48 +00:00
Ben Konyi
7cb926a33d
Reapply "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016) (#166059)
This reverts commit
8dccbc33df.

Find/replace didn't catch the use of `jvmTarget = "1.8"` in
`dev/integration_tests/android_engine_test/android/app/build.gradle` and
`android_engine_test` needed to have `"com.android.application"`
updated.
2025-03-27 15:07:22 +00:00
flutter-pub-roller-bot
dff327e4f5
Roll pub packages (#165932)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-03-27 04:27:26 +00:00
Ben Konyi
8dccbc33df
Revert "[ Device Lab ] Upgrade Device Lab projects to Java 18" (#166016)
Reverts flutter/flutter#165987

Reason for revert: multiple gradlew failures on devicelab tests
2025-03-26 20:51:02 +00:00
Ben Konyi
c376ca22dd
[ Device Lab ] Upgrade Device Lab projects to Java 18 (#165987)
Should resolve issues related to the following messages being output on
stderr:

```
warning: [options] source value 8 is obsolete and will be removed in a future release"
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
```

Fixes https://github.com/flutter/flutter/issues/165973
2025-03-26 15:32:27 +00:00