Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[network_info_plus] Update network_info_plus to 4.1.0 #632

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"