Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 012ae58

Browse files
authored
Merge branch 'flutter:main' into main
2 parents 1b4e0d7 + 3d44753 commit 012ae58

File tree

367 files changed

+3096
-1538
lines changed

Some content is hidden

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

367 files changed

+3096
-1538
lines changed

.ci/Dockerfile

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,40 @@
11
# The Flutter version is not important here, since the CI scripts update Flutter
22
# before running. What matters is that the base image is pinned to minimize
33
# unintended changes when modifying this file.
4-
FROM cirrusci/flutter@sha256:505fe8bce2896c75b4df9ccf500b1604155bf932af7465ffcc66fcae8612f82f
4+
# This is the hash for the 3.0.0 image.
5+
FROM cirrusci/flutter@sha256:0224587bba33241cf908184283ec2b544f1b672d87043ead1c00521c368cf844
56

67
RUN apt-get update -y
78

9+
# Set up Firebase Test Lab requirements.
810
RUN apt-get install -y --no-install-recommends gnupg
9-
10-
# Add repo for gcloud sdk and install it
1111
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
1212
sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
13-
1413
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
1514
sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
16-
1715
RUN apt-get update && apt-get install -y google-cloud-sdk && \
1816
gcloud config set core/disable_usage_reporting true && \
1917
gcloud config set component_manager/disable_update_check true
2018

21-
RUN yes | sdkmanager \
22-
"platforms;android-27" \
23-
"build-tools;27.0.3" \
24-
"extras;google;m2repository" \
25-
"extras;android;m2repository"
26-
27-
RUN yes | sdkmanager --licenses
28-
29-
# Install formatter.
19+
# Install formatter for C-based languages.
3020
RUN apt-get install -y clang-format
3121

32-
# Install xvfb to allow running headless
33-
RUN apt-get install -y xvfb libegl1-mesa
34-
# Install Linux desktop build tool requirements.
22+
# Install Linux desktop requirements:
23+
# - build tools.
3524
RUN apt-get install -y clang cmake ninja-build file pkg-config
36-
# Install necessary libraries.
25+
# - libraries.
3726
RUN apt-get install -y libgtk-3-dev libblkid-dev liblzma-dev libgcrypt20-dev
27+
# - xvfb to allow running headless.
28+
RUN apt-get install -y xvfb libegl1-mesa
3829

39-
# Add repo for Google Chrome and install it
30+
# Install Chrome and make it the default browser, for url_launcher tests.
31+
# IMPORTANT: Web tests should use a pinned version of Chromium, not this, since
32+
# this isn't pinned, so any time the docker image is re-created the version of
33+
# Chrome may change.
4034
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
4135
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
4236
RUN apt-get update && apt-get install -y --no-install-recommends google-chrome-stable
43-
44-
# Make Chrome the default so http: and file: has a handler for url_launcher tests.
37+
# Make Chrome the default for http:, https: and file:.
4538
RUN apt-get install -y xdg-utils
4639
RUN xdg-settings set default-web-browser google-chrome.desktop
4740
RUN xdg-mime default google-chrome.desktop inode/directory

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7b6074fbc542efb41da5618bc97711fac6ab7dee
1+
08e1729204f3e2be062bf3aabbe14048561171ac

.ci/flutter_stable.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e3c29ec00c9c825c891d75054c63fcc46454dca1
1+
eb6d86ee27deecba4a83536aa20f366a6044895c

.github/workflows/pull_request_label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
pull-requests: write
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/labeler@e54e5b338fbd6e6cdb5d60f51c22335fc57c401e
24+
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4
2525
with:
2626
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2727
sync-labels: true

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
cd $GITHUB_WORKSPACE
2828
# Checks out a copy of the repo.
2929
- name: Check out code
30-
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
30+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
3131
with:
3232
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
3333
- name: Set up tools
@@ -50,5 +50,5 @@ jobs:
5050
run: |
5151
git config --global user.name ${{ secrets.USER_NAME }}
5252
git config --global user.email ${{ secrets.USER_EMAIL }}
53-
dart ./script/tool/lib/src/main.dart publish-plugin --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
53+
dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
5454
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}

.github/workflows/scorecards-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222

