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();

0 commit comments

Comments
 (0)