This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 12 files changed +45
-26
lines changed
flutter_plugin_android_lifecycle/example Expand file tree Collapse file tree 12 files changed +45
-26
lines changed Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
+ // @dart = 2.9
6
+
5
7
import 'package:android_intent/flag.dart' ;
6
8
import 'package:flutter/services.dart' ;
7
9
import 'package:flutter_test/flutter_test.dart' ;
@@ -11,7 +13,8 @@ import 'package:platform/platform.dart';
11
13
12
14
void main () {
13
15
AndroidIntent androidIntent;
14
- late MockMethodChannel mockChannel;
16
+ MockMethodChannel mockChannel;
17
+
15
18
setUp (() {
16
19
mockChannel = MockMethodChannel ();
17
20
when (mockChannel.invokeMethod <bool >('canResolveActivity' , any))
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ // @dart = 2.9
6
+
5
7
import 'package:flutter_test/flutter_test.dart' ;
6
8
import 'package:integration_test/integration_test.dart' ;
7
9
import 'package:flutter_plugin_android_lifecycle_example/main.dart' ;
Original file line number Diff line number Diff line change
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
+
1
5
// ignore_for_file: public_member_api_docs
2
6
3
7
import 'package:flutter/material.dart' ;
Original file line number Diff line number Diff line change 1
1
name : flutter_plugin_android_lifecycle_example
2
2
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"
7
3
8
4
dependencies :
9
5
flutter :
10
6
sdk : flutter
11
- integration_test :
12
- path : ../../integration_test
7
+ flutter_plugin_android_lifecycle :
8
+ path : ../
13
9
14
10
dev_dependencies :
11
+ integration_test :
12
+ path : ../../integration_test
15
13
flutter_test :
16
14
sdk : flutter
17
15
pedantic : ^1.8.0
18
16
19
- flutter_plugin_android_lifecycle :
20
- path : ../
17
+ environment :
18
+ sdk : " >=2.12.0-0 <3.0.0 "
21
19
22
20
flutter :
23
21
uses-material-design : true
Original file line number Diff line number Diff line change @@ -21,16 +21,17 @@ class MyApp extends StatefulWidget {
21
21
22
22
class _MyAppState extends State <MyApp > {
23
23
final LocalAuthentication auth = LocalAuthentication ();
24
- bool _canCheckBiometrics;
25
- List <BiometricType > _availableBiometrics;
24
+ late bool _canCheckBiometrics;
25
+ late List <BiometricType > _availableBiometrics;
26
26
String _authorized = 'Not Authorized' ;
27
27
bool _isAuthenticating = false ;
28
28
29
29
Future <void > _checkBiometrics () async {
30
- bool canCheckBiometrics;
30
+ late bool canCheckBiometrics;
31
31
try {
32
32
canCheckBiometrics = await auth.canCheckBiometrics;
33
33
} on PlatformException catch (e) {
34
+ canCheckBiometrics = false ;
34
35
print (e);
35
36
}
36
37
if (! mounted) return ;
@@ -41,10 +42,11 @@ class _MyAppState extends State<MyApp> {
41
42
}
42
43
43
44
Future <void > _getAvailableBiometrics () async {
44
- List <BiometricType > availableBiometrics;
45
+ late List <BiometricType > availableBiometrics;
45
46
try {
46
47
availableBiometrics = await auth.getAvailableBiometrics ();
47
48
} on PlatformException catch (e) {
49
+ availableBiometrics = < BiometricType > [];
48
50
print (e);
49
51
}
50
52
if (! mounted) return ;
Original file line number Diff line number Diff line change @@ -18,5 +18,5 @@ flutter:
18
18
uses-material-design : true
19
19
20
20
environment :
21
- sdk : " >=2.1. 0 <3.0.0"
21
+ sdk : " >=2.12.0- 0 <3.0.0"
22
22
flutter : " >=1.12.13+hotfix.5 <2.0.0"
Original file line number Diff line number Diff line change
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
+
1
7
import 'package:flutter_test/flutter_test.dart' ;
2
8
import 'package:integration_test/integration_test.dart' ;
3
9
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ // @dart = 2.9
6
+
5
7
import 'package:flutter_test/flutter_test.dart' ;
6
8
import 'package:share/share.dart' ;
7
9
import 'package:integration_test/integration_test.dart' ;
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ flutter:
16
16
dependencies :
17
17
meta : ^1.3.0-nullsafety.6
18
18
mime : ^1.0.0-nullsafety.0
19
+ test : ^1.16.0-nullsafety.13
19
20
flutter :
20
21
sdk : flutter
21
22
22
23
dev_dependencies :
23
- test : ^1.16.0-nullsafety.13
24
24
mockito : ^4.1.3
25
25
flutter_test :
26
26
sdk : flutter
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
+ // @dart = 2.9
6
+
5
7
import 'dart:io' ;
6
8
import 'dart:ui' ;
7
9
@@ -15,7 +17,7 @@ import 'package:flutter/services.dart';
15
17
void main () {
16
18
TestWidgetsFlutterBinding .ensureInitialized ();
17
19
18
- late MockMethodChannel mockChannel;
20
+ MockMethodChannel mockChannel;
19
21
20
22
setUp (() {
21
23
mockChannel = MockMethodChannel ();
You can’t perform that action at this time.
0 commit comments