This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +21
-17
lines changed Expand file tree Collapse file tree 6 files changed +21
-17
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.0.0-nullsafety
2
+
3
+ * Migrate to null safety.
4
+
1
5
## 1.0.11
2
6
3
7
* Update the example app: remove the deprecated ` RaisedButton ` and ` FlatButton ` widgets.
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class MyApp extends StatelessWidget {
27
27
}
28
28
29
29
class MyHomePage extends StatefulWidget {
30
- MyHomePage ({Key key, this .title}) : super (key: key);
30
+ MyHomePage ({Key ? key, required this .title}) : super (key: key);
31
31
32
32
final String title;
33
33
@@ -36,10 +36,10 @@ class MyHomePage extends StatefulWidget {
36
36
}
37
37
38
38
class _MyHomePageState extends State <MyHomePage > {
39
- Battery _battery = Battery ();
39
+ final Battery _battery = Battery ();
40
40
41
- BatteryState _batteryState;
42
- StreamSubscription <BatteryState > _batteryStateSubscription;
41
+ BatteryState ? _batteryState;
42
+ late StreamSubscription <BatteryState > _batteryStateSubscription;
43
43
44
44
@override
45
45
void initState () {
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ dev_dependencies:
12
12
sdk : flutter
13
13
integration_test :
14
14
path : ../../../integration_test
15
- pedantic : ^1.8.0
15
+ pedantic : ^1.10.0-nullsafety
16
16
17
17
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 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:battery/battery.dart' ;
7
9
import 'package:integration_test/integration_test.dart' ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: battery
2
2
description : Flutter plugin for accessing information about the battery state
3
3
(full, charging, discharging) on Android and iOS.
4
4
homepage : https://github.com/flutter/plugins/tree/master/packages/battery/battery
5
- version : 1 .0.11
5
+ version : 2 .0.0-nullsafety
6
6
7
7
flutter :
8
8
plugin :
@@ -16,20 +16,18 @@ flutter:
16
16
dependencies :
17
17
flutter :
18
18
sdk : flutter
19
- meta : ^1.0.5
20
- battery_platform_interface : ^1 .0.0
19
+ meta : ^1.3.0-nullsafety
20
+ battery_platform_interface : ^2 .0.0-nullsafety
21
21
22
22
dev_dependencies :
23
- async : ^2.0.8
24
- test : ^1.3.0
25
- mockito : ^4.1.1
23
+ mockito : ^5.0.0-nullsafety.0
26
24
flutter_test :
27
25
sdk : flutter
28
- plugin_platform_interface : ^1.0.0
26
+ plugin_platform_interface : ^1.1.0-nullsafety
29
27
integration_test :
30
28
path : ../../integration_test
31
- pedantic : ^1.8.0
29
+ pedantic : ^1.10.0-nullsafety
32
30
33
31
environment :
34
- sdk : " >=2.1. 0 <3.0.0"
32
+ sdk : " >=2.12.0- 0 <3.0.0"
35
33
flutter : " >=1.12.13+hotfix.5"
Original file line number Diff line number Diff line change 5
5
import 'dart:async' ;
6
6
7
7
import 'package:battery_platform_interface/battery_platform_interface.dart' ;
8
+ import 'package:flutter_test/flutter_test.dart' ;
8
9
import 'package:plugin_platform_interface/plugin_platform_interface.dart' ;
9
- import 'package:test/test.dart' ;
10
10
import 'package:battery/battery.dart' ;
11
11
import 'package:mockito/mockito.dart' ;
12
12
13
13
void main () {
14
14
group ('battery' , () {
15
- Battery battery;
15
+ late Battery battery;
16
16
MockBatteryPlatform fakePlatform;
17
17
setUp (() async {
18
18
fakePlatform = MockBatteryPlatform ();
You can’t perform that action at this time.
0 commit comments