Skip to content

Commit 8dd870b

Browse files
committed
Merge branch 'master' into add_zoom_to_android_webview
* master: (51 commits) [webview_flutter] Update version number app_facing package (flutter-team-archive#4375) [webview_flutter] Adjust integration test domains (flutter-team-archive#4383) Remove some trivial custom analysis options files (flutter-team-archive#4379) [google_maps_flutter_platfomr_interface] Add Marker drag events (flutter-team-archive#2653) [flutter_plugin_tools] Improve version check error handling (flutter-team-archive#4376) [flutter_plugin_tools] Allow overriding breaking change check (flutter-team-archive#4369) [url_launcher] Error handling when URL cannot be parsed with Uri.parse (flutter-team-archive#4365) [webview_flutter] Migrate main package to fully federated architecture. (flutter-team-archive#4366) [google_sign_in] Bump minimum Flutter version and iOS deployment target (flutter-team-archive#4334) Add false secret lists, and enforce ordering (flutter-team-archive#4372) [camera_web] Update usage documentation (flutter-team-archive#4371) [video_player] VTT Support (flutter-team-archive#2878) Require authors file (flutter-team-archive#4367) [flutter_plugin_tools] Fix federated safety check (flutter-team-archive#4368) [webview_flutter] Extract WKWebView implementation into a separate package (flutter-team-archive#4345) [webview_flutter] Extract Android implementation into a separate package (flutter-team-archive#4343) [in_app_purchase] Ensure the `introductoryPriceMicros` field is populated correctly. (flutter-team-archive#4364) [flutter_plugin_tools] Add a federated PR safety check (flutter-team-archive#4329) [camera] Add web support (flutter-team-archive#4240) [webview_flutter] Bump minimum Flutter version and iOS deployment target (flutter-team-archive#4361) ... # Conflicts: # packages/webview_flutter/webview_flutter/lib/platform_interface.dart # packages/webview_flutter/webview_flutter/lib/src/webview_method_channel.dart # packages/webview_flutter/webview_flutter/lib/webview_flutter.dart
2 parents b40f51c + cc3c53c commit 8dd870b

352 files changed

Lines changed: 13513 additions & 2543 deletions

File tree

Some content is hidden

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

‎.cirrus.yml‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gcp_credentials: ENCRYPTED[!0e63b52bd7e4fda1cd7b7bf2b4fe515a27fadbeaced01f5ad8b699b81d3611ed64c5d3271bcd8426dd914ef41cba48a0!]
1+
gcp_credentials: ENCRYPTED[!48cff44dd32e9cc412d4d381c7fe68d373ca04cf2639f8192d21cb1a9ab5e21129651423a1cf88f3fd7fe2125c1cabd9!]
22

33
# Don't run on release tags since it creates O(n^2) tasks where n is the
44
# number of plugins
@@ -68,12 +68,31 @@ task:
6868
- cd script/tool
6969
- dart pub run test
7070
- name: publishable
71-
version_check_script: ./script/tool_runner.sh version-check
71+
env:
72+
CHANGE_DESC: "$TMPDIR/change-description.txt"
73+
version_check_script:
74+
# For pre-submit, pass the PR description to the script to allow for
75+
# platform version breaking version change justifications.
76+
# For post-submit, ignore platform version breaking version changes.
77+
# The PR description isn't reliably part of the commit message, so using
78+
# the same flags as for presubmit would likely result in false-positive
79+
# post-submit failures.
80+
- if [[ $CIRRUS_PR == "" ]]; then
81+
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
82+
- else
83+
- echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC"
84+
- ./script/tool_runner.sh version-check --change-description-file="$CHANGE_DESC"
85+
- fi
7286
publish_check_script: ./script/tool_runner.sh publish-check
7387
- name: format
7488
format_script: ./script/tool_runner.sh format --fail-on-change
7589
pubspec_script: ./script/tool_runner.sh pubspec-check
7690
license_script: dart $PLUGIN_TOOL license-check
91+
- name: federated_safety
92+
# This check is only meaningful for PRs, as it validates changes
93+
# rather than state.
94+
only_if: $CIRRUS_PR != ""
95+
script: ./script/tool_runner.sh federation-safety-check
7796
- name: dart_unit_tests
7897
env:
7998
matrix:
@@ -159,7 +178,7 @@ task:
159178
CHANNEL: "master"
160179
CHANNEL: "stable"
161180
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
162-
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[07586610af1fdfc894e5969f70ef2458341b9b7e9c3b7c4225a663b4a48732b7208a4d91c3b7d45305a6b55fa2a37fc4]
181+
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[!c9446a7b11d5520c2ebce3c64ccc82fe6d146272cb06a4a4590e22c389f33153f951347a25422522df1a81fe2f085e9a!]
163182
build_script:
164183
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
165184
# might include non-ASCII characters which makes Gradle crash.
@@ -182,7 +201,8 @@ task:
182201
- export CIRRUS_COMMIT_MESSAGE=""
183202
# Native integration tests are handled by firebase-test-lab below, so
184203
# only run unit tests.
185-
- ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
204+
# Must come after build-examples.
205+
- ./script/tool_runner.sh native-test --android --no-integration --exclude script/configs/exclude_native_unit_android.yaml
186206
firebase_test_lab_script:
187207
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
188208
# might include non-ASCII characters which makes Gradle crash.
@@ -211,8 +231,10 @@ task:
211231
- git clone https://github.com/flutter/web_installers.git
212232
- cd web_installers/packages/web_drivers/
213233
- dart pub get
234+
chromedriver_background_script:
235+
- cd web_installers/packages/web_drivers/
214236
- dart lib/web_driver_installer.dart chromedriver --install-only
215-
- ./chromedriver/chromedriver --port=4444 &
237+
- ./chromedriver/chromedriver --port=4444
216238
build_script:
217239
- ./script/tool_runner.sh build-examples --web
218240
drive_script:
@@ -255,7 +277,7 @@ task:
255277
xcode_analyze_script:
256278
- ./script/tool_runner.sh xcode-analyze --ios
257279
native_test_script:
258-
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
280+
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest" --exclude=script/configs/exclude_native_ios.yaml
259281
drive_script:
260282
# `drive-examples` contains integration tests, which changes the UI of the application.
261283
# This UI change sometimes affects `xctest`.

‎.github/workflows/pull_request_label.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414

1515
jobs:
1616
label:
17+
permissions:
18+
pull-requests: write
1719
runs-on: ubuntu-latest
1820
steps:
1921
- uses: actions/labeler@9794b1493b6f1fa7b006c5f8635a19c76c98be95

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
release:
99
if: github.repository_owner == 'flutter'
1010
name: release
11+
permissions:
12+
# Release needs to push a tag back to the repo.
13+
contents: write
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: "Install Flutter"

‎packages/android_alarm_manager/android/build.gradle‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ apply plugin: 'com.android.library'
2828

2929
android {
3030
compileSdkVersion 29
31-
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
34-
}
3531
defaultConfig {
3632
minSdkVersion 16
3733
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -54,6 +50,10 @@ android {
5450
}
5551
}
5652
}
53+
compileOptions {
54+
sourceCompatibility JavaVersion.VERSION_1_8
55+
targetCompatibility JavaVersion.VERSION_1_8
56+
}
5757
}
5858