2323
steps:
2424
- name: "Checkout code"
25-
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
25+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
2626
with:
2727
persist-credentials: false
2828

2929
- name: "Run analysis"
30-
uses: ossf/scorecard-action@865b4092859256271290c77adbd10a43f4779972
30+
uses: ossf/scorecard-action@e363bfca00e752f91de7b7d2a77340e2e523cb18
3131
with:
3232
results_file: results.sarif
3333
results_format: sarif
@@ -50,6 +50,6 @@ jobs:
5050

5151
# Upload the results to GitHub's code scanning dashboard.
5252
- name: "Upload to code-scanning"
53-
uses: github/codeql-action/upload-sarif@904260d7d935dff982205cbdb42025ce30b7a34f
53+
uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100
5454
with:
5555
sarif_file: results.sarif

analysis_options.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
analyzer:
2525
strong-mode:
26-
implicit-casts: false
27-
implicit-dynamic: false
26+
strict-casts: true
27+
strict-raw-types: true
2828
errors:
2929
# treat missing required parameters as a warning (not a hint)
3030
missing_required_param: warning
@@ -114,7 +114,7 @@ linter:
114114
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
115115
- control_flow_in_finally
116116
# - curly_braces_in_flow_control_structures # not required by flutter style
117-
# - depend_on_referenced_packages # LOCAL CHANGE - Needs to be enabled and violations fixed.
117+
- depend_on_referenced_packages
118118
- deprecated_consistency
119119
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
120120
- directives_ordering
@@ -143,7 +143,7 @@ linter:
143143
# - no_default_cases # LOCAL CHANGE - Needs to be enabled and violations fixed.
144144
- no_duplicate_case_values
145145
- no_leading_underscores_for_library_prefixes
146-
# - no_leading_underscores_for_local_identifiers # LOCAL CHANGE - Needs to be enabled and violations fixed.
146+
- no_leading_underscores_for_local_identifiers
147147
- no_logic_in_create_state
148148
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
149149
- non_constant_identifier_names
@@ -193,7 +193,7 @@ linter:
193193
# - prefer_mixin # Has false positives, see https://github.com/dart-lang/linter/issues/3018
194194
# - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere
195195
- prefer_null_aware_operators
196-
# - prefer_relative_imports # LOCAL CHANGE - Needs to be enabled and violations fixed.
196+
- prefer_relative_imports
197197
- prefer_single_quotes
198198
- prefer_spread_collections
199199
- prefer_typing_uninitialized_variables

packages/camera/camera/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
## NEXT
1+
## 0.10.0+3
22

3+
* Updates code for `no_leading_underscores_for_local_identifiers` lint.
4+
5+
## 0.10.0+2
6+
7+
* Updates imports for `prefer_relative_imports`.
38
* Updates minimum Flutter version to 2.10.
49

510
## 0.10.0+1

packages/camera/camera/example/integration_test/camera_test.dart

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,16 @@ void main() {
221221
);
222222

223223
await controller.initialize();
224-
bool _isDetecting = false;
224+
bool isDetecting = false;
225225

