Skip to content

Commit

Permalink
[wifi_info_flutter] null safety stable (flutter#3627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Yang authored and adsonpleal committed Feb 26, 2021
1 parent 41ace12 commit 0eed352
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/wifi_info_flutter/wifi_info_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.0.0-nullsafety
## 2.0.0

* Migrate to null safety.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

Expand All @@ -54,7 +54,7 @@ class _MyHomePageState extends State<MyHomePage> {
String _connectionStatus = 'Unknown';
final Connectivity _connectivity = Connectivity();
final WifiInfo _wifiInfo = WifiInfo();
StreamSubscription<ConnectivityResult> _connectivitySubscription;
late StreamSubscription<ConnectivityResult> _connectivitySubscription;

@override
void initState() {
Expand All @@ -72,7 +72,7 @@ class _MyHomePageState extends State<MyHomePage> {

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initConnectivity() async {
ConnectivityResult result;
late ConnectivityResult result;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
result = await _connectivity.checkConnectivity();
Expand Down Expand Up @@ -103,7 +103,7 @@ class _MyHomePageState extends State<MyHomePage> {
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
switch (result) {
case ConnectivityResult.wifi:
String wifiName, wifiBSSID, wifiIP;
String? wifiName, wifiBSSID, wifiIP;

try {
if (!kIsWeb && Platform.isIOS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ description: Demonstrates how to use the wifi_info_flutter plugin.
publish_to: 'none'

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"

dependencies:
connectivity: 0.4.9+3
connectivity: ^3.0.0
flutter:
sdk: flutter
wifi_info_flutter:
Expand All @@ -16,7 +16,6 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../
cupertino_icons: ^1.0.0

dev_dependencies:
integration_test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9
import 'dart:io';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9
import 'dart:convert';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';
Expand Down
6 changes: 3 additions & 3 deletions packages/wifi_info_flutter/wifi_info_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: wifi_info_flutter
description: A new flutter plugin project.
version: 2.0.0-nullsafety
homepage: https://github.com/flutter/plugins/tree/master/packages/wifi_info_flutter/wifi_info_flutter
version: 2.0.0

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.20.0"

dependencies:
flutter:
sdk: flutter
wifi_info_flutter_platform_interface: ^2.0.0-nullsafety
wifi_info_flutter_platform_interface: ^2.0.0

dev_dependencies:
integration_test:
Expand Down

0 comments on commit 0eed352

Please sign in to comment.