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 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+
57import 'package:android_intent/flag.dart' ;
68import 'package:flutter/services.dart' ;
79import 'package:flutter_test/flutter_test.dart' ;
@@ -11,7 +13,8 @@ import 'package:platform/platform.dart';
1113
1214void main () {
1315 AndroidIntent androidIntent;
14- late MockMethodChannel mockChannel;
16+ MockMethodChannel mockChannel;
17+
1518 setUp (() {
1619 mockChannel = MockMethodChannel ();
1720 when (mockChannel.invokeMethod <bool >('canResolveActivity' , any))
Original file line number Diff line number Diff line change 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+
57import 'package:flutter_test/flutter_test.dart' ;
68import 'package:integration_test/integration_test.dart' ;
79import '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+
15// ignore_for_file: public_member_api_docs
26
37import 'package:flutter/material.dart' ;
Original file line number Diff line number Diff line change 11name : flutter_plugin_android_lifecycle_example
22description : 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
84dependencies :
95 flutter :
106 sdk : flutter
11- integration_test :
12- path : ../../integration_test
7+ flutter_plugin_android_lifecycle :
8+ path : ../
139
1410dev_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
2220flutter :
2321 uses-material-design : true
Original file line number Diff line number Diff line change @@ -21,16 +21,17 @@ class MyApp extends StatefulWidget {
2121
2222class _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 ;
Original file line number Diff line number Diff line change @@ -18,5 +18,5 @@ flutter:
1818 uses-material-design : true
1919
2020environment :
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"
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+
17import 'package:flutter_test/flutter_test.dart' ;
28import 'package:integration_test/integration_test.dart' ;
39
Original file line number Diff line number Diff line change 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+
57import 'package:flutter_test/flutter_test.dart' ;
68import 'package:share/share.dart' ;
79import 'package:integration_test/integration_test.dart' ;
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ flutter:
1616dependencies :
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
2223dev_dependencies :
23- test : ^1.16.0-nullsafety.13
2424 mockito : ^4.1.3
2525 flutter_test :
2626 sdk : flutter
Original file line number Diff line number Diff line change 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+
57import 'dart:io' ;
68import 'dart:ui' ;
79
@@ -15,7 +17,7 @@ import 'package:flutter/services.dart';
1517void main () {
1618 TestWidgetsFlutterBinding .ensureInitialized ();
1719
18- late MockMethodChannel mockChannel;
20+ MockMethodChannel mockChannel;
1921
2022 setUp (() {
2123 mockChannel = MockMethodChannel ();
You can’t perform that action at this time.
0 commit comments