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

Commit 26ae34f

Browse files
author
Emmanuel Garcia
committed
Fix analyzer
1 parent 16d759e commit 26ae34f

File tree

12 files changed

+45
-26
lines changed

12 files changed

+45
-26
lines changed

packages/android_intent/test/android_intent_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// @dart = 2.9
6+
57
import 'package:android_intent/flag.dart';
68
import 'package:flutter/services.dart';
79
import 'package:flutter_test/flutter_test.dart';
@@ -11,7 +13,8 @@ import 'package:platform/platform.dart';
1113

1214
void main() {
1315
AndroidIntent androidIntent;
14-
late MockMethodChannel mockChannel;
16+
MockMethodChannel mockChannel;
17+
1518
setUp(() {
1619
mockChannel = MockMethodChannel();
1720
when(mockChannel.invokeMethod<bool>('canResolveActivity', any))

packages/flutter_plugin_android_lifecycle/example/integration_test/flutter_plugin_android_lifecycle_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart = 2.9
6+
57
import 'package:flutter_test/flutter_test.dart';
68
import 'package:integration_test/integration_test.dart';
79
import 'package:flutter_plugin_android_lifecycle_example/main.dart';

packages/flutter_plugin_android_lifecycle/example/lib/main.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2019, the Chromium project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
15
// ignore_for_file: public_member_api_docs
26

37
import 'package:flutter/material.dart';
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
name: flutter_plugin_android_lifecycle_example
22
description: Demonstrates how to use the flutter_plugin_android_lifecycle plugin.
3-
publish_to: 'none'
4-
5-
environment:
6-
sdk: ">=2.12.0-0 <3.0.0"
73

84
dependencies:
95
flutter:
106
sdk: flutter
11-
integration_test:
12-
path: ../../integration_test
7+
flutter_plugin_android_lifecycle:
8+
path: ../
139

1410
dev_dependencies:
11+
integration_test:
12+
path: ../../integration_test
1513
flutter_test:
1614
sdk: flutter
1715
pedantic: ^1.8.0
1816

19-
flutter_plugin_android_lifecycle:
20-
path: ../
17+
environment:
18+
sdk: ">=2.12.0-0 <3.0.0"
2119

2220
flutter:
2321
uses-material-design: true

packages/local_auth/example/lib/main.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ class MyApp extends StatefulWidget {
2121

2222
class _MyAppState extends State<MyApp> {
2323
final LocalAuthentication auth = LocalAuthentication();
24-
bool _canCheckBiometrics;
25-
List<BiometricType> _availableBiometrics;
24+
late bool _canCheckBiometrics;
25+
late List<BiometricType> _availableBiometrics;
2626
String _authorized = 'Not Authorized';
2727
bool _isAuthenticating = false;
2828

2929
Future<void> _checkBiometrics() async {
30-
bool canCheckBiometrics;
30+
late bool canCheckBiometrics;
3131
try {
3232
canCheckBiometrics = await auth.canCheckBiometrics;
3333
} on PlatformException catch (e) {
34+
canCheckBiometrics = false;
3435
print(e);
3536
}
3637
if (!mounted) return;
@@ -41,10 +42,11 @@ class _MyAppState extends State<MyApp> {
4142
}
4243

4344
Future<void> _getAvailableBiometrics() async {
44-
List<BiometricType> availableBiometrics;
45+
late List<BiometricType> availableBiometrics;
4546
try {
4647
availableBiometrics = await auth.getAvailableBiometrics();
4748
} on PlatformException catch (e) {
49+
availableBiometrics = <BiometricType>[];
4850
print(e);
4951
}
5052
if (!mounted) return;

packages/local_auth/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ flutter:
1818
uses-material-design: true
1919

2020
environment:
21-
sdk: ">=2.1.0 <3.0.0"
21+
sdk: ">=2.12.0-0 <3.0.0"
2222
flutter: ">=1.12.13+hotfix.5 <2.0.0"

packages/local_auth/integration_test/local_auth_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Copyright 2017 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// @dart = 2.9
6+
17
import 'package:flutter_test/flutter_test.dart';
28
import 'package:integration_test/integration_test.dart';
39

packages/share/integration_test/share_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart = 2.9
6+
57
import 'package:flutter_test/flutter_test.dart';
68
import 'package:share/share.dart';
79
import 'package:integration_test/integration_test.dart';

packages/share/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ flutter:
1616
dependencies:
1717
meta: ^1.3.0-nullsafety.6
1818
mime: ^1.0.0-nullsafety.0
19+
test: ^1.16.0-nullsafety.13
1920
flutter:
2021
sdk: flutter
2122

2223
dev_dependencies:
23-
test: ^1.16.0-nullsafety.13
2424
mockito: ^4.1.3
2525
flutter_test:
2626
sdk: flutter

packages/share/test/share_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// @dart = 2.9
6+
57
import 'dart:io';
68
import 'dart:ui';
79

@@ -15,7 +17,7 @@ import 'package:flutter/services.dart';
1517
void main() {
1618
TestWidgetsFlutterBinding.ensureInitialized();
1719

18-
late MockMethodChannel mockChannel;
20+
MockMethodChannel mockChannel;
1921

2022
setUp(() {
2123
mockChannel = MockMethodChannel();

packages/webview_flutter/example/integration_test/webview_flutter_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ void main() {
358358
videoTestBase64 = base64Encode(const Utf8Encoder().convert(videoTest));
359359
});
360360

361-
test('Auto media playback', () async {
361+
testWidgets('Auto media playback', (WidgetTester tester) async {
362362
Completer<WebViewController> controllerCompleter =
363363
Completer<WebViewController>();
364364
Completer<void> pageLoaded = Completer<void>();
365365

366-
await pumpWidget(
366+
await tester.pumpWidget(
367367
Directionality(
368368
textDirection: TextDirection.ltr,
369369
child: WebView(
@@ -390,7 +390,7 @@ void main() {
390390
pageLoaded = Completer<void>();
391391

392392
// We change the key to re-create a new webview as we change the initialMediaPlaybackPolicy
393-
await pumpWidget(
393+
await tester.pumpWidget(
394394
Directionality(
395395
textDirection: TextDirection.ltr,
396396
child: WebView(
@@ -416,13 +416,13 @@ void main() {
416416
expect(isPaused, _webviewBool(true));
417417
});
418418

419-
test('Changes to initialMediaPlaybackPolicy are ignored', () async {
419+
testWidgets('Changes to initialMediaPlaybackPolicy are ignored', (WidgetTester tester) async {
420420
final Completer<WebViewController> controllerCompleter =
421421
Completer<WebViewController>();
422422
Completer<void> pageLoaded = Completer<void>();
423423

424424
final GlobalKey key = GlobalKey();
425-
await pumpWidget(
425+
await tester.pumpWidget(
426426
Directionality(
427427
textDirection: TextDirection.ltr,
428428
child: WebView(
@@ -447,7 +447,7 @@ void main() {
447447

448448
pageLoaded = Completer<void>();
449449

450-
await pumpWidget(
450+
await tester.pumpWidget(
451451
Directionality(
452452
textDirection: TextDirection.ltr,
453453
child: WebView(
@@ -474,12 +474,12 @@ void main() {
474474
expect(isPaused, _webviewBool(false));
475475
});
476476

477-
test('Video plays inline when allowsInlineMediaPlayback is true', () async {
477+
testWidgets('Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async {
478478
Completer<WebViewController> controllerCompleter =
479479
Completer<WebViewController>();
480480
Completer<void> pageLoaded = Completer<void>();
481481

482-
await pumpWidget(
482+
await tester.pumpWidget(
483483
Directionality(
484484
textDirection: TextDirection.ltr,
485485
child: WebView(
@@ -507,7 +507,7 @@ void main() {
507507
controllerCompleter = Completer<WebViewController>();
508508
pageLoaded = Completer<void>();
509509

510-
await pumpWidget(
510+
await tester.pumpWidget(
511511
Directionality(
512512
textDirection: TextDirection.ltr,
513513
child: WebView(

packages/webview_flutter/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: webview_flutter_example
22
description: Demonstrates how to use the webview_flutter plugin.
33

44
environment:
5-
sdk: ">=2.0.0-dev.68.0 <3.0.0"
5+
sdk: ">=2.12.0-0 <3.0.0"
66

77
dependencies:
88
flutter:

0 commit comments

Comments
 (0)