From b6fe79d7b2d7861cf859beae0c240f31d419d077 Mon Sep 17 00:00:00 2001 From: Swanseo0 <98388769+Swanseo0@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:34:21 +0900 Subject: [PATCH] [network_info_plus] Update network_info_plus to 4.1.0 (#632) --- packages/network_info_plus/CHANGELOG.md | 4 ++- packages/network_info_plus/README.md | 4 +-- .../network_info_plus_test.dart | 26 +++++++++---------- .../network_info_plus/example/lib/main.dart | 19 +++++--------- .../network_info_plus/example/pubspec.yaml | 4 +-- packages/network_info_plus/pubspec.yaml | 6 ++--- 6 files changed, 29 insertions(+), 34 deletions(-) diff --git a/packages/network_info_plus/CHANGELOG.md b/packages/network_info_plus/CHANGELOG.md index 1818507f7..6601fe1ae 100644 --- a/packages/network_info_plus/CHANGELOG.md +++ b/packages/network_info_plus/CHANGELOG.md @@ -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 diff --git a/packages/network_info_plus/README.md b/packages/network_info_plus/README.md index 4df4830e1..9db57e6d8 100644 --- a/packages/network_info_plus/README.md +++ b/packages/network_info_plus/README.md @@ -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: diff --git a/packages/network_info_plus/example/integration_test/network_info_plus_test.dart b/packages/network_info_plus/example/integration_test/network_info_plus_test.dart index c7ed07fc8..207a63201 100644 --- a/packages/network_info_plus/example/integration_test/network_info_plus_test.dart +++ b/packages/network_info_plus/example/integration_test/network_info_plus_test.dart @@ -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); }); } diff --git a/packages/network_info_plus/example/lib/main.dart b/packages/network_info_plus/example/lib/main.dart index 87d39f312..53d24198e 100644 --- a/packages/network_info_plus/example/lib/main.dart +++ b/packages/network_info_plus/example/lib/main.dart @@ -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. @@ -27,7 +27,7 @@ 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 @@ -35,7 +35,8 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( - primarySwatch: Colors.blue, + useMaterial3: true, + colorSchemeSeed: const Color(0x9f4376f8), ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); @@ -43,12 +44,12 @@ class MyApp extends StatelessWidget { } 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 createState() => _MyHomePageState(); } class _MyHomePageState extends State { @@ -66,6 +67,7 @@ class _MyHomePageState extends State { return Scaffold( appBar: AppBar( title: const Text('NetworkInfoPlus example'), + elevation: 4, ), body: Center( child: Column( @@ -143,13 +145,6 @@ class _MyHomePageState extends State { 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' diff --git a/packages/network_info_plus/example/pubspec.yaml b/packages/network_info_plus/example/pubspec.yaml index a044e0bb5..22b5f98bb 100644 --- a/packages/network_info_plus/example/pubspec.yaml +++ b/packages/network_info_plus/example/pubspec.yaml @@ -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: ../ @@ -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 diff --git a/packages/network_info_plus/pubspec.yaml b/packages/network_info_plus/pubspec.yaml index 6faf4cdd1..fd86e76c3 100644 --- a/packages/network_info_plus/pubspec.yaml +++ b/packages/network_info_plus/pubspec.yaml @@ -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" @@ -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"