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

Commit ad6d03c

Browse files
author
Emmanuel Garcia
authored
Merge null-safety plugins (#3324)
1 parent 0b158bd commit ad6d03c

File tree

113 files changed

+1174
-670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1174
-670
lines changed

packages/connectivity/connectivity/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 3.0.0-nullsafety.1
2+
3+
* Bump Dart SDK to support null safety.
4+
5+
## 3.0.0-nullsafety
6+
7+
* Migrate to null safety.
8+
19
## 2.0.3
210

311
* Update Flutter SDK constraint.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: ../../../analysis_options.yaml
2+
analyzer:
3+
enable-experiment:
4+
- non-nullable

packages/connectivity/connectivity/example/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MyApp extends StatelessWidget {
4040
}
4141

4242
class MyHomePage extends StatefulWidget {
43-
MyHomePage({Key key, this.title}) : super(key: key);
43+
MyHomePage({Key? key, required this.title}) : super(key: key);
4444

4545
final String title;
4646

@@ -51,7 +51,7 @@ class MyHomePage extends StatefulWidget {
5151
class _MyHomePageState extends State<MyHomePage> {
5252
String _connectionStatus = 'Unknown';
5353
final Connectivity _connectivity = Connectivity();
54-
StreamSubscription<ConnectivityResult> _connectivitySubscription;
54+
late StreamSubscription<ConnectivityResult> _connectivitySubscription;
5555

5656
@override
5757
void initState() {
@@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage> {
6969

7070
// Platform messages are asynchronous, so we initialize in an async method.
7171
Future<void> initConnectivity() async {
72-
ConnectivityResult result;
72+
ConnectivityResult result = ConnectivityResult.none;
7373
// Platform messages may fail, so we use a try/catch PlatformException.
7474
try {
7575
result = await _connectivity.checkConnectivity();

packages/connectivity/connectivity/example/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ dependencies:
1010
dev_dependencies:
1111
flutter_driver:
1212
sdk: flutter
13+
test: ^1.10.0-nullsafety.1
1314
integration_test:
1415
path: ../../../integration_test
15-
pedantic: ^1.8.0
16+
pedantic: ^1.10.0-nullsafety.1
1617

1718
flutter:
1819
uses-material-design: true

packages/connectivity/connectivity/example/test_driver/integration_test/connectivity_test.dart

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

5+
// TODO(cyanglaz): Remove once https://github.com/flutter/plugins/pull/3158 is landed.
6+
// @dart = 2.9
7+
58
import 'package:integration_test/integration_test.dart';
69
import 'package:flutter_test/flutter_test.dart';
710
import 'package:connectivity/connectivity.dart';

packages/connectivity/connectivity/integration_test/connectivity_test.dart

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

5+
// TODO(cyanglaz): Remove once https://github.com/flutter/plugins/pull/3158 is landed.
6+
// @dart = 2.9
7+
58
import 'package:integration_test/integration_test.dart';
69
import 'package:flutter_test/flutter_test.dart';
710
import 'package:connectivity/connectivity.dart';

packages/connectivity/connectivity/lib/connectivity.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class Connectivity {
2222
if (_singleton == null) {
2323
_singleton = Connectivity._();
2424
}
25-
return _singleton;
25+
return _singleton!;
2626
}
2727

2828
Connectivity._();
2929

30-
static Connectivity _singleton;
30+
static Connectivity? _singleton;
3131

3232
static ConnectivityPlatform get _platform => ConnectivityPlatform.instance;
3333

packages/connectivity/connectivity/pubspec.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: connectivity
22
description: Flutter plugin for discovering the state of the network (WiFi &
33
mobile/cellular) connectivity on Android and iOS.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity
5-
version: 2.0.3
5+
version: 3.0.0-nullsafety.1
66

77
flutter:
88
plugin:
@@ -21,21 +21,24 @@ dependencies:
2121
flutter:
2222
sdk: flutter
2323
meta: ^1.0.5
24-
connectivity_platform_interface: ^1.0.2
25-
connectivity_macos: ^0.1.0
26-
connectivity_for_web: ^0.3.0
24+
connectivity_platform_interface: ^2.0.0-nullsafety.1
25+
#TODO(cyanglaz): re-endorse the below plugins when they have migrated to nnbd.
26+
# https://github.com/flutter/flutter/issues/68669
27+
connectivity_macos: ^0.2.0-nullsafety
28+
# connectivity_for_web: ^0.3.0
2729

2830
dev_dependencies:
2931
flutter_test:
3032
sdk: flutter
3133
flutter_driver:
3234
sdk: flutter
35+
test: ^1.10.0-nullsafety.1
3336
integration_test:
3437
path: ../../integration_test
3538
mockito: ^4.1.1
36-
plugin_platform_interface: ^1.0.0
37-
pedantic: ^1.8.0
39+
plugin_platform_interface: ^1.1.0-nullsafety.1
40+
pedantic: ^1.10.0-nullsafety.1
3841

3942
environment:
40-
sdk: ">=2.1.0 <3.0.0"
43+
sdk: ">=2.12.0-0 <3.0.0"
4144
flutter: ">=1.12.13+hotfix.5"

packages/connectivity/connectivity/test/connectivity_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +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.8
6-
5+
// TODO(cyanglaz): Remove once Mockito is migrated to null safety.
6+
// @dart = 2.9
77
import 'package:connectivity/connectivity.dart';
88
import 'package:connectivity_platform_interface/connectivity_platform_interface.dart';
99
import 'package:flutter_test/flutter_test.dart';

packages/connectivity/connectivity_macos/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.0-nullsafety
2+
3+
* Update Dart SDK constraint.
4+
15
## 0.1.0+8
26

37
* Update Flutter SDK constraint.

0 commit comments

Comments
 (0)