226226
await controller.startImageStream((CameraImage image) {
227-
if (_isDetecting) {
227+
if (isDetecting) {
228228
return;
229229
}
230230

231-
_isDetecting = true;
231+
isDetecting = true;
232232

233-
expectLater(image, isNotNull).whenComplete(() => _isDetecting = false);
233+
expectLater(image, isNotNull).whenComplete(() => isDetecting = false);
234234
});
235235

236236
expect(controller.value.isStreamingImages, true);
@@ -254,19 +254,19 @@ void main() {
254254
);
255255

256256
await controller.initialize();
257-
final Completer<CameraImage> _completer = Completer<CameraImage>();
257+
final Completer<CameraImage> completer = Completer<CameraImage>();
258258

259259
await controller.startImageStream((CameraImage image) {
260-
if (!_completer.isCompleted) {
260+
if (!completer.isCompleted) {
261261
Future<void>(() async {
262262
await controller.stopImageStream();
263263
await controller.dispose();
264264
}).then((Object? value) {
265-
_completer.complete(image);
265+
completer.complete(image);
266266
});
267267
}
268268
});
269-
return _completer.future;
269+
return completer.future;
270270
}
271271

272272
testWidgets(
@@ -277,20 +277,20 @@ void main() {
277277
return;
278278
}
279279

280-
CameraImage _image = await startStreaming(cameras, null);
281-
expect(_image, isNotNull);
282-
expect(_image.format.group, ImageFormatGroup.bgra8888);
283-
expect(_image.planes.length, 1);
280+
CameraImage image = await startStreaming(cameras, null);
281+
expect(image, isNotNull);
282+
expect(image.format.group, ImageFormatGroup.bgra8888);
283+
expect(image.planes.length, 1);
284284

285-
_image = await startStreaming(cameras, ImageFormatGroup.yuv420);
286-
expect(_image, isNotNull);
287-
expect(_image.format.group, ImageFormatGroup.yuv420);
288-
expect(_image.planes.length, 2);
285+
image = await startStreaming(cameras, ImageFormatGroup.yuv420);
286+
expect(image, isNotNull);
287+
expect(image.format.group, ImageFormatGroup.yuv420);
288+
expect(image.planes.length, 2);
289289

290-
_image = await startStreaming(cameras, ImageFormatGroup.bgra8888);
291-
expect(_image, isNotNull);
292-
expect(_image.format.group, ImageFormatGroup.bgra8888);
293-
expect(_image.planes.length, 1);
290+
image = await startStreaming(cameras, ImageFormatGroup.bgra8888);
291+
expect(image, isNotNull);
292+
expect(image.format.group, ImageFormatGroup.bgra8888);
293+
expect(image.planes.length, 1);
294294
},
295295
skip: !Platform.isIOS,
296296
);

packages/camera/camera/lib/src/camera_controller.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import 'dart:async';
66
import 'dart:math';
77

8-
import 'package:camera/camera.dart';
98
import 'package:camera_platform_interface/camera_platform_interface.dart';
109
import 'package:flutter/foundation.dart';
1110
import 'package:flutter/material.dart';
1211
import 'package:flutter/services.dart';
1312
import 'package:quiver/core.dart';
1413

14+
import '../camera.dart';
15+
1516
/// Signature for a callback receiving the a camera image.
1617
///
1718
/// This is used by [CameraController.startImageStream].
@@ -281,7 +282,7 @@ class CameraController extends ValueNotifier<CameraValue> {
281282
);
282283
}
283284
try {
284-
final Completer<CameraInitializedEvent> _initializeCompleter =
285+
final Completer<CameraInitializedEvent> initializeCompleter =
285286
Completer<CameraInitializedEvent>();
286287

287288
_deviceOrientationSubscription = CameraPlatform.instance
@@ -302,7 +303,7 @@ class CameraController extends ValueNotifier<CameraValue> {
302303
.onCameraInitialized(_cameraId)
303304
.first
304305
.then((CameraInitializedEvent event) {
305-
_initializeCompleter.complete(event);
306+
initializeCompleter.complete(event);
306307
}));
307308

308309
await CameraPlatform.instance.initializeCamera(
@@ -312,18 +313,18 @@ class CameraController extends ValueNotifier<CameraValue> {
312313

313314
value = value.copyWith(
314315
isInitialized: true,
315-
previewSize: await _initializeCompleter.future
316+
previewSize: await initializeCompleter.future
316317
.then((CameraInitializedEvent event) => Size(
317318
event.previewWidth,
318319
event.previewHeight,
319320
)),
320-
exposureMode: await _initializeCompleter.future
321+
exposureMode: await initializeCompleter.future
321322
.then((CameraInitializedEvent event) => event.exposureMode),
322-
focusMode: await _initializeCompleter.future
323+
focusMode: await initializeCompleter.future
323324
.then((CameraInitializedEvent event) => event.focusMode),
324-
exposurePointSupported: await _initializeCompleter.future.then(
325+
exposurePointSupported: await initializeCompleter.future.then(
325326
(CameraInitializedEvent event) => event.exposurePointSupported),
326-
focusPointSupported: await _initializeCompleter.future
327+
focusPointSupported: await initializeCompleter.future
327328
.then((CameraInitializedEvent event) => event.focusPointSupported),
328329
);
329330
} on PlatformException catch (e) {

0 commit comments

Comments
 (0)