Skip to content

Commit 5f7f689

Browse files
committed
Merge main into feature/expose-payment-request-enabled
2 parents b0388bc + 1a72287 commit 5f7f689

File tree

121 files changed

+6691
-1195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+6691
-1195
lines changed

.ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ targets:
394394
### Android tasks ###
395395
- name: Linux_android android_build_all_packages master
396396
recipe: packages/packages
397-
timeout: 30
397+
timeout: 60
398398
properties:
399399
version_file: flutter_master.version
400400
# This builds the all_packages app only in a current JDK.
@@ -407,7 +407,7 @@ targets:
407407
408408
- name: Linux_android android_build_all_packages stable
409409
recipe: packages/packages
410-
timeout: 30
410+
timeout: 60
411411
properties:
412412
add_recipes_cq: "true"
413413
version_file: flutter_stable.version

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20788c07fcb8a0483e566f9b3261457b7fc49f01
1+
871849e4b6bfcad29021c826703b1ac8d3e07c0a

AGENTS.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Agent Guide for the Flutter Packages Repository
2+
3+
This document provides guidance for AI agents to effectively contribute to the `flutter/packages` repository.
4+
5+
## Guiding Principles for Contributions
6+
7+
- **Format All Code**: Every code change must be formatted using the repository's tools.
8+
- **Pass All Tests**: All changes must pass linting, analysis, and relevant tests.
9+
- **Update CHANGELOGs**: Any user-facing change or bug fix in a package requires an update to its `CHANGELOG.md` and `pubspec.yaml` version.
10+
- **Follow Conventions**: Adhere to the repository's specific conventions, such as federated plugin structure and code generation steps.
11+
12+
## Agent Environment Setup
13+
14+
To ensure a consistent and functional environment, configure your VM with the following setup. This provides the necessary Flutter SDK and dependencies for building and testing packages.
15+
16+
```bash
17+
curl -L https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.32.8-stable.tar.xz | tar -xJ -C $HOME
18+
export FLUTTER_HOME=$HOME/flutter
19+
export PATH=$FLUTTER_HOME/bin:$PATH
20+
flutter --disable-analytics
21+
flutter precache --force
22+
# Sanity check the configuration.
23+
flutter doctor --verbose
24+
```
25+
26+
## Repository Overview
27+
28+
This is a monorepo containing many Flutter packages.
29+
- First-party packages developed entirely by the Flutter team are in `packages/`.
30+
- Packages that were originally developed by a third party, but are now maintained by the Flutter team are in `third_party/packages/`.
31+
- The repository tooling is in `script/tool/`.
32+
33+
Many packages are part of **federated plugins**. A federated plugin has a main package (e.g., `path_provider`) that defines the API used by plugin clients, a platform interface package (e.g., `path_provider_platform_interface`) that defines the interface that each platform implementation must implement, and one or more platform implementation packages (e.g., `path_provider_android`, `path_provider_ios`) that implement that platform interface. When working on a federated plugin, you may need to modify multiple packages.
34+
35+
For more details, see the main `README.md` and `CONTRIBUTING.md`.
36+
37+
## Core Tooling and Workflows
38+
39+
The primary tool for this repository is `flutter_plugin_tools.dart`.
40+
41+
### Initial Setup
42+
43+
First, initialize the tooling:
44+
```bash
45+
cd $REPO_ROOT/script/tool # $REPO_ROOT is the repository root
46+
dart pub get
47+
```
48+
49+
### Identifying Target Packages
50+
51+
Most tool commands take a `--packages` argument. You must correctly identify all packages affected by your changes. You can derive this from git diff.
52+
53+
For example, to find changed files against the main branch of the upstream remote (assuming the upstream remote is named `origin`):
54+
55+
```bash
56+
git diff --name-only origin/main...HEAD
57+
```
58+
59+
Then, for each file path, find its enclosing package. A package is a directory containing a `pubspec.yaml` file. The directory name is usually the package name. Ignore `pubspec.yaml` files within `example/` directories when determining the package for a file.
60+
61+
#### Targeting All Packages
62+
63+
Running a tool command without a `--packages` argument will run the command on all packages. For example, a dependency can be updated for all packages in the repository:
64+
65+
```bash
66+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-dependency --pub-package <dependency_name>
67+
```
68+
69+
### Common Commands
70+
71+
- **Formatting**: Always format your changes.
72+
73+
```bash
74+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart format --packages <changed_packages>
75+
```
76+
- **Testing**: All changes must pass analysis and tests:
77+
78+
```bash
79+
# Run static analysis
80+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart analyze --packages <changed_packages>
81+
# Run Dart unit tests
82+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart dart-test --packages <changed_packages>
83+
```
84+
85+
The tool can also run native and integration tests, but these may require a more complete environment than is available.
86+
- **Validation**: Run these checks to ensure that changes follow team guidelines:
87+
```bash
88+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart publish-check --packages <changed_packages>
89+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart readme-check --packages <changed_packages>
90+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart version-check --packages <changed_packages>
91+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart license-check
92+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart repo-package-info-check
93+
```
94+
95+
### Specialized Workflows
96+
97+
- **Federated Plugin Development**: If you change multiple packages in a federated plugin that depend on each other, use `make-deps-path-based` to make their pubspec.yaml files use `path:` dependencies. This allows you to test them together locally.
98+
```bash
99+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart make-deps-path-based --target-dependencies=<changed_plugin_packages>
100+
```
101+
102+
The CI system will run tests with path-based dependencies automatically, so this is not required for PRs, but can be useful for local testing.
103+
- **Updating Dependencies**: To update a dependency across multiple packages:
104+
```bash
105+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-dependency --pub-package <dependency_name> --packages <packages_to_update>
106+
```
107+
- **Updating README Code Samples**: If you change example code that is included in a README.md:
108+
```bash
109+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages <changed_packages>
110+
```
111+
112+
## Code Generators
113+
114+
Some packages use code generators, and changes to those packages require running the relevant code generators.
115+
116+
- **Pigeon**: If you change a file in a `pigeons/` directory, you must run the Pigeon generator:
117+
```bash
118+
# Run from the package's directory
119+
dart run pigeon --input pigeons/<changed_file>.dart
120+
```
121+
- **Mockito**: If you change code in a package that uses `mockito` for tests (check `dev_dependencies` in `pubspec.yaml`), you must run its mock generator:
122+
```bash
123+
# Run from the package's directory
124+
dart run build_runner build -d
125+
```
126+
127+
## Code Style
128+
129+
All code must adhere to the repository's style guides. The `format` command handles most of this, but be aware of the specific style guides for each language, as detailed in [CONTRIBUTING.md](./CONTRIBUTING.md#style):
130+
- **Dart**: Flutter style, formatted with `dart format`.
131+
- **C++**: Google style, formatted with `clang-format`.
132+
- **Java**: Google style, formatted with `google-java-format`.
133+
- **Kotlin**: Android Kotlin style, formatted with `ktfmt`.
134+
- **Objective-C**: Google style, formatted with `clang-format`.
135+
- **Swift**: Google style, formatted with `swift-format`.
136+
137+
## Version and CHANGELOG updates
138+
139+
Any PR that changes non-test code in a package should update its version in pubspec.yaml and add a corresponding entry in CHANGELOG.md.
140+
141+
**This process can be automated**. The `update-release-info` command is the preferred way to handle this. It determines changed packages, bumps versions, and updates changelogs automatically.
142+
```bash
143+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-release-info \
144+
--version=minimal \
145+
--base-branch=origin/main \
146+
--changelog="A description of the changes."
147+
```
148+
149+
- `--version=minimal`: Bumps patch for bug fixes, and skips unchanged packages. This is usually the best option unless a new feature is being added.
150+
- When making public API changes, use `--version=minor` instead.
151+
- `--base-branch=origin/main`: Diffs against the `main` branch to find changed packages.
152+
153+
If you update manually, follow semantic versioning and the repository's CHANGELOG format.

