Skip to content

Commit

Permalink
Merge branch 'main' into feature/fix
Browse files Browse the repository at this point in the history
* main: (144 commits)
  Update test golden images for the latest Skia roll (flutter#3787)
  [various] Adds Android namespace (flutter#3791)
  [shared_preferences] Update gradle/agp in example apps (flutter#3809)
  [go_router] Adds name to TypedGoRoute (flutter#3702)
  [webview_flutter] Adds support to receive permission requests (flutter#3543)
  [google_sign_in] Fix Android Java warnings (flutter#3762)
  [local_auth] Fix enum return on Android (flutter#3780)
  [pigeon] Warn when trying to use enums in collections (flutter#3782)
  [webview_flutter_android] [webview_flutter_wkwebview] Platform implementations for supporting permission requests (flutter#3792)
  [pigeon] Update for compatibility with a future change to the analyzer. (flutter#3789)
  [camera_android] Fix Android lint warnings  (flutter#3716)
  [webview_flutter_platform_interface] Adds method to receive permission requests (flutter#3767)
  [image_picker_ios] In unit test write and read kCGImagePropertyExifUserComment property (flutter#3783)
  [go_router_builder] Fixed the return value of the generated push method (flutter#3650)
  [image_picker] Mention `launchMode: singleInstance` in README (flutter#3759)
  Revert "[pigeon] Add an initial example app" (flutter#3785)
  [google_maps_flutter] Add examples for different iOS versions (flutter#3757)
  [pigeon] Add an initial example app (flutter#3761)
  [google_maps_flutter_web] Allow marker position updates (flutter#3697)
  [Tool] [Code Excerpt] allow excerpts in example readme (flutter#3758)
  ...

# Conflicts:
#	packages/camera/camera/pubspec.yaml
  • Loading branch information
pro100andrey committed Apr 25, 2023
2 parents 3dd957b + 0ae0579 commit 1263b0f
Show file tree
Hide file tree
Showing 1,033 changed files with 35,709 additions and 9,906 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# before running. What matters is that the base image is pinned to minimize
# unintended changes when modifying this file.
# This is the hash for the 3.0.0 image.
FROM cirrusci/flutter@sha256:794fbbce5422e79aae1dbf6e6cbfcf5fe89aff50350d7c018853b3cfdf35821a
FROM cirrusci/flutter@sha256:d99b1ba2602240a74722970b5c0cd704bbe60a7eba7557157c784f2f693c393f

RUN apt-get update -y

Expand Down
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1ba3f99bb0aa028a7f092cf4f05959192060b6b1
c9004ff822cf76848365f5dd8e034596fcbceba1
2 changes: 1 addition & 1 deletion .ci/flutter_stable.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ad6cd72c040113b47ee9055e722606a490ef0da
f72efea43c3013323d1b95cff571f3c1caa37583
3 changes: 2 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ task:
# run with --require-excerpts and no exclusions.
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
dependabot_script: $PLUGIN_TOOL_COMMAND dependabot-check
gradle_script: $PLUGIN_TOOL_COMMAND gradle-check
version_script:
# For pre-submit, pass the PR labels to the script to allow for
# check overrides.
Expand Down Expand Up @@ -324,8 +325,8 @@ task:
- name: web_benchmarks_test
env:
matrix:
CHROMIUM_BUILD: "768968" # Chromium 84.0.4147.0
CHROMIUM_BUILD: "950363" # Chromium 98.0.4758.0
CHROMIUM_BUILD: "1097615" # Chromium 111
<< : *INSTALL_CHROME_LINUX
script:
- cd packages/web_benchmarks/testing/test_app
Expand Down
7 changes: 7 additions & 0 deletions .github/autosubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2023 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This file will be added to flutter's internal repository.
# https://github.com/flutter/flutter/wiki/Autosubmit-bot
config_path: 'autosubmit/flutter/autosubmit_main.yml'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cd $GITHUB_WORKSPACE
# Checks out a copy of the repo.
- name: Check out code
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
- name: Set up tools
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v2.4.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v2.4.0
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.0.3
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.0.3
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -49,6 +49,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v1.0.26
uses: github/codeql-action/upload-sarif@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # v1.0.26
with:
sarif_file: results.sarif
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ TheOneWithTheBraid <[email protected]>
Rulong Chen(陈汝龙) <[email protected]>
Hwanseok Kang <[email protected]>
Twin Sun, LLC <[email protected]>
Amir Panahandeh <[email protected]>
34 changes: 17 additions & 17 deletions README.md

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions packages/animations/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'dev.flutter.packages.animations.example'
compileSdkVersion flutter.compileSdkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
applicationId "dev.flutter.packages.animations.example"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -52,6 +50,10 @@ android {
signingConfig signingConfigs.debug
}
}
namespace 'dev.flutter.packages.animations.example'
lint {
disable 'InvalidPackage'
}
}

flutter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.flutter.packages.animations.example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.flutter.packages.animations.example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:exported="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.flutter.packages.animations.example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions packages/animations/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.0'
ext.kotlin_version = '1.6.21'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/animations/example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
4 changes: 3 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT
## 0.10.4

* Allows camera to be switched while video recording.
* Updates minimum Flutter version to 3.3.
* Aligns Dart and Flutter SDK constraints.

## 0.10.3+2
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.inactive) {
cameraController.dispose();
} else if (state == AppLifecycleState.resumed) {
onNewCameraSelected(cameraController.description);
_initializeCameraController(cameraController.description);
}
}
```
Expand Down
1 change: 1 addition & 0 deletions packages/camera/camera/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'io.flutter.plugins.cameraexample'
compileSdkVersion flutter.compileSdkVersion

lintOptions {
Expand Down
39 changes: 39 additions & 0 deletions packages/camera/camera/example/integration_test/camera_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,45 @@ void main() {
return completer.future;
}

testWidgets('Set description while recording', (WidgetTester tester) async {
final List<CameraDescription> cameras = await availableCameras();
if (cameras.length < 2) {
return;
}

final CameraController controller = CameraController(
cameras[0],
ResolutionPreset.low,
enableAudio: false,
);

await controller.initialize();
await controller.prepareForVideoRecording();

await controller.startVideoRecording();
await controller.setDescription(cameras[1]);

expect(controller.description, cameras[1]);
});

testWidgets('Set description', (WidgetTester tester) async {
final List<CameraDescription> cameras = await availableCameras();
if (cameras.length < 2) {
return;
}

final CameraController controller = CameraController(
cameras[0],
ResolutionPreset.low,
enableAudio: false,
);

await controller.initialize();
await controller.setDescription(cameras[1]);

expect(controller.description, cameras[1]);
});

testWidgets(
'iOS image streaming with imageFormatGroup',
(WidgetTester tester) async {
Expand Down
23 changes: 9 additions & 14 deletions packages/camera/camera/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
if (state == AppLifecycleState.inactive) {
cameraController.dispose();
} else if (state == AppLifecycleState.resumed) {
onNewCameraSelected(cameraController.description);
_initializeCameraController(cameraController.description);
}
}
// #enddocregion AppLifecycle
Expand Down Expand Up @@ -597,10 +597,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)),
groupValue: controller?.description,
value: cameraDescription,
onChanged:
controller != null && controller!.value.isRecordingVideo
? null
: onChanged,
onChanged: onChanged,
),
),
);
Expand Down Expand Up @@ -633,17 +630,15 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

Future<void> onNewCameraSelected(CameraDescription cameraDescription) async {
final CameraController? oldController = controller;
if (oldController != null) {
// `controller` needs to be set to null before getting disposed,
// to avoid a race condition when we use the controller that is being
// disposed. This happens when camera permission dialog shows up,
// which triggers `didChangeAppLifecycleState`, which disposes and
// re-creates the controller.
controller = null;
await oldController.dispose();
if (controller != null) {
return controller!.setDescription(cameraDescription);
} else {
return _initializeCameraController(cameraDescription);
}
}

Future<void> _initializeCameraController(
CameraDescription cameraDescription) async {
final CameraController cameraController = CameraController(
cameraDescription,
kIsWeb ? ResolutionPreset.max : ResolutionPreset.medium,
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
publish_to: none

environment:
sdk: ">=2.17.0 <4.0.0"
flutter: ">=3.0.0"
sdk: ">=2.18.0 <4.0.0"
flutter: ">=3.3.0"

dependencies:
camera:
Expand Down
Loading

0 comments on commit 1263b0f

Please sign in to comment.