Skip to content

Commit

Permalink
Merge branch 'main' into feature/video-player/add-optional-web-option…
Browse files Browse the repository at this point in the history
…s-web-package
  • Loading branch information
ditman authored Aug 3, 2023
2 parents c286288 + 4e18b58 commit 47503fb
Show file tree
Hide file tree
Showing 116 changed files with 2,597 additions and 3,351 deletions.
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e81907e07a385e79e67734162d435b11f5339000
c00d241938b1b1ddf09121ce7e1cc62873f7af91
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gcp_credentials: ENCRYPTED[!9c8e92e8da192ce2a51b7d4ed9948c4250d0bae3660193d9b901196c9692abbebe784d4a32e9f38b328571d65f6e7aed!]
gcp_credentials: ENCRYPTED[!9409b709ab4de7293a70606cca13eaf42e9cbc704e8a6b4e3d2b09484cf997cbd2334e1eeafe23626ad07a726106df90!]

# Run on PRs and main branch post submit only. Don't run tests when tagging.
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@9fcb2c2f5584144ca754f8bfe8c6f81e77753375
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@1813ca74c3faaa3a2da2070b9b8a0b3e7373a0d8 # v1.0.26
uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v1.0.26
with:
sarif_file: results.sarif
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
// This version should intentionally be a 1.7.* version and lower than the
// This version should intentionally be a 1.7.* version and lower than the
// version of kotlin-bom defined in packages/camera/camera_android_camerax/android/build.gradle.
// This tests that the kotlin version resolution continues to work.
// This tests that the kotlin version resolution continues to work.
ext.kotlin_version = '1.7.10'
repositories {
google()
Expand All @@ -16,6 +16,12 @@ buildscript {

allprojects {
repositories {
// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
def artifactRepoKey = 'ARTIFACT_HUB_REPOSITORY'
if (System.getenv().containsKey(artifactRepoKey)) {
println "Using artifact hub"
maven { url System.getenv(artifactRepoKey) }
}
google()
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

// See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure for more info.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
}
}
apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"
4 changes: 4 additions & 0 deletions packages/camera/camera_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.2

* Changes `availableCameras` to not ask for the microphone permission.

## 0.3.1+4

* Removes obsolete null checks on non-nullable values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,18 @@ void main() {
);
});