5959
dependencies {

‎packages/android_intent/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Remove references to the V1 Android embedding.
44
* Updated Android lint settings.
5+
* Specify Java 8 for Android build.
56

67
## 2.0.2
78

‎packages/android_intent/android/build.gradle‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ android {
3737
disable 'InvalidPackage'
3838
disable 'GradleDependency'
3939
}
40-
41-
40+
compileOptions {
41+
sourceCompatibility JavaVersion.VERSION_1_8
42+
targetCompatibility JavaVersion.VERSION_1_8
43+
}
4244
testOptions {
4345
unitTests.includeAndroidResources = true
4446
unitTests.returnDefaultValues = true

‎packages/camera/camera/CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.9.4
2+
3+
* Add web support by endorsing `package:camera_web`.
4+
5+
## 0.9.3+1
6+
7+
* Remove iOS 9 availability check around ultra high capture sessions.
8+
19
## 0.9.3
210

311
* Update minimum Flutter SDK to 2.5 and iOS deployment target to 9.0.

‎packages/camera/camera/README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera)
44

5-
A Flutter plugin for iOS and Android allowing access to the device cameras.
5+
A Flutter plugin for iOS, Android and Web allowing access to the device cameras.
66

77
*Note*: This plugin is still under development, and some APIs might not be available yet. We are working on a refactor which can be followed here: [issue](https://github.com/flutter/flutter/issues/31225)
88

@@ -47,6 +47,11 @@ minSdkVersion 21
4747

4848
It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. Specifically, when recording a video with sound enabled and trying to play it back, the duration won't be correct and you will only see the first frame.
4949

50+
### Web integration
51+
52+
For web integration details, see the
53+
[`camera_web` package](https://pub.dev/packages/camera_web).
54+
5055
### Handling Lifecycle states
5156

5257
As of version [0.5.0](https://github.com/flutter/plugins/blob/master/packages/camera/CHANGELOG.md#050) of the camera plugin, lifecycle changes are no longer handled by the plugin. This means developers are now responsible to control camera resources when the lifecycle state is updated. Failure to do so might lead to unexpected behavior (for example as described in issue [#39109](https://github.com/flutter/flutter/issues/39109)). Handling lifecycle changes can be done by overriding the `didChangeAppLifecycleState` method like so:

‎packages/camera/camera/android/build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ android {
3939
baseline file("lint-baseline.xml")
4040
}
4141
compileOptions {
42-
sourceCompatibility = '1.8'
43-
targetCompatibility = '1.8'
42+
sourceCompatibility JavaVersion.VERSION_1_8
43+
targetCompatibility JavaVersion.VERSION_1_8
4444
}
4545

4646

‎packages/camera/camera/example/lib/main.dart‎

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:async';
88
import 'dart:io';
99

1010
import 'package:camera/camera.dart';
11+
import 'package:flutter/foundation.dart';
1112
import 'package:flutter/material.dart';
1213
import 'package:video_player/video_player.dart';
1314

@@ -231,7 +232,14 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
231232
? Container()
232233
: SizedBox(
233234
child: (localVideoController == null)
234-
? Image.file(File(imageFile!.path))
235+
? (
236+
// The captured image on the web contains a network-accessible URL
237+
// pointing to a location within the browser. It may be displayed
238+
// either with Image.network or Image.memory after loading the image
239+
// bytes to memory.
240+
kIsWeb
241+
? Image.network(imageFile!.path)
242+
: Image.file(File(imageFile!.path)))
235243
: Container(
236244
child: Center(
237245
child: AspectRatio(
@@ -267,17 +275,24 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
267275
color: Colors.blue,
268276
onPressed: controller != null ? onFlashModeButtonPressed : null,
269277
),
270-
IconButton(
271-
icon: Icon(Icons.exposure),
272-
color: Colors.blue,
273-
onPressed:
274-
controller != null ? onExposureModeButtonPressed : null,
275-
),
276-
IconButton(
277-
icon: Icon(Icons.filter_center_focus),
278-
color: Colors.blue,
279-
onPressed: controller != null ? onFocusModeButtonPressed : null,
280-
),
278+
// The exposure and focus mode are currently not supported on the web.
279+
...(!kIsWeb
280+
? [
281+
IconButton(
282+
icon: Icon(Icons.exposure),
283+
color: Colors.blue,
284+
onPressed: controller != null
285+
? onExposureModeButtonPressed
286+
: null,
287+
),
288+
IconButton(
289+
icon: Icon(Icons.filter_center_focus),
290+
color: Colors.blue,
291+
onPressed:
292+
controller != null ? onFocusModeButtonPressed : null,
293+
)
294+
]
295+
: []),
281296
IconButton(
282297
icon: Icon(enableAudio ? Icons.volume_up : Icons.volume_mute),
283298
color: Colors.blue,
@@ -616,7 +631,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
616631

617632
final CameraController cameraController = CameraController(
618633
cameraDescription,
619-
ResolutionPreset.medium,
634+
kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium,
620635
enableAudio: enableAudio,
621636
imageFormatGroup: ImageFormatGroup.jpeg,
622637
);
@@ -635,12 +650,17 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
635650
try {
636651
await cameraController.initialize();
637652
await Future.wait([
638-
cameraController
639-
.getMinExposureOffset()
640-
.then((value) => _minAvailableExposureOffset = value),
641-
cameraController
642-
.getMaxExposureOffset()
643-
.then((value) => _maxAvailableExposureOffset = value),
653+
// The exposure mode is currently not supported on the web.
654+
...(!kIsWeb
655+
? [
656+
cameraController
657+
.getMinExposureOffset()
658+
.then((value) => _minAvailableExposureOffset = value),
659+
cameraController
660+
.getMaxExposureOffset()
661+
.then((value) => _maxAvailableExposureOffset = value)
662+
]
663+
: []),
644664
cameraController
645665
.getMaxZoomLevel()
646666
.then((value) => _maxAvailableZoom = value),
@@ -708,16 +728,20 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
708728
}
709729

710730
void onCaptureOrientationLockButtonPressed() async {
711-
if (controller != null) {
712-
final CameraController cameraController = controller!;
713-
if (cameraController.value.isCaptureOrientationLocked) {
714-
await cameraController.unlockCaptureOrientation();
715-
showInSnackBar('Capture orientation unlocked');
716-
} else {
717-
await cameraController.lockCaptureOrientation();
718-
showInSnackBar(
719-
'Capture orientation locked to ${cameraController.value.lockedCaptureOrientation.toString().split('.').last}');
731+
try {
732+
if (controller != null) {
733+
final CameraController cameraController = controller!;
734+
if (cameraController.value.isCaptureOrientationLocked) {
735+
await cameraController.unlockCaptureOrientation();
736+
showInSnackBar('Capture orientation unlocked');
737+
} else {
738+
await cameraController.lockCaptureOrientation();
739+
showInSnackBar(
740+
'Capture orientation locked to ${cameraController.value.lockedCaptureOrientation.toString().split('.').last}');
741+
}
720742
}
743+
} on CameraException catch (e) {
744+
_showCameraException(e);
721745
}
722746
}
723747

@@ -916,8 +940,10 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
916940
return;
917941
}
918942

919-
final VideoPlayerController vController =
920-
VideoPlayerController.file(File(videoFile!.path));
943+
final VideoPlayerController vController = kIsWeb
944+
? VideoPlayerController.network(videoFile!.path)
945+
: VideoPlayerController.file(File(videoFile!.path));
946+
921947
videoPlayerListener = () {
922948
if (videoController != null && videoController!.value.size != null) {
923949
// Refreshing the state to update video player with the correct ratio.

0 commit comments

Comments
 (0)