CODEOWNERS

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ packages/image_picker/** @tarrinneal
2222
packages/interactive_media_ads/** @bparrishMines
2323
packages/in_app_purchase/** @bparrishMines
2424
packages/local_auth/** @stuartmorgan-g
25-
packages/metrics_center/** @christopherfujino
25+
packages/metrics_center/** @bkonyi
2626
packages/multicast_dns/** @vashworth
2727
packages/path_provider/** @stuartmorgan-g
2828
packages/pigeon/** @tarrinneal
@@ -32,12 +32,12 @@ packages/pointer_interceptor/** @ditman
3232
packages/quick_actions/** @bparrishMines
3333
packages/rfw/** @Hixie
3434
packages/shared_preferences/** @tarrinneal
35-
packages/standard_message_codec/** @jonahwilliams
35+
packages/standard_message_codec/** @stuartmorgan-g
3636
packages/two_dimensional_scrollables/** @Piinks
3737
packages/url_launcher/** @stuartmorgan-g
38-
packages/vector_graphics/** @jonahwilliams
39-
packages/vector_graphics_codec/** @jonahwilliams
40-
packages/vector_graphics_compiler/** @jonahwilliams
38+
packages/vector_graphics/** @jtmcdole
39+
packages/vector_graphics_codec/** @jtmcdole
40+
packages/vector_graphics_compiler/** @jtmcdole
4141
packages/video_player/** @tarrinneal
4242
packages/web_benchmarks/** @yjbanov
4343
packages/webview_flutter/** @bparrishMines
@@ -52,71 +52,71 @@ third_party/packages/path_parsing/** @domesticmouse
5252
# matching entry takes precedence.
5353

5454
# - Web
55-
packages/camera/camera_web/** @ditman
56-
packages/file_selector/file_selector_web/** @ditman
57-
packages/google_maps_flutter/google_maps_flutter_web/** @ditman
58-
packages/google_sign_in/google_sign_in_web/** @ditman
59-
packages/image_picker/image_picker_for_web/** @ditman
60-
packages/pointer_interceptor/pointer_interceptor_web/** @ditman
61-
packages/shared_preferences/shared_preferences_web/** @ditman
62-
packages/url_launcher/url_launcher_web/** @ditman
63-
packages/video_player/video_player_web/** @ditman
64-
packages/webview_flutter/webview_flutter_web/** @ditman
55+
packages/camera/camera_web/** @ditman
56+
packages/file_selector/file_selector_web/** @ditman
57+
packages/google_maps_flutter/google_maps_flutter_web/** @ditman
58+
packages/google_sign_in/google_sign_in_web/** @ditman
59+
packages/image_picker/image_picker_for_web/** @ditman
60+
packages/pointer_interceptor/pointer_interceptor_web/** @ditman
61+
packages/shared_preferences/shared_preferences_web/** @ditman
62+
packages/url_launcher/url_launcher_web/** @ditman
63+
packages/video_player/video_player_web/** @ditman
64+
packages/webview_flutter/webview_flutter_web/** @ditman
6565

6666
# - Android
67-
packages/camera/camera_android/** @camsim99
68-
packages/camera/camera_android_camerax/** @camsim99
69-
packages/espresso/** @jesswrd
70-
packages/file_selector/file_selector_android/** @mboetger
71-
packages/flutter_plugin_android_lifecycle/** @reidbaker
72-
packages/google_maps_flutter/google_maps_flutter_android/** @reidbaker
73-
packages/google_sign_in/google_sign_in_android/** @ash2moon
74-
packages/image_picker/image_picker_android/** @gmackall
75-
packages/in_app_purchase/in_app_purchase_android/** @gmackall
76-
packages/local_auth/local_auth_android/** @mboetger
77-
packages/path_provider/path_provider_android/** @camsim99
78-
packages/quick_actions/quick_actions_android/** @ash2moon
79-
packages/shared_preferences/shared_preferences_android/** @jesswrd
80-
packages/url_launcher/url_launcher_android/** @gmackall
81-
packages/video_player/video_player_android/** @ash2moon
67+
packages/camera/camera_android/** @camsim99
68+
packages/camera/camera_android_camerax/** @camsim99
69+
packages/espresso/** @jesswrd
70+
packages/file_selector/file_selector_android/** @mboetger
71+
packages/flutter_plugin_android_lifecycle/** @reidbaker
72+
packages/google_maps_flutter/google_maps_flutter_android/** @reidbaker
73+
packages/google_sign_in/google_sign_in_android/** @ash2moon
74+
packages/image_picker/image_picker_android/** @gmackall
75+
packages/in_app_purchase/in_app_purchase_android/** @gmackall
76+
packages/local_auth/local_auth_android/** @mboetger
77+
packages/path_provider/path_provider_android/** @camsim99
78+
packages/quick_actions/quick_actions_android/** @ash2moon
79+
packages/shared_preferences/shared_preferences_android/** @jesswrd
80+
packages/url_launcher/url_launcher_android/** @gmackall
81+
packages/video_player/video_player_android/** @ash2moon
8282
# Owned by ecosystem team for now during the wrapper evaluation.
83-
packages/webview_flutter/webview_flutter_android/** @bparrishMines
83+
packages/webview_flutter/webview_flutter_android/** @bparrishMines
8484

8585
# - Darwin
86-
packages/camera/camera_avfoundation/** @hellohuanlin @vashworth
87-
packages/file_selector/file_selector_ios/** @vashworth @cbracken
88-
packages/file_selector/file_selector_macos/** @vashworth @cbracken
89-
packages/google_maps_flutter/google_maps_flutter_ios/** @vashworth @cbracken
90-
packages/google_sign_in/google_sign_in_ios/** @LongCatIsLooong @cbracken
91-
packages/image_picker/image_picker_ios/** @vashworth @louisehsu
92-
packages/image_picker/image_picker_macos/** @vashworth @louisehsu
93-
packages/in_app_purchase/in_app_purchase_storekit/** @louisehsu @LongCatIsLooong
94-
packages/local_auth/local_auth_darwin/** @cbracken @vashworth
95-
packages/path_provider/path_provider_foundation/** @cbracken @vashworth
96-
packages/pointer_interceptor/pointer_interceptor_ios/** @louisehsu @hellohuanlin
97-
packages/quick_actions/quick_actions_ios/** @LongCatIsLooong @hellohuanlin
86+
packages/camera/camera_avfoundation/** @hellohuanlin @vashworth
87+
packages/file_selector/file_selector_ios/** @vashworth @cbracken
88+
packages/file_selector/file_selector_macos/** @vashworth @cbracken
89+
packages/google_maps_flutter/google_maps_flutter_ios/** @vashworth @cbracken
90+
packages/google_sign_in/google_sign_in_ios/** @LongCatIsLooong @cbracken
91+
packages/image_picker/image_picker_ios/** @vashworth @louisehsu
92+
packages/image_picker/image_picker_macos/** @vashworth @louisehsu
93+
packages/in_app_purchase/in_app_purchase_storekit/** @louisehsu @LongCatIsLooong
94+
packages/local_auth/local_auth_darwin/** @cbracken @vashworth
95+
packages/path_provider/path_provider_foundation/** @cbracken @vashworth
96+
packages/pointer_interceptor/pointer_interceptor_ios/** @louisehsu @hellohuanlin
97+
packages/quick_actions/quick_actions_ios/** @LongCatIsLooong @hellohuanlin
9898
packages/shared_preferences/shared_preferences_foundation/** @tarrinneal
99-
packages/url_launcher/url_launcher_ios/** @hellohuanlin @LongCatIsLooong
100-
packages/url_launcher/url_launcher_macos/** @hellohuanlin @LongCatIsLooong
101-
packages/video_player/video_player_avfoundation/** @LongCatIsLooong @hellohuanlin
102-
packages/webview_flutter/webview_flutter_wkwebview/** @cbracken @louisehsu
99+
packages/url_launcher/url_launcher_ios/** @hellohuanlin @LongCatIsLooong
100+
packages/url_launcher/url_launcher_macos/** @hellohuanlin @LongCatIsLooong
101+
packages/video_player/video_player_avfoundation/** @LongCatIsLooong @hellohuanlin
102+
packages/webview_flutter/webview_flutter_wkwebview/** @cbracken @louisehsu
103103

104104
# - Linux
105-
packages/file_selector/file_selector_linux/** @cbracken
106-
packages/image_picker/image_picker_linux/** @cbracken
107-
packages/path_provider/path_provider_linux/** @cbracken
108-
packages/shared_preferences/shared_preferences_linux/** @cbracken
109-
packages/url_launcher/url_launcher_linux/** @cbracken
105+
packages/file_selector/file_selector_linux/** @stuartmorgan-g
106+
packages/image_picker/image_picker_linux/** @stuartmorgan-g
107+
packages/path_provider/path_provider_linux/** @stuartmorgan-g
108+
packages/shared_preferences/shared_preferences_linux/** @stuartmorgan-g
109+
packages/url_launcher/url_launcher_linux/** @stuartmorgan-g
110110

111111
# - Windows
112-
packages/camera/camera_windows/** @cbracken
113-
packages/file_selector/file_selector_windows/** @cbracken
114-
packages/image_picker/image_picker_windows/** @cbracken
115-
packages/local_auth/local_auth_windows/** @cbracken
116-
packages/path_provider/path_provider_windows/** @cbracken
117-
packages/shared_preferences/shared_preferences_windows/** @cbracken
118-
packages/url_launcher/url_launcher_windows/** @cbracken
112+
packages/camera/camera_windows/** @stuartmorgan-g
113+
packages/file_selector/file_selector_windows/** @stuartmorgan-g
114+
packages/image_picker/image_picker_windows/** @stuartmorgan-g
115+
packages/local_auth/local_auth_windows/** @stuartmorgan-g
116+
packages/path_provider/path_provider_windows/** @stuartmorgan-g
117+
packages/shared_preferences/shared_preferences_windows/** @stuartmorgan-g
118+
packages/url_launcher/url_launcher_windows/** @stuartmorgan-g
119119

120120
# - DevTools extensions
121121
# @adsonpleal is the actual maintainer of shared_preferences_tool but is not yet a committer, so can't be listed as the owner.
122-
packages/shared_preferences/shared_preferences_tool/** @tarrinneal
122+
packages/shared_preferences/shared_preferences_tool/** @tarrinneal

packages/camera/camera_android_camerax/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.19+1
2+
3+
* Fixes incorrect camera switching by selecting a camera via its CameraInfo.
4+
15
## 0.6.19
26

37
* Changes target rotation of captured images to current default display rotation to fix captured

packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraSelectorProxyApi.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import androidx.camera.core.CameraInfo;
1010
import androidx.camera.core.CameraSelector;
1111
import androidx.camera.core.ExperimentalLensFacing;
12+
import java.util.Collections;
1213
import java.util.List;
1314

1415
/**
@@ -24,7 +25,8 @@ class CameraSelectorProxyApi extends PigeonApiCameraSelector {
2425
@ExperimentalLensFacing
2526
@NonNull
2627
@Override
27-
public CameraSelector pigeon_defaultConstructor(@Nullable LensFacing requireLensFacing) {
28+
public CameraSelector pigeon_defaultConstructor(
29+
@Nullable LensFacing requireLensFacing, @Nullable CameraInfo cameraInfoForFilter) {
2830
final CameraSelector.Builder builder = new CameraSelector.Builder();
2931
if (requireLensFacing != null) {
3032
switch (requireLensFacing) {
@@ -42,6 +44,9 @@ public CameraSelector pigeon_defaultConstructor(@Nullable LensFacing requireLens
4244
break;
4345
}
4446
}
47+
if (cameraInfoForFilter != null) {
48+
builder.addCameraFilter(cameraInfos -> Collections.singletonList(cameraInfoForFilter));
49+
}
4550
return builder.build();
4651
}
4752

0 commit comments

Comments
 (0)