From 75f4b28401f716148f5c0812cccfd997bd644dae Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 19:25:45 +0530 Subject: [PATCH 01/25] Archive full windows Release folder --- .github/workflows/flutter_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/flutter_release.yml b/.github/workflows/flutter_release.yml index 5d2a98c..0ed1132 100644 --- a/.github/workflows/flutter_release.yml +++ b/.github/workflows/flutter_release.yml @@ -210,7 +210,6 @@ jobs: type: 'zip' filename: ${{ env.WINDOWS_ZIP }} directory: ${{ env.WINDOWS_BUILD_PATH }} - path: vernet.exe - name: Publish Windows Release uses: softprops/action-gh-release@v1 From 98790a9b2f47f1a10da295c61aee635e949c0dac Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 19:31:35 +0530 Subject: [PATCH 02/25] archive full macos --- .github/workflows/flutter_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/flutter_release.yml b/.github/workflows/flutter_release.yml index 0ed1132..ff7a09a 100644 --- a/.github/workflows/flutter_release.yml +++ b/.github/workflows/flutter_release.yml @@ -159,7 +159,6 @@ jobs: type: 'zip' filename: ${{ env.MACOS_ZIP }} directory: ${{ env.MACOS_BUILD_PATH }} - path: vernet.app - name: Install Node 18 uses: actions/setup-node@v4 From 8aa972dd2ecfcec500bba5345e3756013eaf2506 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 19:33:14 +0530 Subject: [PATCH 03/25] Pre-release 1.1.0+30 --- android/fastlane/metadata/android/en-US/changelogs/30.txt | 1 + pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 android/fastlane/metadata/android/en-US/changelogs/30.txt diff --git a/android/fastlane/metadata/android/en-US/changelogs/30.txt b/android/fastlane/metadata/android/en-US/changelogs/30.txt new file mode 100644 index 0000000..8205805 --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/30.txt @@ -0,0 +1 @@ +Fixed dll files missing when running app on Windows \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 091f4a5..b2dcead 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A Network Analyzer publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.1.0+29 +version: 1.1.0+30 environment: sdk: ">=2.17.0 <3.0.0" From f4d0cac08172fb410170b72f22510cdcc0fa98de Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 21:57:14 +0530 Subject: [PATCH 04/25] Fix for windows and beta lane --- android/fastlane/Fastfile | 12 ++++++++++++ lib/pages/home_page.dart | 8 +++++++- .../host_scan_bloc/host_scan_bloc.dart | 7 ++++++- lib/repository/notification_service.dart | 3 +++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 396ffc8..6eba091 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -23,6 +23,18 @@ platform :android do desc "Submit a new Beta Build to Crashlytics Beta" lane :beta do + upload_to_play_store(skip_upload_metadata: true, + skip_upload_changelogs: true, + skip_upload_images: true, + skip_upload_screenshots: true, + track: 'beta', aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab') + + # sh "your_script.sh" + # You can also use other beta testing services here + end + + desc "Submit a new Beta Build to Crashlytics Beta" + lane :beta_full do upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/storeRelease/app-store-release.aab') # sh "your_script.sh" diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 0efe4e9..107188b 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -45,9 +45,15 @@ class _WifiDetailState extends State { final wifiIP = await NetworkInfo().getWifiIP(); final wifiBSSID = await NetworkInfo().getWifiBSSID(); final wifiName = await NetworkInfo().getWifiName(); + String? wifiGatewayIP; + try { + wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); + } on Exception catch (e) { + debugPrint('Unimplemented error $e'); + } final gatewayIp = appSettings.customSubnet.isNotEmpty ? appSettings.customSubnet - : await NetworkInfo().getWifiGatewayIP() ?? ''; + : (wifiGatewayIP ?? wifiIP) ?? ''; final bool isLocationOn = (Platform.isAndroid || Platform.isIOS) && await Permission.location.serviceStatus.isEnabled; _wifiInfo = WifiInfo( diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index e28a589..222b270 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -58,7 +58,12 @@ class HostScanBloc extends Bloc { } Future initializeWifiParameters(Emitter emit) async { - final wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); + String? wifiGatewayIP; + try { + wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); + } on Exception catch (e) { + debugPrint("Not implemented $e"); + } ip = await NetworkInfo().getWifiIP(); if (appSettings.customSubnet.isNotEmpty) { gatewayIp = appSettings.customSubnet; diff --git a/lib/repository/notification_service.dart b/lib/repository/notification_service.dart index 48abb00..53d5941 100644 --- a/lib/repository/notification_service.dart +++ b/lib/repository/notification_service.dart @@ -50,6 +50,7 @@ class NotificationService { StreamController.broadcast(); static Future initNotification() async { + if (Platform.isWindows) return Future.value(); await _configureLocalTimeZone(); final NotificationAppLaunchDetails? notificationAppLaunchDetails = !kIsWeb && Platform.isLinux @@ -141,6 +142,7 @@ class NotificationService { } static Future showNotificationWithActions() async { + if (Platform.isWindows) return Future.value(); const AndroidNotificationDetails androidNotificationDetails = AndroidNotificationDetails( 'your channel id', @@ -193,6 +195,7 @@ class NotificationService { } static Future grantPermissions() async { + if (Platform.isWindows) return Future.value(); await _isAndroidPermissionGranted(); await _requestPermissions(); } From f306cf3d317c7c4f6153003829045e9e5f5323bd Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 22:03:26 +0530 Subject: [PATCH 05/25] Prepare v1.1.0+31 --- android/fastlane/metadata/android/en-US/changelogs/31.txt | 2 ++ pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 android/fastlane/metadata/android/en-US/changelogs/31.txt diff --git a/android/fastlane/metadata/android/en-US/changelogs/31.txt b/android/fastlane/metadata/android/en-US/changelogs/31.txt new file mode 100644 index 0000000..0b31331 --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/31.txt @@ -0,0 +1,2 @@ +Compatibility issues fixed for windows +Scan slowness improved \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index b2dcead..5bdf227 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A Network Analyzer publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.1.0+30 +version: 1.1.0+31 environment: sdk: ">=2.17.0 <3.0.0" From bda3e83a0fcb73e132385ed2df7edf805072cd81 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 22:15:21 +0530 Subject: [PATCH 06/25] updated readme --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 047853c..94515a3 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,19 @@ Note: macOS build hasn't been notarized yet. 4. Extract downloaded zip file. 5. Go to bundle folder and double click vernet file. +### Instruction for Windows +1. Star this repository. +2. Download vernet-windows.zip from [releases](https://github.com/git-elliot/vernet/releases/latest) +3. Extract downloaded zip file. +4. Run vernet.exe +5. Click on more info, tap on 'Run anyway'. +5. Give permission if asked. + ## Contributors Required -1. Linux/Windows Tester -2. Documenter +1. Technical writer -Drop mail at fs0c19ty@protonmail.com +Write us at fs0c19ty@protonmail.com ## Publishing to F-droid You can follow this guide to publish your app to f-droid - https://op3nsoc13ty.blogspot.com/2021/06/publish-your-first-flutter-app-to-fdroid.html From 8db98e8ae84876df824a1353881f8ff0248f427c Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sat, 16 Nov 2024 22:35:49 +0530 Subject: [PATCH 07/25] bug fix for windows --- android/fastlane/metadata/android/en-US/changelogs/32.txt | 2 ++ lib/pages/home_page.dart | 2 +- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 android/fastlane/metadata/android/en-US/changelogs/32.txt diff --git a/android/fastlane/metadata/android/en-US/changelogs/32.txt b/android/fastlane/metadata/android/en-US/changelogs/32.txt new file mode 100644 index 0000000..0b31331 --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/32.txt @@ -0,0 +1,2 @@ +Compatibility issues fixed for windows +Scan slowness improved \ No newline at end of file diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 107188b..284376f 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -48,7 +48,7 @@ class _WifiDetailState extends State { String? wifiGatewayIP; try { wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); - } on Exception catch (e) { + } catch (e) { debugPrint('Unimplemented error $e'); } final gatewayIp = appSettings.customSubnet.isNotEmpty diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 222b270..d829711 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -61,8 +61,8 @@ class HostScanBloc extends Bloc { String? wifiGatewayIP; try { wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); - } on Exception catch (e) { - debugPrint("Not implemented $e"); + } catch (e) { + debugPrint('Unimplemented error $e'); } ip = await NetworkInfo().getWifiIP(); if (appSettings.customSubnet.isNotEmpty) { diff --git a/pubspec.yaml b/pubspec.yaml index 5bdf227..62f9cd9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A Network Analyzer publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.1.0+31 +version: 1.1.0+32 environment: sdk: ">=2.17.0 <3.0.0" From a09f752f9bc3ed6788be393dcd5f29e314de2d8a Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 22:31:40 +0530 Subject: [PATCH 08/25] Upgrade dependencies --- lib/repository/notification_service.dart | 2 - pubspec.lock | 131 +++++++++++++---------- pubspec.yaml | 57 +++++----- 3 files changed, 102 insertions(+), 88 deletions(-) diff --git a/lib/repository/notification_service.dart b/lib/repository/notification_service.dart index 53d5941..112de85 100644 --- a/lib/repository/notification_service.dart +++ b/lib/repository/notification_service.dart @@ -121,12 +121,10 @@ class NotificationService { switch (notificationResponse.notificationResponseType) { case NotificationResponseType.selectedNotification: selectNotificationStream.add(notificationResponse.payload); - break; case NotificationResponseType.selectedNotificationAction: if (notificationResponse.actionId == navigationActionId) { selectNotificationStream.add(notificationResponse.payload); } - break; } }, ); diff --git a/pubspec.lock b/pubspec.lock index fc4a12e..98afa81 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "61.0.0" - analyzer: + version: "72.0.0" + _macros: dependency: transitive + description: dart + source: sdk + version: "0.3.2" + analyzer: + dependency: "direct overridden" description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.7.0" ansicolor: dependency: transitive description: @@ -237,10 +242,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.7" dartx: dependency: transitive description: @@ -261,10 +266,10 @@ packages: dependency: "direct main" description: name: external_app_launcher - sha256: fb55cddd706c62ede11056750d5e018ef379820e09739e967873211dd537d833 + sha256: a80847a8e24cce37f1c953ec20a9600c3b12167e279b5868945e880cea717bf7 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" fake_async: dependency: transitive description: @@ -273,14 +278,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - fake_http_client: - dependency: transitive - description: - name: fake_http_client - sha256: "4d9be8662a5424f04b95f616f5af9d8041744ad018e5c93f6583e6cf2d3f502d" - url: "https://pub.dev" - source: hosted - version: "1.0.0" ffi: dependency: transitive description: @@ -343,26 +340,26 @@ packages: dependency: "direct main" description: name: flutter_local_notifications - sha256: "674173fd3c9eda9d4c8528da2ce0ea69f161577495a9cc835a2a4ecd7eadeb35" + sha256: ef41ae901e7529e52934feba19ed82827b11baa67336829564aeab3129460610 url: "https://pub.dev" source: hosted - version: "17.2.4" + version: "18.0.1" flutter_local_notifications_linux: dependency: transitive description: name: flutter_local_notifications_linux - sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af + sha256: "8f685642876742c941b29c32030f6f4f6dacd0e4eaecb3efbb187d6a3812ca01" url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "5.0.0" flutter_local_notifications_platform_interface: dependency: transitive description: name: flutter_local_notifications_platform_interface - sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66" + sha256: "6c5b83c86bf819cdb177a9247a3722067dd8cc6313827ce7c77a4b238a26fd52" url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "8.0.0" flutter_native_splash: dependency: "direct main" description: @@ -393,10 +390,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1 + sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.7" freezed_annotation: dependency: "direct main" description: @@ -422,10 +419,10 @@ packages: dependency: "direct main" description: name: get_it - sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1 + sha256: c49895c1ecb0ee2a0ec568d39de882e2c299ba26355aa6744ab1001f98cebd15 url: "https://pub.dev" source: hosted - version: "7.7.0" + version: "8.0.2" glob: dependency: transitive description: @@ -510,10 +507,10 @@ packages: dependency: "direct dev" description: name: injectable_generator - sha256: "7fb573114f8bbdd169f7ae9b0bcd13f464e8170454c27be816d5a1bb39ac8086" + sha256: af403d76c7b18b4217335e0075e950cd0579fd7f8d7bd47ee7c85ada31680ba1 url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.6.2" integration_test: dependency: "direct dev" description: flutter @@ -523,10 +520,10 @@ packages: dependency: transitive description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: "99f282cb0e02edcbbf8c6b3bbc7c90b65635156c412e58f3975a7e55284ce685" url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.20.0" io: dependency: transitive description: @@ -631,6 +628,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -683,18 +688,18 @@ packages: dependency: "direct main" description: name: network_info_plus - sha256: "4601b815b1c6a46d84839f65cd774a7d999738471d910fae00d813e9e98b04e1" + sha256: bf9e39e523e9951d741868dc33ac386b0bc24301e9b7c8a7d60dbc34879150a8 url: "https://pub.dev" source: hosted - version: "4.1.0+1" + version: "6.1.1" network_info_plus_platform_interface: dependency: transitive description: name: network_info_plus_platform_interface - sha256: "881f5029c5edaf19c616c201d3d8b366c5b1384afd5c1da5a49e4345de82fb8b" + sha256: b7f35f4a7baef511159e524499f3c15464a49faa5ec10e92ee0bce265e664906 url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "2.0.1" network_tools: dependency: transitive description: @@ -707,10 +712,10 @@ packages: dependency: "direct main" description: name: network_tools_flutter - sha256: "4c30dc1a472b29356d4103320b68a43ec968e541a119efcc89ea8dd9aa18740f" + sha256: "45eca9589c271258fb14fc5e5542d880039d822f882190a05fff8d9bbce2fb8f" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" nm: dependency: transitive description: @@ -723,50 +728,50 @@ packages: dependency: transitive description: name: nsd - sha256: "88a3ba4e6dc38363f1256b4b482abdeec396d99df31a064d545e559cb4cb6ba9" + sha256: b20c4e7b11b40085163c2736c27e3d450c3970512ddab7ea5f144586fb0105d3 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "3.0.0" nsd_android: dependency: transitive description: name: nsd_android - sha256: "7a38d0b2d21f1e578cd3020940b95b22d5260413dc0c8cf30a987a4e410b166d" + sha256: "9e2c1d31a36c9b7f5bad6329f3d9e07c7f09e7a7394aa2f54db701516ac149eb" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "2.0.0" nsd_ios: dependency: transitive description: name: nsd_ios - sha256: "7034134dd89595362d5e464030081b0d542120a558ab7fe6227df44365df3e8a" + sha256: "43b53bdcf0cedf7c481125e6a7e4a88c745de2e48a205404be3b4e91d77798b5" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.0" nsd_macos: dependency: transitive description: name: nsd_macos - sha256: "2403b8d599f50fc9179db1420a0ffc25bfa8bbeb814aa31ca0a71f804fc938da" + sha256: db1a07f4baf358b9d72ff9eb308c83419c60a57ef8c6d1e0369075825b835b43 url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.0" nsd_platform_interface: dependency: transitive description: name: nsd_platform_interface - sha256: "2f4033fa13cc45375253bf348abdb9712004e656462205543ec9506b43c67bb2" + sha256: "726bba1b93e18a37252623fd6490bafe6f3d7c225bff50421b7eeb7c47704d4b" url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.0.0" nsd_windows: dependency: transitive description: name: nsd_windows - sha256: "06601efdd3268cbce4b90f8e23ae1dab445c97c661fba417821ce118add722e7" + sha256: "78910ac981ae0ab975cf4c30895512576220aed3dd57c3378a05eebe8e13ff88" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" package_config: dependency: transitive description: @@ -779,18 +784,18 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + sha256: da8d9ac8c4b1df253d1a328b7bf01ae77ef132833479ab40763334db13b91cce url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "8.1.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" path: dependency: transitive description: @@ -1092,6 +1097,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -1168,10 +1181,10 @@ packages: dependency: "direct main" description: name: timezone - sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d" + sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d url: "https://pub.dev" source: hosted - version: "0.9.4" + version: "0.10.0" timing: dependency: transitive description: @@ -1264,10 +1277,10 @@ packages: dependency: transitive description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "4.5.1" vector_math: dependency: transitive description: @@ -1296,10 +1309,10 @@ packages: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "0.5.1" web_socket: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 62f9cd9..abf8405 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,38 +6,38 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.1.0+32 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.2.0 <4.0.0" dependencies: # Automatically resizes text to fit perfectly within its bounds. auto_size_text: ^3.0.0 # Helps implement the BLoC pattern. - bloc: ^8.1.0 + bloc: ^8.1.4 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.5 - dart_ping: ^9.0.0 - external_app_launcher: ^3.1.0 + cupertino_icons: ^1.0.8 + dart_ping: ^9.0.1 + external_app_launcher: ^4.0.0 flutter: sdk: flutter # Bloc for state management, replace StatefulWidget - flutter_bloc: ^8.1.1 + flutter_bloc: ^8.1.6 # A cross platform plugin for displaying local notifications. - flutter_local_notifications: ^17.2.2 + flutter_local_notifications: ^18.0.1 # Native splash screen plugin - flutter_native_splash: ^2.4.0 + flutter_native_splash: ^2.4.2 # A flutter plugin for getting the local timezone of the OS. - flutter_timezone: ^3.0.0 + flutter_timezone: ^3.0.1 # Annotations for freezed - freezed_annotation: ^2.4.1 + freezed_annotation: ^2.4.4 # Service locator - get_it: ^7.2.0 + get_it: ^8.0.2 # A composable, multi-platform, Future-based API for HTTP requests. - http: ^1.1.0 + http: ^1.2.2 # A Flutter plugin that lets you show a review pop up where users can leave a review in_app_review: ^2.0.9 # Convenient code generator for get_it - injectable: ^2.1.0 + injectable: ^2.5.0 # database for flutter isar: ^3.1.0+1 # contains Isar Core @@ -45,25 +45,25 @@ dependencies: # An easy way to create a new isolate, keep it running and communicate with it. isolate_contactor: ^2.0.0+1 # Discover network info and configure themselves accordingly - json_annotation: ^4.8.1 - network_info_plus: ^4.0.2 + json_annotation: ^4.9.0 + network_info_plus: ^6.1.1 # Helps you discover open ports, devices on subnet and more. network_tools_flutter: ^2.0.2 # Querying information about the application package, such as CFBundleVersion - package_info_plus: ^4.1.0 - path_provider: ^2.1.1 + package_info_plus: ^8.1.1 + path_provider: ^2.1.5 # Allows you to display progress widgets based on percentage. - percent_indicator: ^4.2.2 + percent_indicator: ^4.2.3 # Popup that ask for the requested permission - permission_handler: ^11.0.0 + permission_handler: ^11.3.1 # A wrapper around InheritedWidget to make them easier to use and more reusable. - provider: ^6.0.4 + provider: ^6.1.2 # Reading and writing simple key-value pairs - shared_preferences: ^2.0.15 + shared_preferences: ^2.3.3 # Time zone database and time zone aware DateTime. - timezone: ^0.9.4 + timezone: ^0.10.0 # Plugin for launching a URL - url_launcher: ^6.1.6 + url_launcher: ^6.3.1 dev_dependencies: # A build system for Dart code generation and modular compilation. @@ -72,15 +72,18 @@ dev_dependencies: flutter_test: sdk: flutter # Code generator for unions/pattern-matching/copy. - freezed: ^2.5.0 + freezed: ^2.5.7 # Convenient code generator for get_it. - injectable_generator: ^2.1.4 + injectable_generator: ^2.6.2 integration_test: sdk: flutter isar_generator: ^3.1.0+1 # Collection of lint rules for Dart and Flutter projects. - json_serializable: ^6.7.1 - lint: ^2.0.1 + json_serializable: ^6.8.0 + lint: ^2.3.0 + +dependency_overrides: + analyzer: ^6.3.0 flutter: From c3d33f77efa1bee195444686bbf1ac1a03851c07 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 22:35:40 +0530 Subject: [PATCH 09/25] removed listener --- lib/models/wifi_info.dart | 8 ++++---- lib/repository/notification_service.dart | 11 ----------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/models/wifi_info.dart b/lib/models/wifi_info.dart index ba0c583..85922b7 100644 --- a/lib/models/wifi_info.dart +++ b/lib/models/wifi_info.dart @@ -22,15 +22,15 @@ class WifiInfo { static const String noWifiName = 'Wi-Fi'; String get name { - if (_name == null || _name!.isEmpty) return noWifiName; - if (_name!.startsWith('"') && _name!.endsWith('"')) { - final array = _name!.split('"'); + if (_name == null || _name.isEmpty) return noWifiName; + if (_name.startsWith('"') && _name.endsWith('"')) { + final array = _name.split('"'); if (array.length > 1) { final wifiName = array[1]; return wifiName.isEmpty ? noWifiName : wifiName; } } - return _name!; + return _name; } String get bssid => _bssid ?? defaultBSSID.first; diff --git a/lib/repository/notification_service.dart b/lib/repository/notification_service.dart index 112de85..57725ae 100644 --- a/lib/repository/notification_service.dart +++ b/lib/repository/notification_service.dart @@ -89,17 +89,6 @@ class NotificationService { requestAlertPermission: false, requestBadgePermission: false, requestSoundPermission: false, - onDidReceiveLocalNotification: - (int id, String? title, String? body, String? payload) async { - didReceiveLocalNotificationStream.add( - ReceivedNotification( - id: id, - title: title, - body: body, - payload: payload, - ), - ); - }, notificationCategories: darwinNotificationCategories, ); final LinuxInitializationSettings initializationSettingsLinux = From 960c85571c040b617343a6cbe335f43a7a957bf0 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 23:09:19 +0530 Subject: [PATCH 10/25] Run tests on matrix --- .github/workflows/flutter_test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 85a6d12..e55b79c 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -49,9 +49,12 @@ jobs: flutter-test: name: 'Flutter Analyze + Test' + strategy: + matrix: + os: [macos, ubuntu, windows] needs: changes if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.yaml == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' }} - runs-on: macos-latest + runs-on: ${{ matrix.os }}-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -99,7 +102,7 @@ jobs: run: flutter test - name: Run integration tests if: ${{ steps.extract_branch.outputs.branch == 'dev' }} - run: flutter test integration_test --coverage -d macos + run: flutter test integration_test --coverage -d ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} - name: Upload Coverage to CodeCov if: ${{ steps.extract_branch.outputs.branch == 'dev' }} uses: codecov/codecov-action@v3 From 85906fa4f8db99ab07902f820cdde29d7649dd0c Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 23:20:52 +0530 Subject: [PATCH 11/25] conditional run --- .github/workflows/flutter_test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index e55b79c..d576234 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -28,6 +28,10 @@ jobs: windows: ${{ steps.filter.outputs.windows }} steps: # For pull requests it's not necessary to checkout the code + - name: Extract branch name + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + id: extract_branch - uses: dorny/paths-filter@v3 id: filter with: @@ -58,10 +62,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 - - name: Extract branch name - shell: bash - run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT - id: extract_branch - name: Setup Java JDK uses: actions/setup-java@v4.2.1 with: @@ -101,10 +101,10 @@ jobs: - name: Run tests run: flutter test - name: Run integration tests - if: ${{ steps.extract_branch.outputs.branch == 'dev' }} + if: needs.changes.extract_branch.outputs.branch == 'dev' run: flutter test integration_test --coverage -d ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} - name: Upload Coverage to CodeCov - if: ${{ steps.extract_branch.outputs.branch == 'dev' }} + if: needs.changes.extract_branch.outputs.branch == 'dev' uses: codecov/codecov-action@v3 with: token: ${{secrets.CODECOV_TOKEN}} @@ -113,7 +113,7 @@ jobs: android-linux-build: name: 'Build Android + Linux' needs: [changes, flutter-test] - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }} + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} runs-on: ubuntu-latest steps: - name: Checkout @@ -164,7 +164,7 @@ jobs: macos-build: name: 'Build Macos' needs: [changes, flutter-test] - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' }} + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} runs-on: macos-latest steps: - name: Checkout @@ -208,7 +208,7 @@ jobs: windows-build: name: 'Build Windows' needs: [changes, flutter-test] - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true' }} + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} runs-on: windows-latest steps: - name: Checkout From 0d3379430b5ca7538392e9a6e4d5b0452a87c015 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 23:31:40 +0530 Subject: [PATCH 12/25] shorten workflow file --- .github/workflows/flutter_test.yml | 44 ++++++------------------------ 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index d576234..6dc3497 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -163,9 +163,12 @@ jobs: macos-build: name: 'Build Macos' + strategy: + matrix: + os: [macos, windows] needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} - runs-on: macos-latest + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} + runs-on: ${{ matrix.os }}-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -191,6 +194,7 @@ jobs: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} build-runner- - name: Cache pods + if: ${{ matrix.os == 'macos'}} uses: actions/cache@v3 with: path: macos/Pods @@ -203,40 +207,8 @@ jobs: - name: Run build_runner run: flutter pub run build_runner build - name: Build macos + if: ${{ matrix.os == 'macos'}} run: flutter build macos - - windows-build: - name: 'Build Windows' - needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - name: Flutter action - uses: subosito/flutter-action@v2.16.0 - with: - channel: stable - cache: true - cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" - cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" - pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:" - pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" - - name: Cache build runner - uses: actions/cache@v4.0.2 - with: - path: | - **/.dart_tool - **/*.g.dart - **/*.mocks.dart - **/*.config.dart - key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} - restore-keys: | - build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} - build-runner- - - name: Download pub dependencies - run: flutter pub get - - name: Run build_runner - run: flutter pub run build_runner build - name: Build windows + if: ${{ matrix.os == 'windows'}} run: flutter build windows \ No newline at end of file From 15956b53438a14d249c1c53a3e7f9733d12f0e59 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Sun, 17 Nov 2024 23:53:21 +0530 Subject: [PATCH 13/25] shrink workflow --- .github/workflows/flutter_test.yml | 80 ++++++++---------------------- 1 file changed, 20 insertions(+), 60 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 6dc3497..37ac739 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -110,11 +110,14 @@ jobs: token: ${{secrets.CODECOV_TOKEN}} file: coverage/lcov.info - android-linux-build: - name: 'Build Android + Linux' + flutter_build: + name: 'Build flutter' + strategy: + matrix: + os: [macos, windows, ubuntu] needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} - runs-on: ubuntu-latest + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} + runs-on: ${{ matrix.os }}-latest steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -144,57 +147,8 @@ jobs: restore-keys: | build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} build-runner- - - name: Download pub dependencies - run: flutter pub get - - name: Run build_runner - run: flutter pub run build_runner build - - name: Build Android - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' }} - run: | - flutter build apk --debug --flavor dev - - # Run only if test, lib, and linux folder is changed - - name: Install Linux dependencies - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }} - run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - - name: Build Linux - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true' }} - run: flutter build linux - - macos-build: - name: 'Build Macos' - strategy: - matrix: - os: [macos, windows] - needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} - runs-on: ${{ matrix.os }}-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - name: Flutter action - uses: subosito/flutter-action@v2.16.0 - with: - channel: stable - cache: true - cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" - cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" - pub-cache-key: "flutter-pub-:os:-:channel:-:version:-:arch:-:hash:" - pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" - - name: Cache build runner - uses: actions/cache@v4.0.2 - with: - path: | - **/.dart_tool - **/*.g.dart - **/*.mocks.dart - **/*.config.dart - key: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} - restore-keys: | - build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} - build-runner- - name: Cache pods - if: ${{ matrix.os == 'macos'}} + if: ${{ (matrix.os == 'macos') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' ) }} uses: actions/cache@v3 with: path: macos/Pods @@ -206,9 +160,15 @@ jobs: run: flutter pub get - name: Run build_runner run: flutter pub run build_runner build - - name: Build macos - if: ${{ matrix.os == 'macos'}} - run: flutter build macos - - name: Build windows - if: ${{ matrix.os == 'windows'}} - run: flutter build windows \ No newline at end of file + - name: Build Android + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' )}} + run: | + flutter build apk --debug --flavor dev + + # Run only if test, lib, and linux folder is changed + - name: Install Linux dependencies + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') }} + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + - name: Build Linux + if: ${{ (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') }} + run: flutter build ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} \ No newline at end of file From d5d145333c3b918e531c0728045d66b1b9eb46e4 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 00:09:12 +0530 Subject: [PATCH 14/25] output branch properly --- .github/workflows/flutter_test.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 37ac739..804bf5a 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -26,6 +26,7 @@ jobs: macos: ${{ steps.filter.outputs.macos }} yaml: ${{ steps.filter.outputs.yaml }} windows: ${{ steps.filter.outputs.windows }} + branch: ${{steps.extract_branch.branch}} steps: # For pull requests it's not necessary to checkout the code - name: Extract branch name @@ -101,10 +102,10 @@ jobs: - name: Run tests run: flutter test - name: Run integration tests - if: needs.changes.extract_branch.outputs.branch == 'dev' + if: needs.changes.outputs.branch == 'dev' run: flutter test integration_test --coverage -d ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} - name: Upload Coverage to CodeCov - if: needs.changes.extract_branch.outputs.branch == 'dev' + if: needs.changes.outputs.branch == 'dev' uses: codecov/codecov-action@v3 with: token: ${{secrets.CODECOV_TOKEN}} @@ -116,7 +117,7 @@ jobs: matrix: os: [macos, windows, ubuntu] needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.extract_branch.outputs.branch == 'dev') }} + if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.outputs.branch == 'dev') }} runs-on: ${{ matrix.os }}-latest steps: - name: Checkout @@ -148,7 +149,7 @@ jobs: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} build-runner- - name: Cache pods - if: ${{ (matrix.os == 'macos') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' ) }} + if: ${{ (matrix.os == 'macos') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' ) }} uses: actions/cache@v3 with: path: macos/Pods @@ -161,14 +162,14 @@ jobs: - name: Run build_runner run: flutter pub run build_runner build - name: Build Android - if: ${{ (matrix.os == 'ubuntu') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' )}} + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' )}} run: | flutter build apk --debug --flavor dev # Run only if test, lib, and linux folder is changed - name: Install Linux dependencies - if: ${{ (matrix.os == 'ubuntu') && (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') }} + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') }} run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - name: Build Linux - if: ${{ (needs.changes.extract_branch.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') }} + if: ${{ (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') }} run: flutter build ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} \ No newline at end of file From 31a154cffaa75816ae5e38a23d64f10192e13ce2 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 00:11:11 +0530 Subject: [PATCH 15/25] shorten expression --- .github/workflows/flutter_test.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 804bf5a..547634f 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -19,13 +19,13 @@ jobs: pull-requests: read # Set job outputs to values from filter step outputs: - lib: ${{ steps.filter.outputs.lib }} - test: ${{ steps.filter.outputs.test }} - android: ${{ steps.filter.outputs.android }} - linux: ${{ steps.filter.outputs.linux }} - macos: ${{ steps.filter.outputs.macos }} - yaml: ${{ steps.filter.outputs.yaml }} - windows: ${{ steps.filter.outputs.windows }} + lib: ${{ steps.filter.outputs.lib == 'true' }} + test: ${{ steps.filter.outputs.test == 'true' }} + android: ${{ steps.filter.outputs.android == 'true' }} + linux: ${{ steps.filter.outputs.linux == 'true' }} + macos: ${{ steps.filter.outputs.macos == 'true' }} + yaml: ${{ steps.filter.outputs.yaml == 'true' }} + windows: ${{ steps.filter.outputs.windows == 'true'}} branch: ${{steps.extract_branch.branch}} steps: # For pull requests it's not necessary to checkout the code @@ -58,7 +58,7 @@ jobs: matrix: os: [macos, ubuntu, windows] needs: changes - if: ${{ needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.yaml == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' }} + if: ${{ needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.yaml || needs.changes.outputs.android || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows }} runs-on: ${{ matrix.os }}-latest steps: - name: Checkout @@ -117,7 +117,7 @@ jobs: matrix: os: [macos, windows, ubuntu] needs: [changes, flutter-test] - if: ${{ (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') && (needs.changes.outputs.branch == 'dev') }} + if: ${{ (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.android || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows || needs.changes.outputs.yaml ) && (needs.changes.outputs.branch == 'dev') }} runs-on: ${{ matrix.os }}-latest steps: - name: Checkout @@ -149,7 +149,7 @@ jobs: build-runner-${{ hashFiles('**/asset_graph.json', '**/*.dart', '**/pubspec.lock', '**/outputs.json') }} build-runner- - name: Cache pods - if: ${{ (matrix.os == 'macos') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.yaml == 'true' ) }} + if: ${{ (matrix.os == 'macos') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.macos || needs.changes.outputs.yaml ) }} uses: actions/cache@v3 with: path: macos/Pods @@ -162,14 +162,14 @@ jobs: - name: Run build_runner run: flutter pub run build_runner build - name: Build Android - if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.android == 'true' || needs.changes.outputs.yaml == 'true' )}} + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.android || needs.changes.outputs.yaml )}} run: | flutter build apk --debug --flavor dev # Run only if test, lib, and linux folder is changed - name: Install Linux dependencies - if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.yaml == 'true') }} + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.yaml ) }} run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - name: Build Linux - if: ${{ (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib == 'true' || needs.changes.outputs.test == 'true' || needs.changes.outputs.linux == 'true' || needs.changes.outputs.macos == 'true' || needs.changes.outputs.windows == 'true' || needs.changes.outputs.yaml == 'true') }} + if: ${{ (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.macos || needs.changes.outputs.windows || needs.changes.outputs.yaml ) }} run: flutter build ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} \ No newline at end of file From 0ef609a7733d6cfa37bf673ac3c40cbbdc8da598 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 00:21:39 +0530 Subject: [PATCH 16/25] corrected output for branch --- .github/workflows/flutter_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 547634f..3b7dc07 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -26,7 +26,7 @@ jobs: macos: ${{ steps.filter.outputs.macos == 'true' }} yaml: ${{ steps.filter.outputs.yaml == 'true' }} windows: ${{ steps.filter.outputs.windows == 'true'}} - branch: ${{steps.extract_branch.branch}} + branch: ${{steps.extract_branch.outputs.branch}} steps: # For pull requests it's not necessary to checkout the code - name: Extract branch name From 324b7dd1af3b2c22f6bb643dcd1d6e451358a792 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 00:27:14 +0530 Subject: [PATCH 17/25] added delay --- .github/workflows/flutter_test.yml | 5 ++++- integration_test/app_test.dart | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 3b7dc07..c830fa9 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -25,7 +25,7 @@ jobs: linux: ${{ steps.filter.outputs.linux == 'true' }} macos: ${{ steps.filter.outputs.macos == 'true' }} yaml: ${{ steps.filter.outputs.yaml == 'true' }} - windows: ${{ steps.filter.outputs.windows == 'true'}} + windows: ${{ steps.filter.outputs.windows == 'true' }} branch: ${{steps.extract_branch.outputs.branch}} steps: # For pull requests it's not necessary to checkout the code @@ -101,6 +101,9 @@ jobs: run: flutter pub global activate coverage - name: Run tests run: flutter test + - name: Install Linux dependencies + if: ${{ (matrix.os == 'ubuntu') && (needs.changes.outputs.branch == 'dev') && (needs.changes.outputs.lib || needs.changes.outputs.test || needs.changes.outputs.linux || needs.changes.outputs.yaml ) }} + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - name: Run integration tests if: needs.changes.outputs.branch == 'dev' run: flutter test integration_test --coverage -d ${{ matrix.os == 'ubuntu' && 'linux' || matrix.os }} diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index 3054da6..ae2b00f 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -53,7 +53,7 @@ void main() { await tester.tap(devicesButton); await tester.pump(); expect(find.byType(AdaptiveListTile), findsAny); - await tester.pumpAndSettle(); + await tester.pumpAndSettle(const Duration(seconds: 5)); await tester.pump(); expect(find.byType(AdaptiveListTile), findsAtLeast(2)); From 4748ecfee8e5ff31d7e22c0a65620e18706852c2 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 22:05:20 +0530 Subject: [PATCH 18/25] increase delay --- integration_test/app_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index ae2b00f..306fe1e 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -53,7 +53,7 @@ void main() { await tester.tap(devicesButton); await tester.pump(); expect(find.byType(AdaptiveListTile), findsAny); - await tester.pumpAndSettle(const Duration(seconds: 5)); + await tester.pumpAndSettle(const Duration(seconds: 10)); await tester.pump(); expect(find.byType(AdaptiveListTile), findsAtLeast(2)); From 06b88a146bafe9875a08eb697be62db2a70cfb64 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 22:38:38 +0530 Subject: [PATCH 19/25] return in case of error --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index d829711..512b805 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -76,6 +76,7 @@ class HostScanBloc extends Bloc { } if (gatewayIp == null) { emit(const HostScanState.error()); + return; } subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.')); } From ed7f827740a411eebab87efbe88bed091822e195 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 22:55:55 +0530 Subject: [PATCH 20/25] fix tests --- .../host_scan_bloc/host_scan_bloc.dart | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 512b805..426eb9a 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -49,15 +49,6 @@ class HostScanBloc extends Bloc { devicesSet.clear(); mDnsDevices.clear(); emit(const HostScanState.loadInProgress()); - await initializeWifiParameters(emit); - if (appSettings.runScanOnStartup) { - add(const HostScanEvent.loadScan()); - } else { - add(const HostScanEvent.startNewScan()); - } - } - - Future initializeWifiParameters(Emitter emit) async { String? wifiGatewayIP; try { wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); @@ -79,6 +70,11 @@ class HostScanBloc extends Bloc { return; } subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.')); + if (appSettings.runScanOnStartup) { + add(const HostScanEvent.loadScan()); + } else { + add(const HostScanEvent.startNewScan()); + } } Future _startNewScanBuiltInIsolate( From 78763b470e8ca4365812305b0de4cb1e6a76f80a Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 22:57:48 +0530 Subject: [PATCH 21/25] print logs --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 426eb9a..bcde242 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -58,12 +58,16 @@ class HostScanBloc extends Bloc { ip = await NetworkInfo().getWifiIP(); if (appSettings.customSubnet.isNotEmpty) { gatewayIp = appSettings.customSubnet; + debugPrint('Taking gatewayIp from appSettings: $gatewayIp'); } else if (wifiGatewayIP != null) { gatewayIp = wifiGatewayIP; + debugPrint( + 'Taking gatewayIp from NetworkInfo().getWifiGatewayIP(): $gatewayIp'); } else { // NetworkInfo().getWifiGatewayIP() is null on android 35, so fail-safe // to NetworkInfo().getWifiIP() gatewayIp = ip; + debugPrint('Taking gatewayIp from NetworkInfo().getWifiIP(): $gatewayIp'); } if (gatewayIp == null) { emit(const HostScanState.error()); From 26615e088a77d781ef4423c6381476e1b51abfe4 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 22:58:09 +0530 Subject: [PATCH 22/25] fix analyzer --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index bcde242..0dc1690 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -62,7 +62,8 @@ class HostScanBloc extends Bloc { } else if (wifiGatewayIP != null) { gatewayIp = wifiGatewayIP; debugPrint( - 'Taking gatewayIp from NetworkInfo().getWifiGatewayIP(): $gatewayIp'); + 'Taking gatewayIp from NetworkInfo().getWifiGatewayIP(): $gatewayIp', + ); } else { // NetworkInfo().getWifiGatewayIP() is null on android 35, so fail-safe // to NetworkInfo().getWifiIP() From 85ada084b3272526a4eef0dfb17796c98e9d657e Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 23:28:49 +0530 Subject: [PATCH 23/25] localInterface added --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 5 +++-- macos/Podfile.lock | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 0dc1690..bf13747 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -46,16 +46,17 @@ class HostScanBloc extends Bloc { Initialized event, Emitter emit, ) async { + final info = NetworkInfo(); devicesSet.clear(); mDnsDevices.clear(); emit(const HostScanState.loadInProgress()); String? wifiGatewayIP; try { - wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); + wifiGatewayIP = await info.getWifiGatewayIP(); } catch (e) { debugPrint('Unimplemented error $e'); } - ip = await NetworkInfo().getWifiIP(); + ip = await info.getWifiIP(); if (appSettings.customSubnet.isNotEmpty) { gatewayIp = appSettings.customSubnet; debugPrint('Taking gatewayIp from appSettings: $gatewayIp'); diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 40a24a6..632a113 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -61,14 +61,14 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: - flutter_local_notifications: 4b427ffabf278fc6ea9484c97505e231166927a5 + flutter_local_notifications: 7062189aabf7f50938a7b8b6614ffa97656eb0bf flutter_timezone: 6b906d1740654acb16e50b639835628fea851037 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 in_app_review: a850789fad746e89bce03d4aeee8078b45a53fd0 isar_flutter_libs: 43385c99864c168fadba7c9adeddc5d38838ca6a - network_info_plus: f4fbc7877ab7b3294500d9441dfa53cd54972d05 + network_info_plus: 2cb02d8435635eae13b3b79279681985121cf30c nsd_macos: 1a38a38a33adbb396b4c6f303bc076073514cadc - package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce + package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 From e8a5cc713ed95912d0219c2032faac41641a9166 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Mon, 18 Nov 2024 23:28:53 +0530 Subject: [PATCH 24/25] localInterface added --- .../host_scan_page/host_scan_bloc/host_scan_bloc.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index bf13747..2fe3adc 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -57,6 +57,7 @@ class HostScanBloc extends Bloc { debugPrint('Unimplemented error $e'); } ip = await info.getWifiIP(); + final interface = await NetInterface.localInterface(); if (appSettings.customSubnet.isNotEmpty) { gatewayIp = appSettings.customSubnet; debugPrint('Taking gatewayIp from appSettings: $gatewayIp'); @@ -65,11 +66,16 @@ class HostScanBloc extends Bloc { debugPrint( 'Taking gatewayIp from NetworkInfo().getWifiGatewayIP(): $gatewayIp', ); - } else { + } else if (ip != null) { // NetworkInfo().getWifiGatewayIP() is null on android 35, so fail-safe // to NetworkInfo().getWifiIP() gatewayIp = ip; debugPrint('Taking gatewayIp from NetworkInfo().getWifiIP(): $gatewayIp'); + } else if (interface != null) { + gatewayIp = interface.ipAddress; + debugPrint( + 'Taking gatewayIp from NetInterface.localInterface(): $gatewayIp', + ); } if (gatewayIp == null) { emit(const HostScanState.error()); From 03733cfa0f5fb6980f2bbdd5e353a1edbbeee728 Mon Sep 17 00:00:00 2001 From: git-elliot Date: Wed, 20 Nov 2024 09:19:24 +0530 Subject: [PATCH 25/25] fix for tests --- lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 2fe3adc..1334a74 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -79,9 +79,13 @@ class HostScanBloc extends Bloc { } if (gatewayIp == null) { emit(const HostScanState.error()); - return; + return Future.error('Can not get wifi details'); } subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.')); + if (subnet == null) { + emit(const HostScanState.error()); + return Future.error('Can not get wifi details'); + } if (appSettings.runScanOnStartup) { add(const HostScanEvent.loadScan()); } else {