Skip to content

Commit

Permalink
[network_info_plus] Update network_info_plus to 4.1.0 (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanseo0 authored Nov 30, 2023
1 parent 54f8d05 commit b6fe79d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 34 deletions.
4 changes: 3 additions & 1 deletion packages/network_info_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT
## 1.1.4

* Update network_info_plus to 4.1.0.
* Update network_info_plus_platform_interface to 1.1.3.
* Increase the minimum Flutter version to 3.3.

## 1.1.3
Expand Down
4 changes: 2 additions & 2 deletions packages/network_info_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `network_info_plus`. Therefo

```yaml
dependencies:
network_info_plus: ^2.3.2
network_info_plus_tizen: ^1.1.3
network_info_plus: ^4.1.0
network_info_plus_tizen: ^1.1.4
```
Then you can import `network_info_plus` in your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@ import 'package:network_info_plus/network_info_plus.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('NetworkInfo test driver', () {
late NetworkInfo _networkInfo;
late NetworkInfo networkInfo;

setUpAll(() async {
_networkInfo = NetworkInfo();
});
setUpAll(() async {
networkInfo = NetworkInfo();
});

testWidgets('test non-null network value', (WidgetTester tester) async {
expect(_networkInfo.getWifiName(), isNotNull);
expect(_networkInfo.getWifiBSSID(), isNotNull);
expect(_networkInfo.getWifiIP(), isNotNull);
expect(_networkInfo.getWifiIPv6(), isNotNull);
expect(_networkInfo.getWifiSubmask(), isNotNull);
expect(_networkInfo.getWifiGatewayIP(), isNotNull);
expect(_networkInfo.getWifiBroadcast(), isNotNull);
});
testWidgets('test non-null network value', (WidgetTester tester) async {
expect(networkInfo.getWifiName(), isNotNull);
expect(networkInfo.getWifiBSSID(), isNotNull);
expect(networkInfo.getWifiIP(), isNotNull);
expect(networkInfo.getWifiIPv6(), isNotNull);
expect(networkInfo.getWifiSubmask(), isNotNull);
expect(networkInfo.getWifiGatewayIP(), isNotNull);
expect(networkInfo.getWifiBroadcast(), isNotNull);
});
}
19 changes: 7 additions & 12 deletions packages/network_info_plus/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import 'dart:async';
import 'dart:developer' as developer;
import 'dart:io';

import 'package:network_info_plus/network_info_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:network_info_plus/network_info_plus.dart';

// Sets a platform override for desktop to avoid exceptions. See
// https://flutter.dev/desktop#target-platform-override for more info.
Expand All @@ -27,28 +27,29 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
colorSchemeSeed: const Color(0x9f4376f8),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

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

final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand All @@ -66,6 +67,7 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
appBar: AppBar(
title: const Text('NetworkInfoPlus example'),
elevation: 4,
),
body: Center(
child: Column(
Expand Down Expand Up @@ -143,13 +145,6 @@ class _MyHomePageState extends State<MyHomePage> {
wifiGatewayIP = 'Failed to get Wifi gateway address';
}

try {
wifiSubmask = await _networkInfo.getWifiSubmask();
} on PlatformException catch (e) {
developer.log('Failed to get Wifi submask', error: e);
wifiSubmask = 'Failed to get Wifi submask';
}

setState(() {
_connectionStatus = 'Wifi Name: $wifiName\n'
'Wifi BSSID: $wifiBSSID\n'
Expand Down
4 changes: 2 additions & 2 deletions packages/network_info_plus/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
network_info_plus: ^2.3.2
network_info_plus: ^4.1.0
network_info_plus_tizen:
path: ../

Expand All @@ -20,7 +20,7 @@ dev_dependencies:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/
flutter_lints: ^1.0.4
flutter_lints: ^3.0.1

flutter:
uses-material-design: true
6 changes: 3 additions & 3 deletions packages/network_info_plus/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: network_info_plus_tizen
description: Tizen implementation of the network_info_plus plugin
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/network_info_plus
version: 1.1.3
version: 1.1.4

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -18,7 +18,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
network_info_plus_platform_interface: ^1.1.2
network_info_plus_platform_interface: ^1.1.3

dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ">=2.0.1 <4.0.0"

0 comments on commit b6fe79d

Please sign in to comment.