testWidgets('requests video and audio permissions',
(WidgetTester tester) async {
testWidgets('requests video permissions', (WidgetTester tester) async {
final List<CameraDescription> _ =
await CameraPlatform.instance.availableCameras();

verify(
() => cameraService.getMediaStreamForOptions(
const CameraOptions(
audio: AudioConstraints(enabled: true),
),
),
() => cameraService.getMediaStreamForOptions(const CameraOptions()),
).called(1);
});

testWidgets(
'releases the camera stream '
'used to request video and audio permissions',
(WidgetTester tester) async {
'used to request video permissions', (WidgetTester tester) async {
final MockMediaStreamTrack videoTrack = MockMediaStreamTrack();

bool videoTrackStopped = false;
Expand All @@ -124,11 +118,7 @@ void main() {
});

when(
() => cameraService.getMediaStreamForOptions(
const CameraOptions(
audio: AudioConstraints(enabled: true),
),
),
() => cameraService.getMediaStreamForOptions(const CameraOptions()),
).thenAnswer(
(_) => Future<MediaStream>.value(
FakeMediaStream(<MediaStreamTrack>[videoTrack]),
Expand Down
10 changes: 3 additions & 7 deletions packages/camera/camera_web/lib/src/camera_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,11 @@ class CameraPlugin extends CameraPlatform {
);
}

// Request video and audio permissions.
// Request video permissions only.
final html.MediaStream cameraStream =
await _cameraService.getMediaStreamForOptions(
const CameraOptions(
audio: AudioConstraints(enabled: true),
),
);
await _cameraService.getMediaStreamForOptions(const CameraOptions());

// Release the camera stream used to request video and audio permissions.
// Release the camera stream used to request video permissions.
cameraStream
.getVideoTracks()
.forEach((html.MediaStreamTrack videoTrack) => videoTrack.stop());
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_web
description: A Flutter plugin for getting information about and controlling the camera on Web.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.3.1+4
version: 0.3.2

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('StaggeredExample lays out children correctly',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(400, 200);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(400, 200);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
const MaterialApp(
Expand Down
79 changes: 24 additions & 55 deletions packages/dynamic_layouts/test/staggered_layout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ void main() {
testWidgets(
'DynamicGridView works when using DynamicSliverGridDelegateWithFixedCrossAxisCount',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(400, 100);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(400, 100);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -59,13 +55,9 @@ void main() {
testWidgets(
'DynamicGridView works when using DynamicSliverGridDelegateWithMaxCrossAxisExtent',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(440, 100);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(440, 100);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -106,13 +98,9 @@ void main() {
group('DynamicGridView.staggered', () {
testWidgets('DynamicGridView.staggered works with simple layout',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(400, 100);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(400, 100);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -158,13 +146,9 @@ void main() {
});
testWidgets('DynamicGridView.staggered works with a horizontal grid',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(100, 500);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(100, 500);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -216,13 +200,9 @@ void main() {
});
testWidgets('DynamicGridView.staggered works with a reversed grid',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(600, 200);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(600, 200);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -290,13 +270,10 @@ void main() {

testWidgets('DynamicGridView.staggered deletes children appropriately',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(600, 1000);
tester.view.physicalSize = const Size(600, 1000);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
final List<Widget> children = List<Widget>.generate(
50,
(int index) => SizedBox(
Expand Down Expand Up @@ -375,13 +352,9 @@ void main() {
group('DynamicGridView.builder', () {
testWidgets('DynamicGridView.builder works with a staggered layout',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(400, 100);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(400, 100);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down Expand Up @@ -430,13 +403,9 @@ void main() {
testWidgets(
'DynamicGridView.builder works with an infinite grid using a staggered layout',
(WidgetTester tester) async {
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.physicalSizeTestValue = const Size(400, 100);

// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
tester.binding.window.devicePixelRatioTestValue = 1.0;
tester.view.physicalSize = const Size(400, 100);
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);

await tester.pumpWidget(
MaterialApp(
Expand Down
8 changes: 2 additions & 6 deletions packages/dynamic_layouts/test/wrap_layout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,7 @@ void main() {
expect(find.text('Item 4'), findsNothing);
await tester.binding.setSurfaceSize(const Size(280, 100));
// resets the screen to its original size after the test end
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
addTearDown(tester.view.resetPhysicalSize);
await tester.pumpAndSettle();
expect(find.text('Item 0'), findsOneWidget);
expect(find.text('Item 1'), findsOneWidget);
Expand Down Expand Up @@ -572,9 +570,7 @@ void main() {

await tester.binding.setSurfaceSize(const Size(560, 100));
// resets the screen to its original size after the test end
// TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912
// ignore: deprecated_member_use
addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
addTearDown(tester.view.resetPhysicalSize);
await tester.pumpAndSettle();

expect(find.text('Item 0'), findsOneWidget);
Expand Down
8 changes: 8 additions & 0 deletions packages/go_router_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 2.3.0

* Adds Support for StatefulShellRoute

## 2.2.5

* Fixes a bug where shell routes without const constructor were not generated correctly.

## 2.2.4

* Bumps example go_router version to v10.0.0 and migrate example code.
Expand Down
4 changes: 2 additions & 2 deletions packages/go_router_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ To use `go_router_builder`, you need to have the following dependencies in
```yaml
dependencies:
# ...along with your other dependencies
go_router: ^7.0.0
go_router: ^9.0.3

dev_dependencies:
# ...along with your other dev-dependencies
build_runner: ^2.0.0
go_router_builder: ^2.0.0
go_router_builder: ^2.3.0
```
### Source code
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 47503fb

Please sign in to comment.