From 9e2b75bd8b9d8f3555a7236c6c5d4a6d3a5384b8 Mon Sep 17 00:00:00 2001 From: Nanodash <61005635+Nanodash@users.noreply.github.com> Date: Sun, 16 Oct 2022 22:27:50 +0200 Subject: [PATCH] Documentation and dependencies upgrade (#252) * update plugin with Flutter 3.0 and Dart 2.17.0 and upgrade dependencies in pubspec.yaml * move flutter_lints to dev dependencies * update generated code * Feat(example-app) added permissions requests * update README.md to specify how to install plugin * Feat(Nordic-SDK) upgrade Android SDK to v3.2.4 * upgrade gradle dependencies, update example app's Podfile and fix running it on simulator * Feat(Nordic-SDK) upgrade iOS SDK to v3.2.0 * increment pkg's version and update CHANGELOG.md --- .metadata | 27 +- Android-nRF-Mesh-Library-1 | 2 +- CHANGELOG.md | 8 + IOS-nRF-Mesh-Library | 2 +- README.md | 21 ++ android/.gitignore | 4 +- android/build.gradle | 14 +- example/analysis_options.yaml | 29 ++ example/android/app/build.gradle | 4 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../app/src/main/res/values-night/styles.xml | 2 +- .../app/src/main/res/values/styles.xml | 2 +- .../app/src/profile/AndroidManifest.xml | 3 +- example/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- example/ios/Podfile | 8 +- example/ios/Podfile.lock | 64 ++-- example/ios/Runner/Info.plist | 4 + example/lib/src/app.dart | 29 +- .../send_config_model_publication_add.dart | 2 +- .../send_config_model_subscription_add.dart | 2 +- .../commands/send_deprovisioning.dart | 2 +- .../commands/send_generic_level.dart | 2 +- .../commands/send_generic_on_off.dart | 2 +- .../lib/src/views/control_module/module.dart | 2 +- .../lib/src/views/control_module/node.dart | 2 +- .../control_module/provisioned_devices.dart | 6 +- example/lib/src/views/home/home.dart | 66 ++-- .../scan_and_provisioning.dart | 10 +- example/lib/src/widgets/group.dart | 2 +- .../lib/src/widgets/mesh_network_widget.dart | 2 +- example/lib/src/widgets/node.dart | 2 +- example/pubspec.lock | 179 ++++++--- example/pubspec.yaml | 12 +- example/test_driver/app_test.dart | 3 +- ios/nordic_nrf_mesh.podspec | 10 +- lib/src/ble/ble_manager.dart | 2 + lib/src/ble/ble_mesh_manager.dart | 16 +- lib/src/ble/ble_scanner.dart | 2 +- ...onfig_composition_data_status.freezed.dart | 163 ++++----- .../config_composition_data_status.g.dart | 30 +- .../mesh_provisioning_status.freezed.dart | 344 ++++++++---------- .../mesh_provisioning_status.g.dart | 55 ++- .../send_provisioning_pdu.freezed.dart | 88 +++-- .../send_provisioning_pdu.g.dart | 12 +- lib/src/mesh_network.dart | 24 +- .../mesh_node/provisioned_mesh_node.dart | 4 +- lib/src/utils/provisioning.dart | 12 +- pubspec.lock | 76 ++-- pubspec.yaml | 24 +- 50 files changed, 755 insertions(+), 636 deletions(-) create mode 100644 example/analysis_options.yaml diff --git a/.metadata b/.metadata index 4b7663f9e..e577f53dd 100644 --- a/.metadata +++ b/.metadata @@ -1,10 +1,33 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe + revision: eb6d86ee27deecba4a83536aa20f366a6044895c channel: stable project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + - platform: android + create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + - platform: ios + create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/Android-nRF-Mesh-Library-1 b/Android-nRF-Mesh-Library-1 index 8eb3ee50b..b4a00b65f 160000 --- a/Android-nRF-Mesh-Library-1 +++ b/Android-nRF-Mesh-Library-1 @@ -1 +1 @@ -Subproject commit 8eb3ee50bb3b7b398d06d7d24d7058cede8b10d3 +Subproject commit b4a00b65f661ba371b222630b43b88c8c72e101f diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e02d4b5d..ff20917e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.13.0 +- Use of Nordic Semiconductor's Android SDK v3.2.4 +- Use of Nordic Semiconductor's iOS SDK v3.2.0 (iOS 12.0 required as a result) +- Upgraded Gradle version and dependencies +- Upgraded Dart dependencies +- Now need Flutter 3.0 to use plugin +- Updated example app to request needed permissions +- Updated README.md to explain how to install plugin ## 0.12.0 - Use of Nordic Semiconductor's Android SDK v3.2.1 diff --git a/IOS-nRF-Mesh-Library b/IOS-nRF-Mesh-Library index f4f06b865..09feba763 160000 --- a/IOS-nRF-Mesh-Library +++ b/IOS-nRF-Mesh-Library @@ -1 +1 @@ -Subproject commit f4f06b8653a27575ac7f875e3e023a3d539baaec +Subproject commit 09feba763b877194505fcc40a0de6282101a891c diff --git a/README.md b/README.md index a7c1dd788..ee16f93a4 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,27 @@ This plugin wraps both [IOS-nRF-Mesh-Library] and [Android-nRF-Mesh-Library] to _(Note: the Bluetooth scanning and connecting features are done with [flutter_reactive_ble])_ # How to use +## Installation +### Plugin development : + + - clone repository + - execute `git submodule update --init` + +### Install in Flutter App : + +##### Install plugin +- add `nordic_nrf_mesh` to your pubspec.yaml and execute `flutter pub get` +- go to `path/to/flutter/.pub-cache/hosted/pub.dartlang.org/nrf_mesh_plugin-` +- execute `git submodule update --init` + +##### Update build scripts +###### **Android** +- copy plugin's example app gradle script in [android/settings.gradle](https://github.com/OZEO-DOOZ/nrf_mesh_plugin/blob/master/example/android/settings.gradle#L13) +- paste it in your own app's file + +###### **iOS** +- copy plugin's example Podfile script in [ios/Podfile](https://github.com/OZEO-DOOZ/nrf_mesh_plugin/blob/master/example/ios/Podfile#L33) +- paste it in your own app's file ## Initialization To begin to use the plugin, one should instantiate the `NordicNrfMesh` instance like so : ```dart diff --git a/android/.gitignore b/android/.gitignore index 709017b9f..161bdcdaf 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -1,7 +1,9 @@ *.iml .gradle /local.properties -/.idea/ +/.idea/workspace.xml +/.idea/libraries .DS_Store /build /captures +.cxx diff --git a/android/build.gradle b/android/build.gradle index 154c391cd..1a3406dd9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'fr.dooz.nordic_nrf_mesh' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.6.20' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,21 +25,21 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 32 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { minSdkVersion 23 - targetSdkVersion 32 + targetSdkVersion 33 } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" - implementation 'com.google.code.gson:gson:2.8.9' - implementation "com.polidea.rxandroidble2:rxandroidble:1.12.1" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" + implementation 'com.google.code.gson:gson:2.9.1' + implementation "com.polidea.rxandroidble2:rxandroidble:1.13.0" implementation project(':mesh') } diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 000000000..61b6c4de1 --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 9172c21cc..4ecb24c11 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,8 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 33 + ndkVersion flutter.ndkVersion kotlinOptions { jvmTarget = '1.8' @@ -59,5 +60,4 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation project(':mesh') } diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 9cb201ae7..189834e0d 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,7 @@ - diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index 3db14bb53..06952be74 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -3,7 +3,7 @@ diff --git a/example/android/build.gradle b/example/android/build.gradle index a490ddfb4..a10bfe535 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.20' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 752ce5bc4..cb24abda1 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/example/ios/Podfile b/example/ios/Podfile index 5315df336..0920daf83 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '11.0' +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -39,5 +39,11 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + 'PERMISSION_BLUETOOTH=1', + ] + end end end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c7a12e836..5cac778f2 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,13 +1,15 @@ PODS: - - CryptoSwift (1.4.0) - - DKImagePickerController/Core (4.3.2): + - CryptoSwift (1.5.1) + - device_info_plus (0.0.1): + - Flutter + - DKImagePickerController/Core (4.3.4): - DKImagePickerController/ImageDataManager - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.2) - - DKImagePickerController/PhotoGallery (4.3.2): + - DKImagePickerController/ImageDataManager (4.3.4) + - DKImagePickerController/PhotoGallery (4.3.4): - DKImagePickerController/Core - DKPhotoGallery - - DKImagePickerController/Resource (4.3.2) + - DKImagePickerController/Resource (4.3.4) - DKPhotoGallery (0.0.17): - DKPhotoGallery/Core (= 0.0.17) - DKPhotoGallery/Model (= 0.0.17) @@ -35,27 +37,31 @@ PODS: - DKImagePickerController/PhotoGallery - Flutter - Flutter (1.0.0) - - nordic_nrf_mesh (0.0.1): + - nordic_nrf_mesh (0.13.0): - Flutter - nRFMeshProvision - - nRFMeshProvision (3.1.4): - - CryptoSwift (= 1.4.0) - - Protobuf (3.19.1) + - nRFMeshProvision (3.2.0): + - CryptoSwift (= 1.5.1) + - permission_handler_apple (9.0.4): + - Flutter + - Protobuf (3.21.7) - reactive_ble_mobile (0.0.1): - Flutter - Protobuf (~> 3.5) - SwiftProtobuf (~> 1.0) - - SDWebImage (5.12.1): - - SDWebImage/Core (= 5.12.1) - - SDWebImage/Core (5.12.1) - - SwiftProtobuf (1.18.0) - - SwiftyGif (5.4.0) + - SDWebImage (5.13.4): + - SDWebImage/Core (= 5.13.4) + - SDWebImage/Core (5.13.4) + - SwiftProtobuf (1.20.2) + - SwiftyGif (5.4.3) DEPENDENCIES: + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) - Flutter (from `Flutter`) - nordic_nrf_mesh (from `.symlinks/plugins/nordic_nrf_mesh/ios`) - nRFMeshProvision (from `.symlinks/plugins/nordic_nrf_mesh/IOS-nRF-Mesh-Library`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) SPEC REPOS: @@ -69,6 +75,8 @@ SPEC REPOS: - SwiftyGif EXTERNAL SOURCES: + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" file_picker: :path: ".symlinks/plugins/file_picker/ios" Flutter: @@ -77,23 +85,27 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/nordic_nrf_mesh/ios" nRFMeshProvision: :path: ".symlinks/plugins/nordic_nrf_mesh/IOS-nRF-Mesh-Library" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" reactive_ble_mobile: :path: ".symlinks/plugins/reactive_ble_mobile/ios" SPEC CHECKSUMS: - CryptoSwift: 7cc902df1784de3b389a387756c7d710f197730c - DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d + CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082 + device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1 - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - nordic_nrf_mesh: 5b37621fef90bc1b077bc9b34d3241b3622a0605 - nRFMeshProvision: 4b3e185fd13b077c997aadca6f54806f5c577cd7 - Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471 + file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + nordic_nrf_mesh: 469eac5b312f1e29c2da8f0c7c85c8d576f823bd + nRFMeshProvision: 0f0a0b9e83e4a77bb4df1b7dfdb3838f526875d0 + permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce + Protobuf: f4128517d7a42302e106cc3afe614ee3a7513e94 reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c - SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b - SwiftProtobuf: c3c12645230d9b09c72267e0de89468c5543bd86 - SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7 + SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3 + SwiftProtobuf: 9f458aaa7844a2fc0b910053e66578bc4e2da9c1 + SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780 -PODFILE CHECKSUM: 72e7578d6c04ade70fdc134ccf7d38a693d97cd0 +PODFILE CHECKSUM: 128b388d0d827f7e3f8a3286f565f4414fc370a7 -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 3b6c3d6ed..75297406d 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -45,5 +45,9 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/example/lib/src/app.dart b/example/lib/src/app.dart index 508e5a5f2..8c5e49f8b 100644 --- a/example/lib/src/app.dart +++ b/example/lib/src/app.dart @@ -1,8 +1,11 @@ +import 'package:device_info_plus/device_info_plus.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:nordic_nrf_mesh/nordic_nrf_mesh.dart'; import 'package:nordic_nrf_mesh_example/src/views/control_module/provisioned_devices.dart'; import 'package:nordic_nrf_mesh_example/src/views/home/home.dart'; import 'package:nordic_nrf_mesh_example/src/views/scan_and_provisionning/scan_and_provisioning.dart'; +import 'package:permission_handler/permission_handler.dart'; const int homeTab = 0; const int provisioningTab = 1; @@ -25,13 +28,13 @@ class NordicNrfMeshExampleApp extends StatefulWidget { const NordicNrfMeshExampleApp({Key? key}) : super(key: key); @override - _NordicNrfMeshExampleAppState createState() => _NordicNrfMeshExampleAppState(); + State createState() => _NordicNrfMeshExampleAppState(); } class _NordicNrfMeshExampleAppState extends State { late final GlobalKey _scaffoldKey = GlobalKey(debugLabel: 'main_scaffold'); - final nordicNrfMesh = NordicNrfMesh(); + late final NordicNrfMesh nordicNrfMesh = NordicNrfMesh(); int _bottomNavigationBarIndex = homeTab; @@ -101,3 +104,25 @@ class _NordicNrfMeshExampleAppState extends State { ); } } + +void log(Object? msg) => debugPrint('[$NordicNrfMeshExampleApp - ${DateTime.now().toIso8601String()}] $msg'); + +Future checkAndAskPermissions() async { + if (defaultTargetPlatform == TargetPlatform.android) { + final androidInfo = await DeviceInfoPlugin().androidInfo; + if (androidInfo.version.sdkInt! < 31) { + // location + await Permission.locationWhenInUse.request(); + await Permission.locationAlways.request(); + // bluetooth + await Permission.bluetooth.request(); + } else { + // bluetooth for Android 12 and up + await Permission.bluetoothScan.request(); + await Permission.bluetoothConnect.request(); + } + } else { + // bluetooth for iOS 13 and up + await Permission.bluetooth.request(); + } +} diff --git a/example/lib/src/views/control_module/commands/send_config_model_publication_add.dart b/example/lib/src/views/control_module/commands/send_config_model_publication_add.dart index 92d6faebe..6b845e812 100644 --- a/example/lib/src/views/control_module/commands/send_config_model_publication_add.dart +++ b/example/lib/src/views/control_module/commands/send_config_model_publication_add.dart @@ -10,7 +10,7 @@ class SendConfigModelPublicationAdd extends StatefulWidget { const SendConfigModelPublicationAdd(this.meshManagerApi, {Key? key}) : super(key: key); @override - _SendConfigModelPublicationAddState createState() => _SendConfigModelPublicationAddState(); + State createState() => _SendConfigModelPublicationAddState(); } class _SendConfigModelPublicationAddState extends State { diff --git a/example/lib/src/views/control_module/commands/send_config_model_subscription_add.dart b/example/lib/src/views/control_module/commands/send_config_model_subscription_add.dart index 50d534459..9a7102d69 100644 --- a/example/lib/src/views/control_module/commands/send_config_model_subscription_add.dart +++ b/example/lib/src/views/control_module/commands/send_config_model_subscription_add.dart @@ -10,7 +10,7 @@ class SendConfigModelSubscriptionAdd extends StatefulWidget { const SendConfigModelSubscriptionAdd(this.meshManagerApi, {Key? key}) : super(key: key); @override - _SendConfigModelSubscriptionAddState createState() => _SendConfigModelSubscriptionAddState(); + State createState() => _SendConfigModelSubscriptionAddState(); } class _SendConfigModelSubscriptionAddState extends State { diff --git a/example/lib/src/views/control_module/commands/send_deprovisioning.dart b/example/lib/src/views/control_module/commands/send_deprovisioning.dart index 0fbb8fa53..f1b274289 100644 --- a/example/lib/src/views/control_module/commands/send_deprovisioning.dart +++ b/example/lib/src/views/control_module/commands/send_deprovisioning.dart @@ -10,7 +10,7 @@ class SendDeprovisioning extends StatefulWidget { const SendDeprovisioning({Key? key, required this.meshManagerApi}) : super(key: key); @override - _SendDeprovisioningState createState() => _SendDeprovisioningState(); + State createState() => _SendDeprovisioningState(); } class _SendDeprovisioningState extends State { diff --git a/example/lib/src/views/control_module/commands/send_generic_level.dart b/example/lib/src/views/control_module/commands/send_generic_level.dart index f22a5f169..098bbbe03 100644 --- a/example/lib/src/views/control_module/commands/send_generic_level.dart +++ b/example/lib/src/views/control_module/commands/send_generic_level.dart @@ -10,7 +10,7 @@ class SendGenericLevel extends StatefulWidget { const SendGenericLevel({Key? key, required this.meshManagerApi}) : super(key: key); @override - _SendGenericLevelState createState() => _SendGenericLevelState(); + State createState() => _SendGenericLevelState(); } class _SendGenericLevelState extends State { diff --git a/example/lib/src/views/control_module/commands/send_generic_on_off.dart b/example/lib/src/views/control_module/commands/send_generic_on_off.dart index 053044ee1..661ee4685 100644 --- a/example/lib/src/views/control_module/commands/send_generic_on_off.dart +++ b/example/lib/src/views/control_module/commands/send_generic_on_off.dart @@ -10,7 +10,7 @@ class SendGenericOnOff extends StatefulWidget { const SendGenericOnOff({Key? key, required this.meshManagerApi}) : super(key: key); @override - _SendGenericOnOffState createState() => _SendGenericOnOffState(); + State createState() => _SendGenericOnOffState(); } class _SendGenericOnOffState extends State { diff --git a/example/lib/src/views/control_module/module.dart b/example/lib/src/views/control_module/module.dart index b0766ea98..ce47b2597 100644 --- a/example/lib/src/views/control_module/module.dart +++ b/example/lib/src/views/control_module/module.dart @@ -24,7 +24,7 @@ class Module extends StatefulWidget { }) : super(key: key); @override - _ModuleState createState() => _ModuleState(); + State createState() => _ModuleState(); } class _ModuleState extends State { diff --git a/example/lib/src/views/control_module/node.dart b/example/lib/src/views/control_module/node.dart index f3b2219aa..8d12a9445 100644 --- a/example/lib/src/views/control_module/node.dart +++ b/example/lib/src/views/control_module/node.dart @@ -11,7 +11,7 @@ class Node extends StatefulWidget { const Node({Key? key, required this.node, required this.meshManagerApi, required this.name}) : super(key: key); @override - _NodeState createState() => _NodeState(); + State createState() => _NodeState(); } class _NodeState extends State { diff --git a/example/lib/src/views/control_module/provisioned_devices.dart b/example/lib/src/views/control_module/provisioned_devices.dart index 51d2bcaeb..253a0681d 100644 --- a/example/lib/src/views/control_module/provisioned_devices.dart +++ b/example/lib/src/views/control_module/provisioned_devices.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:nordic_nrf_mesh/nordic_nrf_mesh.dart'; +import 'package:nordic_nrf_mesh_example/src/app.dart'; import 'package:nordic_nrf_mesh_example/src/views/control_module/module.dart'; import 'package:nordic_nrf_mesh_example/src/widgets/device.dart'; @@ -12,7 +13,7 @@ class ProvisionedDevices extends StatefulWidget { const ProvisionedDevices({Key? key, required this.nordicNrfMesh}) : super(key: key); @override - _ProvisionedDevicesState createState() => _ProvisionedDevicesState(); + State createState() => _ProvisionedDevicesState(); } class _ProvisionedDevicesState extends State { @@ -84,6 +85,7 @@ class _ProvisionedDevicesState extends State { setState(() { _devices.clear(); }); + await checkAndAskPermissions(); _scanSubscription = widget.nordicNrfMesh.scanForProxy().listen((device) async { if (_devices.every((d) => d.id != device.id)) { setState(() { @@ -94,7 +96,7 @@ class _ProvisionedDevicesState extends State { setState(() { isScanning = true; }); - return Future.delayed(const Duration(seconds: 10)).then((_) => _stopScan()); + return Future.delayed(const Duration(seconds: 10), _stopScan); } Future _stopScan() async { diff --git a/example/lib/src/views/home/home.dart b/example/lib/src/views/home/home.dart index 5cf628388..29c21cecd 100644 --- a/example/lib/src/views/home/home.dart +++ b/example/lib/src/views/home/home.dart @@ -13,7 +13,7 @@ class Home extends StatefulWidget { const Home({Key? key, required this.nordicNrfMesh}) : super(key: key); @override - _HomeState createState() => _HomeState(); + State createState() => _HomeState(); } class _HomeState extends State { @@ -85,7 +85,7 @@ class PlatformVersion extends StatefulWidget { final NordicNrfMesh nordicNrfMesh; @override - _PlatformVersion createState() => _PlatformVersion(); + State createState() => _PlatformVersion(); } class _PlatformVersion extends State { @@ -123,8 +123,8 @@ class MeshNetworkDatabaseWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MeshManagerApi? _meshManagerApi = nordicNrfMesh.meshManagerApi; - IMeshNetwork? _meshNetwork = _meshManagerApi.meshNetwork; + MeshManagerApi? meshManagerApi = nordicNrfMesh.meshManagerApi; + IMeshNetwork? meshNetwork = meshManagerApi.meshNetwork; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -135,26 +135,26 @@ class MeshNetworkDatabaseWidget extends StatelessWidget { final file = File(filePath.paths.first!); debugPrint('loading and importing json file...'); final json = await file.readAsString(); - await _meshManagerApi.importMeshNetworkJson(json); + await meshManagerApi.importMeshNetworkJson(json); debugPrint('done !'); }, child: const Text('Import MeshNetwork (JSON)'), ), TextButton( - onPressed: _meshManagerApi.loadMeshNetwork, + onPressed: meshManagerApi.loadMeshNetwork, child: const Text('Load MeshNetwork'), ), TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { - final meshNetworkJson = await _meshManagerApi.exportMeshNetwork(); + final meshNetworkJson = await meshManagerApi.exportMeshNetwork(); debugPrint(meshNetworkJson); } : null, child: const Text('Export MeshNetwork'), ), TextButton( - onPressed: _meshNetwork != null ? _meshManagerApi.resetMeshNetwork : null, + onPressed: meshNetwork != null ? meshManagerApi.resetMeshNetwork : null, child: const Text('Reset MeshNetwork'), ), ], @@ -171,26 +171,26 @@ class MeshNetworkManagerWidget extends StatelessWidget { @override Widget build(BuildContext context) { - MeshManagerApi? _meshManagerApi = nordicNrfMesh.meshManagerApi; - IMeshNetwork? _meshNetwork = _meshManagerApi.meshNetwork; + MeshManagerApi? meshManagerApi = nordicNrfMesh.meshManagerApi; + IMeshNetwork? meshNetwork = meshManagerApi.meshNetwork; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { //13 provisioners are maximum with the below given ranges and the default ttl is 5 //above that, will throw error - final result = await _meshNetwork.addProvisioner(0x0888, 0x02F6, 0x0888, 5); + final result = await meshNetwork.addProvisioner(0x0888, 0x02F6, 0x0888, 5); debugPrint('provisioner added : $result'); } : null, child: const Text('add provisioner'), ), TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { - var provs = await _meshNetwork.provisioners; + var provs = await meshNetwork.provisioners; debugPrint('# of provs : ${provs.length}'); for (var value in provs) { debugPrint('$value'); @@ -200,12 +200,13 @@ class MeshNetworkManagerWidget extends StatelessWidget { child: const Text('get provisioner list'), ), TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { + final scaffoldMessenger = ScaffoldMessenger.of(context); final groupName = await showDialog( context: context, builder: (c) { - String? _groupName; + String? groupName; return Dialog( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), @@ -224,10 +225,10 @@ class MeshNetworkManagerWidget extends StatelessWidget { children: [ TextField( decoration: const InputDecoration(labelText: 'Group name'), - onChanged: (text) => _groupName = text, + onChanged: (text) => groupName = text, ), TextButton( - onPressed: () => Navigator.pop(c, _groupName), + onPressed: () => Navigator.pop(c, groupName), child: const Text('OK'), ) ], @@ -236,10 +237,9 @@ class MeshNetworkManagerWidget extends StatelessWidget { ), ); }); - final scaffoldMessenger = ScaffoldMessenger.of(context); if (groupName != null && groupName.isNotEmpty) { try { - await _meshManagerApi.meshNetwork!.addGroupWithName(groupName); + await meshManagerApi.meshNetwork!.addGroupWithName(groupName); scaffoldMessenger.showSnackBar(const SnackBar(content: Text('OK'))); } on PlatformException catch (e) { scaffoldMessenger.showSnackBar(SnackBar(content: Text('${e.message}'))); @@ -254,12 +254,13 @@ class MeshNetworkManagerWidget extends StatelessWidget { child: const Text('Create group with name'), ), TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { + final scaffoldMessenger = ScaffoldMessenger.of(context); final groupAdr = await showDialog( context: context, builder: (c) { - String? _groupAdr; + String? groupAdr; return Dialog( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), @@ -279,10 +280,10 @@ class MeshNetworkManagerWidget extends StatelessWidget { TextField( decoration: const InputDecoration(labelText: 'Group address'), keyboardType: TextInputType.number, - onChanged: (text) => _groupAdr = text, + onChanged: (text) => groupAdr = text, ), TextButton( - onPressed: () => Navigator.pop(c, _groupAdr), + onPressed: () => Navigator.pop(c, groupAdr), child: const Text('OK'), ) ], @@ -291,10 +292,9 @@ class MeshNetworkManagerWidget extends StatelessWidget { ), ); }); - final scaffoldMessenger = ScaffoldMessenger.of(context); if (groupAdr != null && groupAdr.isNotEmpty) { try { - await _meshManagerApi.meshNetwork!.removeGroup(int.parse(groupAdr)); + await meshManagerApi.meshNetwork!.removeGroup(int.parse(groupAdr)); scaffoldMessenger.showSnackBar(const SnackBar(content: Text('OK'))); } on PlatformException catch (e) { scaffoldMessenger.showSnackBar(SnackBar(content: Text('${e.message}'))); @@ -309,12 +309,13 @@ class MeshNetworkManagerWidget extends StatelessWidget { child: const Text('Delete group'), ), TextButton( - onPressed: _meshNetwork != null + onPressed: meshNetwork != null ? () async { + final scaffoldMessenger = ScaffoldMessenger.of(context); final groupAdr = await showDialog( context: context, builder: (c) { - String? _groupAdr; + String? groupAdr; return Dialog( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), @@ -334,10 +335,10 @@ class MeshNetworkManagerWidget extends StatelessWidget { TextField( decoration: const InputDecoration(labelText: 'Group address'), keyboardType: TextInputType.number, - onChanged: (text) => _groupAdr = text, + onChanged: (text) => groupAdr = text, ), TextButton( - onPressed: () => Navigator.pop(c, _groupAdr), + onPressed: () => Navigator.pop(c, groupAdr), child: const Text('OK'), ) ], @@ -346,10 +347,9 @@ class MeshNetworkManagerWidget extends StatelessWidget { ), ); }); - final scaffoldMessenger = ScaffoldMessenger.of(context); if (groupAdr != null && groupAdr.isNotEmpty) { try { - final subs = await _meshManagerApi.meshNetwork!.elementsForGroup(int.parse(groupAdr)); + final subs = await meshManagerApi.meshNetwork!.elementsForGroup(int.parse(groupAdr)); debugPrint('$subs'); scaffoldMessenger.showSnackBar(const SnackBar(content: Text('OK'))); } on PlatformException catch (e) { diff --git a/example/lib/src/views/scan_and_provisionning/scan_and_provisioning.dart b/example/lib/src/views/scan_and_provisionning/scan_and_provisioning.dart index 28be9472b..2ae89773a 100644 --- a/example/lib/src/views/scan_and_provisionning/scan_and_provisioning.dart +++ b/example/lib/src/views/scan_and_provisionning/scan_and_provisioning.dart @@ -4,8 +4,8 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:nordic_nrf_mesh/nordic_nrf_mesh.dart'; +import 'package:nordic_nrf_mesh_example/src/app.dart'; import 'package:nordic_nrf_mesh_example/src/widgets/device.dart'; -import 'package:pedantic/pedantic.dart'; class ScanningAndProvisioning extends StatefulWidget { final NordicNrfMesh nordicNrfMesh; @@ -18,7 +18,7 @@ class ScanningAndProvisioning extends StatefulWidget { }) : super(key: key); @override - _ScanningAndProvisioningState createState() => _ScanningAndProvisioningState(); + State createState() => _ScanningAndProvisioningState(); } class _ScanningAndProvisioningState extends State { @@ -48,6 +48,7 @@ class _ScanningAndProvisioningState extends State { setState(() { _devices.clear(); }); + await checkAndAskPermissions(); _scanSubscription = widget.nordicNrfMesh.scanForUnprovisionedNodes().listen((device) async { if (_devices.every((d) => d.id != device.id)) { final deviceUuid = @@ -61,7 +62,7 @@ class _ScanningAndProvisioningState extends State { setState(() { isScanning = true; }); - return Future.delayed(const Duration(seconds: 10)).then((_) => _stopScan()); + return Future.delayed(const Duration(seconds: 10), _stopScan); } Future _stopScan() async { @@ -73,6 +74,7 @@ class _ScanningAndProvisioningState extends State { } Future provisionDevice(DiscoveredDevice device) async { + final scaffoldMessenger = ScaffoldMessenger.of(context); if (isScanning) { await _stopScan(); } @@ -81,8 +83,6 @@ class _ScanningAndProvisioningState extends State { } isProvisioning = true; - final scaffoldMessenger = ScaffoldMessenger.of(context); - try { // Android is sending the mac Adress of the device, but Apple generates // an UUID specific by smartphone. diff --git a/example/lib/src/widgets/group.dart b/example/lib/src/widgets/group.dart index 70bd5c830..a23dad1d4 100644 --- a/example/lib/src/widgets/group.dart +++ b/example/lib/src/widgets/group.dart @@ -8,7 +8,7 @@ class Group extends StatefulWidget { const Group(this.groupData, this.meshNetwork, {Key? key}) : super(key: key); @override - _GroupState createState() => _GroupState(); + State createState() => _GroupState(); } class _GroupState extends State { diff --git a/example/lib/src/widgets/mesh_network_widget.dart b/example/lib/src/widgets/mesh_network_widget.dart index 4ee11a956..f71e32710 100644 --- a/example/lib/src/widgets/mesh_network_widget.dart +++ b/example/lib/src/widgets/mesh_network_widget.dart @@ -10,7 +10,7 @@ class MeshNetworkDataWidget extends StatefulWidget { const MeshNetworkDataWidget({Key? key, required this.meshNetwork}) : super(key: key); @override - _MeshNetworkDataWidgetState createState() => _MeshNetworkDataWidgetState(); + State createState() => _MeshNetworkDataWidgetState(); } class _MeshNetworkDataWidgetState extends State { diff --git a/example/lib/src/widgets/node.dart b/example/lib/src/widgets/node.dart index 33ddcf5f7..25f644ee1 100644 --- a/example/lib/src/widgets/node.dart +++ b/example/lib/src/widgets/node.dart @@ -9,7 +9,7 @@ class Node extends StatefulWidget { const Node(this.node, this.meshNetwork, this.testKey, {Key? key}) : super(key: key); @override - _NodeState createState() => _NodeState(); + State createState() => _NodeState(); } class _NodeState extends State { diff --git a/example/pubspec.lock b/example/pubspec.lock index 6e2ae876a..965fdd230 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "47.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "4.7.0" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.3.0" args: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -57,27 +57,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -91,28 +84,70 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.5.0" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" - cupertino_icons: + version: "3.0.2" + device_info_plus: dependency: "direct main" description: - name: cupertino_icons + name: device_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "6.0.0" + device_info_plus_linux: + dependency: transitive + description: + name: device_info_plus_linux + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + device_info_plus_macos: + dependency: transitive + description: + name: device_info_plus_macos + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + device_info_plus_web: + dependency: transitive + description: + name: device_info_plus_web + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + device_info_plus_windows: + dependency: transitive + description: + name: device_info_plus_windows + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" file: dependency: transitive description: @@ -126,7 +161,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "5.2.1" fixnum: dependency: transitive description: @@ -145,26 +180,26 @@ packages: source: sdk version: "0.0.0" flutter_lints: - dependency: transitive + dependency: "direct dev" description: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.7" flutter_reactive_ble: - dependency: transitive + dependency: "direct main" description: name: flutter_reactive_ble url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -181,7 +216,7 @@ packages: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.1.0" frontend_server_client: dependency: transitive description: @@ -235,21 +270,21 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.7.0" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -263,21 +298,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -298,7 +333,7 @@ packages: path: ".." relative: true source: path - version: "0.12.0" + version: "0.13.0" package_config: dependency: transitive description: @@ -312,7 +347,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" pedantic: dependency: transitive description: @@ -320,6 +355,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.11.1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "10.1.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + url: "https://pub.dartlang.org" + source: hosted + version: "10.1.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.6" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.9.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" platform: dependency: transitive description: @@ -333,7 +403,7 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.3" pool: dependency: transitive description: @@ -368,14 +438,14 @@ packages: name: reactive_ble_mobile url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" reactive_ble_platform_interface: dependency: transitive description: name: reactive_ble_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" retry: dependency: transitive description: @@ -389,7 +459,7 @@ packages: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.27.3" + version: "0.27.5" shelf: dependency: transitive description: @@ -443,7 +513,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -464,63 +534,63 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" sync_http: dependency: transitive description: name: sync_http url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: "direct dev" description: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.19.5" + version: "1.21.4" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.12" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.16" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" vm_service: dependency: transitive description: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "7.5.0" + version: "9.0.0" watcher: dependency: transitive description: @@ -549,6 +619,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" yaml: dependency: transitive description: @@ -557,5 +634,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f729a1061..adeaba292 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -5,26 +5,28 @@ version: 1.2.0 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=2.0.0 <3.0.0" + sdk: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" dependencies: flutter: sdk: flutter - file_picker: ^3.0.4 + file_picker: ^5.2.1 + flutter_reactive_ble: ^5.0.2 + permission_handler: ^10.1.0 + device_info_plus: ^6.0.0 nordic_nrf_mesh: path: ../ - cupertino_icons: ^1.0.3 - dev_dependencies: flutter_test: sdk: flutter flutter_driver: sdk: flutter test: any + flutter_lints: ^2.0.1 flutter: uses-material-design: true diff --git a/example/test_driver/app_test.dart b/example/test_driver/app_test.dart index 427d9ac88..7d7bb75e0 100644 --- a/example/test_driver/app_test.dart +++ b/example/test_driver/app_test.dart @@ -1,5 +1,6 @@ +import 'dart:async'; + import 'package:flutter_driver/flutter_driver.dart'; -import 'package:pedantic/pedantic.dart'; import 'package:test/test.dart'; void main() { diff --git a/ios/nordic_nrf_mesh.podspec b/ios/nordic_nrf_mesh.podspec index 6f09d09f3..0c040f58f 100644 --- a/ios/nordic_nrf_mesh.podspec +++ b/ios/nordic_nrf_mesh.podspec @@ -1,10 +1,10 @@ # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint nordic_nrf_mesh.podspec' to validate before publishing. +# Run `pod lib lint nordic_nrf_mesh.podspec` to validate before publishing. # Pod::Spec.new do |s| s.name = 'nordic_nrf_mesh' - s.version = '0.11.0' + s.version = '0.13.0' s.summary = 'A Flutter plugin to enable mesh network management and communication using Nordic Semiconductor SDKs.' s.description = <<-DESC A Flutter plugin to enable mesh network management and communication using Nordic Semiconductor SDKs. @@ -17,9 +17,9 @@ A Flutter plugin to enable mesh network management and communication using Nordi s.dependency 'Flutter' s.dependency 'nRFMeshProvision' - s.platform = :ios, '11.0' + s.platform = :ios, '12.0' - # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' end diff --git a/lib/src/ble/ble_manager.dart b/lib/src/ble/ble_manager.dart index 2303d7bc4..3af1f111d 100644 --- a/lib/src/ble/ble_manager.dart +++ b/lib/src/ble/ble_manager.dart @@ -1,3 +1,5 @@ +// ignore_for_file: no_leading_underscores_for_local_identifiers + import 'dart:async'; import 'dart:io'; diff --git a/lib/src/ble/ble_mesh_manager.dart b/lib/src/ble/ble_mesh_manager.dart index 9af9bb6ba..65ad2afbc 100644 --- a/lib/src/ble/ble_mesh_manager.dart +++ b/lib/src/ble/ble_mesh_manager.dart @@ -15,7 +15,7 @@ import 'package:retry/retry.dart'; /// It implements the methods to init GATT layer, subscribe to notifications and send PDUs for **BLE Mesh** nodes. /// {@endtemplate} class BleMeshManager extends BleManager { - static late final BleMeshManager _instance = BleMeshManager._(FlutterReactiveBle()); + static final BleMeshManager _instance = BleMeshManager._(FlutterReactiveBle()); /// The list of [DiscoveredService] that were discovered during the last connection process late List _discoveredServices; @@ -26,7 +26,7 @@ class BleMeshManager extends BleManager { /// The subscription for data when the connected node is a free mesh node (ie. waiting to be provisioned in a network) StreamSubscription>? _meshProvisioningDataOutSubscription; - BleMeshManager._(FlutterReactiveBle _bleInstance) : super(_bleInstance); + BleMeshManager._(FlutterReactiveBle bleInstance) : super(bleInstance); /// {@macro ble_mesh_manager} factory BleMeshManager() => _instance as BleMeshManager; @@ -148,16 +148,16 @@ class BleMeshManager extends BleManager { callbacks!.onDataReceivedController.add(BleMeshManagerCallbacksDataReceived(device!, mtuSize, data)); } else { if (!connectCompleter.isCompleted) { - const _msg = 'no callback ready to receive data event'; - _log(_msg); - connectCompleter.completeError(const BleManagerException(BleManagerFailureCode.callbacks, _msg)); + const msg = 'no callback ready to receive data event'; + _log(msg); + connectCompleter.completeError(const BleManagerException(BleManagerFailureCode.callbacks, msg)); } } }, onError: (e, s) { - const _msg = 'error in device data stream'; - _log('$_msg : $e\n$s'); + const msg = 'error in device data stream'; + _log('$msg : $e\n$s'); if (!(callbacks?.onErrorController.isClosed == true) && callbacks!.onErrorController.hasListener) { - callbacks!.onErrorController.add(BleManagerCallbacksError(device, _msg, e)); + callbacks!.onErrorController.add(BleManagerCallbacksError(device, msg, e)); } if (!connectCompleter.isCompleted) { // will notify for error as the connection could not be properly established diff --git a/lib/src/ble/ble_scanner.dart b/lib/src/ble/ble_scanner.dart index 04f3cc24b..00752bd7f 100644 --- a/lib/src/ble/ble_scanner.dart +++ b/lib/src/ble/ble_scanner.dart @@ -23,7 +23,7 @@ class BleScannerError { /// This singleton is used to wrap the Bluetooth scanning features of [FlutterReactiveBle]. /// {@endtemplate} class BleScanner { - static late final BleScanner _instance = BleScanner._(); + static final BleScanner _instance = BleScanner._(); BleScanner._(); diff --git a/lib/src/events/data/config_composition_data_status/config_composition_data_status.freezed.dart b/lib/src/events/data/config_composition_data_status/config_composition_data_status.freezed.dart index cf176419a..4c88f56e8 100644 --- a/lib/src/events/data/config_composition_data_status/config_composition_data_status.freezed.dart +++ b/lib/src/events/data/config_composition_data_status/config_composition_data_status.freezed.dart @@ -1,5 +1,7 @@ +// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target part of 'config_composition_data_status.dart'; @@ -10,31 +12,12 @@ part of 'config_composition_data_status.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); ConfigCompositionDataStatusData _$ConfigCompositionDataStatusDataFromJson(Map json) { return _ConfigCompositionDataStatusData.fromJson(json); } -/// @nodoc -class _$ConfigCompositionDataStatusDataTearOff { - const _$ConfigCompositionDataStatusDataTearOff(); - - _ConfigCompositionDataStatusData call(int source, ConfigCompositionDataStatusMeshMessage meshMessage) { - return _ConfigCompositionDataStatusData( - source, - meshMessage, - ); - } - - ConfigCompositionDataStatusData fromJson(Map json) { - return ConfigCompositionDataStatusData.fromJson(json); - } -} - -/// @nodoc -const $ConfigCompositionDataStatusData = _$ConfigCompositionDataStatusDataTearOff(); - /// @nodoc mixin _$ConfigCompositionDataStatusData { int get source => throw _privateConstructorUsedError; @@ -90,11 +73,11 @@ class _$ConfigCompositionDataStatusDataCopyWithImpl<$Res> implements $ConfigComp } /// @nodoc -abstract class _$ConfigCompositionDataStatusDataCopyWith<$Res> +abstract class _$$_ConfigCompositionDataStatusDataCopyWith<$Res> implements $ConfigCompositionDataStatusDataCopyWith<$Res> { - factory _$ConfigCompositionDataStatusDataCopyWith( - _ConfigCompositionDataStatusData value, $Res Function(_ConfigCompositionDataStatusData) then) = - __$ConfigCompositionDataStatusDataCopyWithImpl<$Res>; + factory _$$_ConfigCompositionDataStatusDataCopyWith( + _$_ConfigCompositionDataStatusData value, $Res Function(_$_ConfigCompositionDataStatusData) then) = + __$$_ConfigCompositionDataStatusDataCopyWithImpl<$Res>; @override $Res call({int source, ConfigCompositionDataStatusMeshMessage meshMessage}); @@ -103,21 +86,21 @@ abstract class _$ConfigCompositionDataStatusDataCopyWith<$Res> } /// @nodoc -class __$ConfigCompositionDataStatusDataCopyWithImpl<$Res> extends _$ConfigCompositionDataStatusDataCopyWithImpl<$Res> - implements _$ConfigCompositionDataStatusDataCopyWith<$Res> { - __$ConfigCompositionDataStatusDataCopyWithImpl( - _ConfigCompositionDataStatusData _value, $Res Function(_ConfigCompositionDataStatusData) _then) - : super(_value, (v) => _then(v as _ConfigCompositionDataStatusData)); +class __$$_ConfigCompositionDataStatusDataCopyWithImpl<$Res> extends _$ConfigCompositionDataStatusDataCopyWithImpl<$Res> + implements _$$_ConfigCompositionDataStatusDataCopyWith<$Res> { + __$$_ConfigCompositionDataStatusDataCopyWithImpl( + _$_ConfigCompositionDataStatusData _value, $Res Function(_$_ConfigCompositionDataStatusData) _then) + : super(_value, (v) => _then(v as _$_ConfigCompositionDataStatusData)); @override - _ConfigCompositionDataStatusData get _value => super._value as _ConfigCompositionDataStatusData; + _$_ConfigCompositionDataStatusData get _value => super._value as _$_ConfigCompositionDataStatusData; @override $Res call({ Object? source = freezed, Object? meshMessage = freezed, }) { - return _then(_ConfigCompositionDataStatusData( + return _then(_$_ConfigCompositionDataStatusData( source == freezed ? _value.source : source // ignore: cast_nullable_to_non_nullable @@ -137,7 +120,7 @@ class _$_ConfigCompositionDataStatusData implements _ConfigCompositionDataStatus const _$_ConfigCompositionDataStatusData(this.source, this.meshMessage); factory _$_ConfigCompositionDataStatusData.fromJson(Map json) => - _$_$_ConfigCompositionDataStatusDataFromJson(json); + _$$_ConfigCompositionDataStatusDataFromJson(json); @override final int source; @@ -152,43 +135,44 @@ class _$_ConfigCompositionDataStatusData implements _ConfigCompositionDataStatus @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _ConfigCompositionDataStatusData && - (identical(other.source, source) || const DeepCollectionEquality().equals(other.source, source)) && - (identical(other.meshMessage, meshMessage) || - const DeepCollectionEquality().equals(other.meshMessage, meshMessage))); + (other.runtimeType == runtimeType && + other is _$_ConfigCompositionDataStatusData && + const DeepCollectionEquality().equals(other.source, source) && + const DeepCollectionEquality().equals(other.meshMessage, meshMessage)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(source) ^ - const DeepCollectionEquality().hash(meshMessage); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(source), const DeepCollectionEquality().hash(meshMessage)); @JsonKey(ignore: true) @override - _$ConfigCompositionDataStatusDataCopyWith<_ConfigCompositionDataStatusData> get copyWith => - __$ConfigCompositionDataStatusDataCopyWithImpl<_ConfigCompositionDataStatusData>(this, _$identity); + _$$_ConfigCompositionDataStatusDataCopyWith<_$_ConfigCompositionDataStatusData> get copyWith => + __$$_ConfigCompositionDataStatusDataCopyWithImpl<_$_ConfigCompositionDataStatusData>(this, _$identity); @override Map toJson() { - return _$_$_ConfigCompositionDataStatusDataToJson(this); + return _$$_ConfigCompositionDataStatusDataToJson( + this, + ); } } abstract class _ConfigCompositionDataStatusData implements ConfigCompositionDataStatusData { - const factory _ConfigCompositionDataStatusData(int source, ConfigCompositionDataStatusMeshMessage meshMessage) = - _$_ConfigCompositionDataStatusData; + const factory _ConfigCompositionDataStatusData( + final int source, final ConfigCompositionDataStatusMeshMessage meshMessage) = _$_ConfigCompositionDataStatusData; factory _ConfigCompositionDataStatusData.fromJson(Map json) = _$_ConfigCompositionDataStatusData.fromJson; @override - int get source => throw _privateConstructorUsedError; + int get source; @override - ConfigCompositionDataStatusMeshMessage get meshMessage => throw _privateConstructorUsedError; + ConfigCompositionDataStatusMeshMessage get meshMessage; @override @JsonKey(ignore: true) - _$ConfigCompositionDataStatusDataCopyWith<_ConfigCompositionDataStatusData> get copyWith => + _$$_ConfigCompositionDataStatusDataCopyWith<_$_ConfigCompositionDataStatusData> get copyWith => throw _privateConstructorUsedError; } @@ -196,26 +180,6 @@ ConfigCompositionDataStatusMeshMessage _$ConfigCompositionDataStatusMeshMessageF return _ConfigCompositionDataStatusMeshMessage.fromJson(json); } -/// @nodoc -class _$ConfigCompositionDataStatusMeshMessageTearOff { - const _$ConfigCompositionDataStatusMeshMessageTearOff(); - - _ConfigCompositionDataStatusMeshMessage call(int source, int? aszmic, int destination) { - return _ConfigCompositionDataStatusMeshMessage( - source, - aszmic, - destination, - ); - } - - ConfigCompositionDataStatusMeshMessage fromJson(Map json) { - return ConfigCompositionDataStatusMeshMessage.fromJson(json); - } -} - -/// @nodoc -const $ConfigCompositionDataStatusMeshMessage = _$ConfigCompositionDataStatusMeshMessageTearOff(); - /// @nodoc mixin _$ConfigCompositionDataStatusMeshMessage { int get source => throw _privateConstructorUsedError; @@ -269,25 +233,25 @@ class _$ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res> } /// @nodoc -abstract class _$ConfigCompositionDataStatusMeshMessageCopyWith<$Res> +abstract class _$$_ConfigCompositionDataStatusMeshMessageCopyWith<$Res> implements $ConfigCompositionDataStatusMeshMessageCopyWith<$Res> { - factory _$ConfigCompositionDataStatusMeshMessageCopyWith( - _ConfigCompositionDataStatusMeshMessage value, $Res Function(_ConfigCompositionDataStatusMeshMessage) then) = - __$ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res>; + factory _$$_ConfigCompositionDataStatusMeshMessageCopyWith(_$_ConfigCompositionDataStatusMeshMessage value, + $Res Function(_$_ConfigCompositionDataStatusMeshMessage) then) = + __$$_ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res>; @override $Res call({int source, int? aszmic, int destination}); } /// @nodoc -class __$ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res> +class __$$_ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res> extends _$ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res> - implements _$ConfigCompositionDataStatusMeshMessageCopyWith<$Res> { - __$ConfigCompositionDataStatusMeshMessageCopyWithImpl( - _ConfigCompositionDataStatusMeshMessage _value, $Res Function(_ConfigCompositionDataStatusMeshMessage) _then) - : super(_value, (v) => _then(v as _ConfigCompositionDataStatusMeshMessage)); + implements _$$_ConfigCompositionDataStatusMeshMessageCopyWith<$Res> { + __$$_ConfigCompositionDataStatusMeshMessageCopyWithImpl( + _$_ConfigCompositionDataStatusMeshMessage _value, $Res Function(_$_ConfigCompositionDataStatusMeshMessage) _then) + : super(_value, (v) => _then(v as _$_ConfigCompositionDataStatusMeshMessage)); @override - _ConfigCompositionDataStatusMeshMessage get _value => super._value as _ConfigCompositionDataStatusMeshMessage; + _$_ConfigCompositionDataStatusMeshMessage get _value => super._value as _$_ConfigCompositionDataStatusMeshMessage; @override $Res call({ @@ -295,7 +259,7 @@ class __$ConfigCompositionDataStatusMeshMessageCopyWithImpl<$Res> Object? aszmic = freezed, Object? destination = freezed, }) { - return _then(_ConfigCompositionDataStatusMeshMessage( + return _then(_$_ConfigCompositionDataStatusMeshMessage( source == freezed ? _value.source : source // ignore: cast_nullable_to_non_nullable @@ -318,7 +282,7 @@ class _$_ConfigCompositionDataStatusMeshMessage implements _ConfigCompositionDat const _$_ConfigCompositionDataStatusMeshMessage(this.source, this.aszmic, this.destination); factory _$_ConfigCompositionDataStatusMeshMessage.fromJson(Map json) => - _$_$_ConfigCompositionDataStatusMeshMessageFromJson(json); + _$$_ConfigCompositionDataStatusMeshMessageFromJson(json); @override final int source; @@ -335,46 +299,47 @@ class _$_ConfigCompositionDataStatusMeshMessage implements _ConfigCompositionDat @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _ConfigCompositionDataStatusMeshMessage && - (identical(other.source, source) || const DeepCollectionEquality().equals(other.source, source)) && - (identical(other.aszmic, aszmic) || const DeepCollectionEquality().equals(other.aszmic, aszmic)) && - (identical(other.destination, destination) || - const DeepCollectionEquality().equals(other.destination, destination))); + (other.runtimeType == runtimeType && + other is _$_ConfigCompositionDataStatusMeshMessage && + const DeepCollectionEquality().equals(other.source, source) && + const DeepCollectionEquality().equals(other.aszmic, aszmic) && + const DeepCollectionEquality().equals(other.destination, destination)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(source) ^ - const DeepCollectionEquality().hash(aszmic) ^ - const DeepCollectionEquality().hash(destination); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(source), + const DeepCollectionEquality().hash(aszmic), const DeepCollectionEquality().hash(destination)); @JsonKey(ignore: true) @override - _$ConfigCompositionDataStatusMeshMessageCopyWith<_ConfigCompositionDataStatusMeshMessage> get copyWith => - __$ConfigCompositionDataStatusMeshMessageCopyWithImpl<_ConfigCompositionDataStatusMeshMessage>(this, _$identity); + _$$_ConfigCompositionDataStatusMeshMessageCopyWith<_$_ConfigCompositionDataStatusMeshMessage> get copyWith => + __$$_ConfigCompositionDataStatusMeshMessageCopyWithImpl<_$_ConfigCompositionDataStatusMeshMessage>( + this, _$identity); @override Map toJson() { - return _$_$_ConfigCompositionDataStatusMeshMessageToJson(this); + return _$$_ConfigCompositionDataStatusMeshMessageToJson( + this, + ); } } abstract class _ConfigCompositionDataStatusMeshMessage implements ConfigCompositionDataStatusMeshMessage { - const factory _ConfigCompositionDataStatusMeshMessage(int source, int? aszmic, int destination) = + const factory _ConfigCompositionDataStatusMeshMessage(final int source, final int? aszmic, final int destination) = _$_ConfigCompositionDataStatusMeshMessage; factory _ConfigCompositionDataStatusMeshMessage.fromJson(Map json) = _$_ConfigCompositionDataStatusMeshMessage.fromJson; @override - int get source => throw _privateConstructorUsedError; + int get source; @override - int? get aszmic => throw _privateConstructorUsedError; + int? get aszmic; @override - int get destination => throw _privateConstructorUsedError; + int get destination; @override @JsonKey(ignore: true) - _$ConfigCompositionDataStatusMeshMessageCopyWith<_ConfigCompositionDataStatusMeshMessage> get copyWith => + _$$_ConfigCompositionDataStatusMeshMessageCopyWith<_$_ConfigCompositionDataStatusMeshMessage> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/events/data/config_composition_data_status/config_composition_data_status.g.dart b/lib/src/events/data/config_composition_data_status/config_composition_data_status.g.dart index 048daa3e3..bca7cf78f 100644 --- a/lib/src/events/data/config_composition_data_status/config_composition_data_status.g.dart +++ b/lib/src/events/data/config_composition_data_status/config_composition_data_status.g.dart @@ -6,29 +6,27 @@ part of 'config_composition_data_status.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_ConfigCompositionDataStatusData _$_$_ConfigCompositionDataStatusDataFromJson(Map json) { - return _$_ConfigCompositionDataStatusData( - json['source'] as int, - ConfigCompositionDataStatusMeshMessage.fromJson(Map.from(json['meshMessage'] as Map)), - ); -} +_$_ConfigCompositionDataStatusData _$$_ConfigCompositionDataStatusDataFromJson(Map json) => + _$_ConfigCompositionDataStatusData( + json['source'] as int, + ConfigCompositionDataStatusMeshMessage.fromJson(Map.from(json['meshMessage'] as Map)), + ); -Map _$_$_ConfigCompositionDataStatusDataToJson(_$_ConfigCompositionDataStatusData instance) => +Map _$$_ConfigCompositionDataStatusDataToJson(_$_ConfigCompositionDataStatusData instance) => { 'source': instance.source, 'meshMessage': instance.meshMessage, }; -_$_ConfigCompositionDataStatusMeshMessage _$_$_ConfigCompositionDataStatusMeshMessageFromJson( - Map json) { - return _$_ConfigCompositionDataStatusMeshMessage( - json['source'] as int, - json['aszmic'] as int?, - json['destination'] as int, - ); -} +_$_ConfigCompositionDataStatusMeshMessage _$$_ConfigCompositionDataStatusMeshMessageFromJson( + Map json) => + _$_ConfigCompositionDataStatusMeshMessage( + json['source'] as int, + json['aszmic'] as int?, + json['destination'] as int, + ); -Map _$_$_ConfigCompositionDataStatusMeshMessageToJson( +Map _$$_ConfigCompositionDataStatusMeshMessageToJson( _$_ConfigCompositionDataStatusMeshMessage instance) => { 'source': instance.source, diff --git a/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.freezed.dart b/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.freezed.dart index c53224825..9ccbc8be9 100644 --- a/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.freezed.dart +++ b/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.freezed.dart @@ -1,5 +1,7 @@ +// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target part of 'mesh_provisioning_status.dart'; @@ -10,31 +12,12 @@ part of 'mesh_provisioning_status.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); UnprovisionedMeshNodeData _$UnprovisionedMeshNodeDataFromJson(Map json) { return _UnprovisionedMeshNodeData.fromJson(json); } -/// @nodoc -class _$UnprovisionedMeshNodeDataTearOff { - const _$UnprovisionedMeshNodeDataTearOff(); - - _UnprovisionedMeshNodeData call(String uuid, {List? provisionerPublicKeyXY = const []}) { - return _UnprovisionedMeshNodeData( - uuid, - provisionerPublicKeyXY: provisionerPublicKeyXY, - ); - } - - UnprovisionedMeshNodeData fromJson(Map json) { - return UnprovisionedMeshNodeData.fromJson(json); - } -} - -/// @nodoc -const $UnprovisionedMeshNodeData = _$UnprovisionedMeshNodeDataTearOff(); - /// @nodoc mixin _$UnprovisionedMeshNodeData { String get uuid => throw _privateConstructorUsedError; @@ -80,36 +63,36 @@ class _$UnprovisionedMeshNodeDataCopyWithImpl<$Res> implements $UnprovisionedMes } /// @nodoc -abstract class _$UnprovisionedMeshNodeDataCopyWith<$Res> implements $UnprovisionedMeshNodeDataCopyWith<$Res> { - factory _$UnprovisionedMeshNodeDataCopyWith( - _UnprovisionedMeshNodeData value, $Res Function(_UnprovisionedMeshNodeData) then) = - __$UnprovisionedMeshNodeDataCopyWithImpl<$Res>; +abstract class _$$_UnprovisionedMeshNodeDataCopyWith<$Res> implements $UnprovisionedMeshNodeDataCopyWith<$Res> { + factory _$$_UnprovisionedMeshNodeDataCopyWith( + _$_UnprovisionedMeshNodeData value, $Res Function(_$_UnprovisionedMeshNodeData) then) = + __$$_UnprovisionedMeshNodeDataCopyWithImpl<$Res>; @override $Res call({String uuid, List? provisionerPublicKeyXY}); } /// @nodoc -class __$UnprovisionedMeshNodeDataCopyWithImpl<$Res> extends _$UnprovisionedMeshNodeDataCopyWithImpl<$Res> - implements _$UnprovisionedMeshNodeDataCopyWith<$Res> { - __$UnprovisionedMeshNodeDataCopyWithImpl( - _UnprovisionedMeshNodeData _value, $Res Function(_UnprovisionedMeshNodeData) _then) - : super(_value, (v) => _then(v as _UnprovisionedMeshNodeData)); +class __$$_UnprovisionedMeshNodeDataCopyWithImpl<$Res> extends _$UnprovisionedMeshNodeDataCopyWithImpl<$Res> + implements _$$_UnprovisionedMeshNodeDataCopyWith<$Res> { + __$$_UnprovisionedMeshNodeDataCopyWithImpl( + _$_UnprovisionedMeshNodeData _value, $Res Function(_$_UnprovisionedMeshNodeData) _then) + : super(_value, (v) => _then(v as _$_UnprovisionedMeshNodeData)); @override - _UnprovisionedMeshNodeData get _value => super._value as _UnprovisionedMeshNodeData; + _$_UnprovisionedMeshNodeData get _value => super._value as _$_UnprovisionedMeshNodeData; @override $Res call({ Object? uuid = freezed, Object? provisionerPublicKeyXY = freezed, }) { - return _then(_UnprovisionedMeshNodeData( + return _then(_$_UnprovisionedMeshNodeData( uuid == freezed ? _value.uuid : uuid // ignore: cast_nullable_to_non_nullable as String, provisionerPublicKeyXY: provisionerPublicKeyXY == freezed - ? _value.provisionerPublicKeyXY + ? _value._provisionerPublicKeyXY : provisionerPublicKeyXY // ignore: cast_nullable_to_non_nullable as List?, )); @@ -119,16 +102,23 @@ class __$UnprovisionedMeshNodeDataCopyWithImpl<$Res> extends _$UnprovisionedMesh /// @nodoc @JsonSerializable() class _$_UnprovisionedMeshNodeData implements _UnprovisionedMeshNodeData { - const _$_UnprovisionedMeshNodeData(this.uuid, {this.provisionerPublicKeyXY = const []}); + const _$_UnprovisionedMeshNodeData(this.uuid, {final List? provisionerPublicKeyXY = const []}) + : _provisionerPublicKeyXY = provisionerPublicKeyXY; factory _$_UnprovisionedMeshNodeData.fromJson(Map json) => - _$_$_UnprovisionedMeshNodeDataFromJson(json); + _$$_UnprovisionedMeshNodeDataFromJson(json); @override final String uuid; - @JsonKey(defaultValue: const []) - @override - final List? provisionerPublicKeyXY; + final List? _provisionerPublicKeyXY; + @override + @JsonKey() + List? get provisionerPublicKeyXY { + final value = _provisionerPublicKeyXY; + if (value == null) return null; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } @override String toString() { @@ -138,66 +128,50 @@ class _$_UnprovisionedMeshNodeData implements _UnprovisionedMeshNodeData { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _UnprovisionedMeshNodeData && - (identical(other.uuid, uuid) || const DeepCollectionEquality().equals(other.uuid, uuid)) && - (identical(other.provisionerPublicKeyXY, provisionerPublicKeyXY) || - const DeepCollectionEquality().equals(other.provisionerPublicKeyXY, provisionerPublicKeyXY))); + (other.runtimeType == runtimeType && + other is _$_UnprovisionedMeshNodeData && + const DeepCollectionEquality().equals(other.uuid, uuid) && + const DeepCollectionEquality().equals(other._provisionerPublicKeyXY, _provisionerPublicKeyXY)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(uuid) ^ - const DeepCollectionEquality().hash(provisionerPublicKeyXY); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(uuid), + const DeepCollectionEquality().hash(_provisionerPublicKeyXY)); @JsonKey(ignore: true) @override - _$UnprovisionedMeshNodeDataCopyWith<_UnprovisionedMeshNodeData> get copyWith => - __$UnprovisionedMeshNodeDataCopyWithImpl<_UnprovisionedMeshNodeData>(this, _$identity); + _$$_UnprovisionedMeshNodeDataCopyWith<_$_UnprovisionedMeshNodeData> get copyWith => + __$$_UnprovisionedMeshNodeDataCopyWithImpl<_$_UnprovisionedMeshNodeData>(this, _$identity); @override Map toJson() { - return _$_$_UnprovisionedMeshNodeDataToJson(this); + return _$$_UnprovisionedMeshNodeDataToJson( + this, + ); } } abstract class _UnprovisionedMeshNodeData implements UnprovisionedMeshNodeData { - const factory _UnprovisionedMeshNodeData(String uuid, {List? provisionerPublicKeyXY}) = + const factory _UnprovisionedMeshNodeData(final String uuid, {final List? provisionerPublicKeyXY}) = _$_UnprovisionedMeshNodeData; factory _UnprovisionedMeshNodeData.fromJson(Map json) = _$_UnprovisionedMeshNodeData.fromJson; @override - String get uuid => throw _privateConstructorUsedError; + String get uuid; @override - List? get provisionerPublicKeyXY => throw _privateConstructorUsedError; + List? get provisionerPublicKeyXY; @override @JsonKey(ignore: true) - _$UnprovisionedMeshNodeDataCopyWith<_UnprovisionedMeshNodeData> get copyWith => throw _privateConstructorUsedError; + _$$_UnprovisionedMeshNodeDataCopyWith<_$_UnprovisionedMeshNodeData> get copyWith => + throw _privateConstructorUsedError; } ProvisionedMeshNodeData _$ProvisionedMeshNodeDataFromJson(Map json) { return _ProvisionedMeshNodeData.fromJson(json); } -/// @nodoc -class _$ProvisionedMeshNodeDataTearOff { - const _$ProvisionedMeshNodeDataTearOff(); - - _ProvisionedMeshNodeData call(String uuid) { - return _ProvisionedMeshNodeData( - uuid, - ); - } - - ProvisionedMeshNodeData fromJson(Map json) { - return ProvisionedMeshNodeData.fromJson(json); - } -} - -/// @nodoc -const $ProvisionedMeshNodeData = _$ProvisionedMeshNodeDataTearOff(); - /// @nodoc mixin _$ProvisionedMeshNodeData { String get uuid => throw _privateConstructorUsedError; @@ -236,28 +210,29 @@ class _$ProvisionedMeshNodeDataCopyWithImpl<$Res> implements $ProvisionedMeshNod } /// @nodoc -abstract class _$ProvisionedMeshNodeDataCopyWith<$Res> implements $ProvisionedMeshNodeDataCopyWith<$Res> { - factory _$ProvisionedMeshNodeDataCopyWith( - _ProvisionedMeshNodeData value, $Res Function(_ProvisionedMeshNodeData) then) = - __$ProvisionedMeshNodeDataCopyWithImpl<$Res>; +abstract class _$$_ProvisionedMeshNodeDataCopyWith<$Res> implements $ProvisionedMeshNodeDataCopyWith<$Res> { + factory _$$_ProvisionedMeshNodeDataCopyWith( + _$_ProvisionedMeshNodeData value, $Res Function(_$_ProvisionedMeshNodeData) then) = + __$$_ProvisionedMeshNodeDataCopyWithImpl<$Res>; @override $Res call({String uuid}); } /// @nodoc -class __$ProvisionedMeshNodeDataCopyWithImpl<$Res> extends _$ProvisionedMeshNodeDataCopyWithImpl<$Res> - implements _$ProvisionedMeshNodeDataCopyWith<$Res> { - __$ProvisionedMeshNodeDataCopyWithImpl(_ProvisionedMeshNodeData _value, $Res Function(_ProvisionedMeshNodeData) _then) - : super(_value, (v) => _then(v as _ProvisionedMeshNodeData)); +class __$$_ProvisionedMeshNodeDataCopyWithImpl<$Res> extends _$ProvisionedMeshNodeDataCopyWithImpl<$Res> + implements _$$_ProvisionedMeshNodeDataCopyWith<$Res> { + __$$_ProvisionedMeshNodeDataCopyWithImpl( + _$_ProvisionedMeshNodeData _value, $Res Function(_$_ProvisionedMeshNodeData) _then) + : super(_value, (v) => _then(v as _$_ProvisionedMeshNodeData)); @override - _ProvisionedMeshNodeData get _value => super._value as _ProvisionedMeshNodeData; + _$_ProvisionedMeshNodeData get _value => super._value as _$_ProvisionedMeshNodeData; @override $Res call({ Object? uuid = freezed, }) { - return _then(_ProvisionedMeshNodeData( + return _then(_$_ProvisionedMeshNodeData( uuid == freezed ? _value.uuid : uuid // ignore: cast_nullable_to_non_nullable @@ -271,7 +246,7 @@ class __$ProvisionedMeshNodeDataCopyWithImpl<$Res> extends _$ProvisionedMeshNode class _$_ProvisionedMeshNodeData implements _ProvisionedMeshNodeData { const _$_ProvisionedMeshNodeData(this.uuid); - factory _$_ProvisionedMeshNodeData.fromJson(Map json) => _$_$_ProvisionedMeshNodeDataFromJson(json); + factory _$_ProvisionedMeshNodeData.fromJson(Map json) => _$$_ProvisionedMeshNodeDataFromJson(json); @override final String uuid; @@ -284,60 +259,44 @@ class _$_ProvisionedMeshNodeData implements _ProvisionedMeshNodeData { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _ProvisionedMeshNodeData && - (identical(other.uuid, uuid) || const DeepCollectionEquality().equals(other.uuid, uuid))); + (other.runtimeType == runtimeType && + other is _$_ProvisionedMeshNodeData && + const DeepCollectionEquality().equals(other.uuid, uuid)); } + @JsonKey(ignore: true) @override - int get hashCode => runtimeType.hashCode ^ const DeepCollectionEquality().hash(uuid); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(uuid)); @JsonKey(ignore: true) @override - _$ProvisionedMeshNodeDataCopyWith<_ProvisionedMeshNodeData> get copyWith => - __$ProvisionedMeshNodeDataCopyWithImpl<_ProvisionedMeshNodeData>(this, _$identity); + _$$_ProvisionedMeshNodeDataCopyWith<_$_ProvisionedMeshNodeData> get copyWith => + __$$_ProvisionedMeshNodeDataCopyWithImpl<_$_ProvisionedMeshNodeData>(this, _$identity); @override Map toJson() { - return _$_$_ProvisionedMeshNodeDataToJson(this); + return _$$_ProvisionedMeshNodeDataToJson( + this, + ); } } abstract class _ProvisionedMeshNodeData implements ProvisionedMeshNodeData { - const factory _ProvisionedMeshNodeData(String uuid) = _$_ProvisionedMeshNodeData; + const factory _ProvisionedMeshNodeData(final String uuid) = _$_ProvisionedMeshNodeData; factory _ProvisionedMeshNodeData.fromJson(Map json) = _$_ProvisionedMeshNodeData.fromJson; @override - String get uuid => throw _privateConstructorUsedError; + String get uuid; @override @JsonKey(ignore: true) - _$ProvisionedMeshNodeDataCopyWith<_ProvisionedMeshNodeData> get copyWith => throw _privateConstructorUsedError; + _$$_ProvisionedMeshNodeDataCopyWith<_$_ProvisionedMeshNodeData> get copyWith => throw _privateConstructorUsedError; } MeshProvisioningStatusData _$MeshProvisioningStatusDataFromJson(Map json) { return _MeshProvisioningStatusData.fromJson(json); } -/// @nodoc -class _$MeshProvisioningStatusDataTearOff { - const _$MeshProvisioningStatusDataTearOff(); - - _MeshProvisioningStatusData call(String state, List data, UnprovisionedMeshNodeData? meshNode) { - return _MeshProvisioningStatusData( - state, - data, - meshNode, - ); - } - - MeshProvisioningStatusData fromJson(Map json) { - return MeshProvisioningStatusData.fromJson(json); - } -} - -/// @nodoc -const $MeshProvisioningStatusData = _$MeshProvisioningStatusDataTearOff(); - /// @nodoc mixin _$MeshProvisioningStatusData { String get state => throw _privateConstructorUsedError; @@ -402,10 +361,10 @@ class _$MeshProvisioningStatusDataCopyWithImpl<$Res> implements $MeshProvisionin } /// @nodoc -abstract class _$MeshProvisioningStatusDataCopyWith<$Res> implements $MeshProvisioningStatusDataCopyWith<$Res> { - factory _$MeshProvisioningStatusDataCopyWith( - _MeshProvisioningStatusData value, $Res Function(_MeshProvisioningStatusData) then) = - __$MeshProvisioningStatusDataCopyWithImpl<$Res>; +abstract class _$$_MeshProvisioningStatusDataCopyWith<$Res> implements $MeshProvisioningStatusDataCopyWith<$Res> { + factory _$$_MeshProvisioningStatusDataCopyWith( + _$_MeshProvisioningStatusData value, $Res Function(_$_MeshProvisioningStatusData) then) = + __$$_MeshProvisioningStatusDataCopyWithImpl<$Res>; @override $Res call({String state, List data, UnprovisionedMeshNodeData? meshNode}); @@ -414,14 +373,14 @@ abstract class _$MeshProvisioningStatusDataCopyWith<$Res> implements $MeshProvis } /// @nodoc -class __$MeshProvisioningStatusDataCopyWithImpl<$Res> extends _$MeshProvisioningStatusDataCopyWithImpl<$Res> - implements _$MeshProvisioningStatusDataCopyWith<$Res> { - __$MeshProvisioningStatusDataCopyWithImpl( - _MeshProvisioningStatusData _value, $Res Function(_MeshProvisioningStatusData) _then) - : super(_value, (v) => _then(v as _MeshProvisioningStatusData)); +class __$$_MeshProvisioningStatusDataCopyWithImpl<$Res> extends _$MeshProvisioningStatusDataCopyWithImpl<$Res> + implements _$$_MeshProvisioningStatusDataCopyWith<$Res> { + __$$_MeshProvisioningStatusDataCopyWithImpl( + _$_MeshProvisioningStatusData _value, $Res Function(_$_MeshProvisioningStatusData) _then) + : super(_value, (v) => _then(v as _$_MeshProvisioningStatusData)); @override - _MeshProvisioningStatusData get _value => super._value as _MeshProvisioningStatusData; + _$_MeshProvisioningStatusData get _value => super._value as _$_MeshProvisioningStatusData; @override $Res call({ @@ -429,13 +388,13 @@ class __$MeshProvisioningStatusDataCopyWithImpl<$Res> extends _$MeshProvisioning Object? data = freezed, Object? meshNode = freezed, }) { - return _then(_MeshProvisioningStatusData( + return _then(_$_MeshProvisioningStatusData( state == freezed ? _value.state : state // ignore: cast_nullable_to_non_nullable as String, data == freezed - ? _value.data + ? _value._data : data // ignore: cast_nullable_to_non_nullable as List, meshNode == freezed @@ -450,15 +409,20 @@ class __$MeshProvisioningStatusDataCopyWithImpl<$Res> extends _$MeshProvisioning @JsonSerializable(explicitToJson: true, anyMap: true) class _$_MeshProvisioningStatusData implements _MeshProvisioningStatusData { - const _$_MeshProvisioningStatusData(this.state, this.data, this.meshNode); + const _$_MeshProvisioningStatusData(this.state, final List data, this.meshNode) : _data = data; factory _$_MeshProvisioningStatusData.fromJson(Map json) => - _$_$_MeshProvisioningStatusDataFromJson(json); + _$$_MeshProvisioningStatusDataFromJson(json); @override final String state; + final List _data; @override - final List data; + List get data { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_data); + } + @override final UnprovisionedMeshNodeData? meshNode; @@ -470,71 +434,54 @@ class _$_MeshProvisioningStatusData implements _MeshProvisioningStatusData { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _MeshProvisioningStatusData && - (identical(other.state, state) || const DeepCollectionEquality().equals(other.state, state)) && - (identical(other.data, data) || const DeepCollectionEquality().equals(other.data, data)) && - (identical(other.meshNode, meshNode) || const DeepCollectionEquality().equals(other.meshNode, meshNode))); + (other.runtimeType == runtimeType && + other is _$_MeshProvisioningStatusData && + const DeepCollectionEquality().equals(other.state, state) && + const DeepCollectionEquality().equals(other._data, _data) && + const DeepCollectionEquality().equals(other.meshNode, meshNode)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(state) ^ - const DeepCollectionEquality().hash(data) ^ - const DeepCollectionEquality().hash(meshNode); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(state), + const DeepCollectionEquality().hash(_data), const DeepCollectionEquality().hash(meshNode)); @JsonKey(ignore: true) @override - _$MeshProvisioningStatusDataCopyWith<_MeshProvisioningStatusData> get copyWith => - __$MeshProvisioningStatusDataCopyWithImpl<_MeshProvisioningStatusData>(this, _$identity); + _$$_MeshProvisioningStatusDataCopyWith<_$_MeshProvisioningStatusData> get copyWith => + __$$_MeshProvisioningStatusDataCopyWithImpl<_$_MeshProvisioningStatusData>(this, _$identity); @override Map toJson() { - return _$_$_MeshProvisioningStatusDataToJson(this); + return _$$_MeshProvisioningStatusDataToJson( + this, + ); } } abstract class _MeshProvisioningStatusData implements MeshProvisioningStatusData { - const factory _MeshProvisioningStatusData(String state, List data, UnprovisionedMeshNodeData? meshNode) = + const factory _MeshProvisioningStatusData( + final String state, final List data, final UnprovisionedMeshNodeData? meshNode) = _$_MeshProvisioningStatusData; factory _MeshProvisioningStatusData.fromJson(Map json) = _$_MeshProvisioningStatusData.fromJson; @override - String get state => throw _privateConstructorUsedError; + String get state; @override - List get data => throw _privateConstructorUsedError; + List get data; @override - UnprovisionedMeshNodeData? get meshNode => throw _privateConstructorUsedError; + UnprovisionedMeshNodeData? get meshNode; @override @JsonKey(ignore: true) - _$MeshProvisioningStatusDataCopyWith<_MeshProvisioningStatusData> get copyWith => throw _privateConstructorUsedError; + _$$_MeshProvisioningStatusDataCopyWith<_$_MeshProvisioningStatusData> get copyWith => + throw _privateConstructorUsedError; } MeshProvisioningCompletedData _$MeshProvisioningCompletedDataFromJson(Map json) { return _MeshProvisioningCompletedData.fromJson(json); } -/// @nodoc -class _$MeshProvisioningCompletedDataTearOff { - const _$MeshProvisioningCompletedDataTearOff(); - - _MeshProvisioningCompletedData call(String state, List data, ProvisionedMeshNodeData? meshNode) { - return _MeshProvisioningCompletedData( - state, - data, - meshNode, - ); - } - - MeshProvisioningCompletedData fromJson(Map json) { - return MeshProvisioningCompletedData.fromJson(json); - } -} - -/// @nodoc -const $MeshProvisioningCompletedData = _$MeshProvisioningCompletedDataTearOff(); - /// @nodoc mixin _$MeshProvisioningCompletedData { String get state => throw _privateConstructorUsedError; @@ -600,10 +547,10 @@ class _$MeshProvisioningCompletedDataCopyWithImpl<$Res> implements $MeshProvisio } /// @nodoc -abstract class _$MeshProvisioningCompletedDataCopyWith<$Res> implements $MeshProvisioningCompletedDataCopyWith<$Res> { - factory _$MeshProvisioningCompletedDataCopyWith( - _MeshProvisioningCompletedData value, $Res Function(_MeshProvisioningCompletedData) then) = - __$MeshProvisioningCompletedDataCopyWithImpl<$Res>; +abstract class _$$_MeshProvisioningCompletedDataCopyWith<$Res> implements $MeshProvisioningCompletedDataCopyWith<$Res> { + factory _$$_MeshProvisioningCompletedDataCopyWith( + _$_MeshProvisioningCompletedData value, $Res Function(_$_MeshProvisioningCompletedData) then) = + __$$_MeshProvisioningCompletedDataCopyWithImpl<$Res>; @override $Res call({String state, List data, ProvisionedMeshNodeData? meshNode}); @@ -612,14 +559,14 @@ abstract class _$MeshProvisioningCompletedDataCopyWith<$Res> implements $MeshPro } /// @nodoc -class __$MeshProvisioningCompletedDataCopyWithImpl<$Res> extends _$MeshProvisioningCompletedDataCopyWithImpl<$Res> - implements _$MeshProvisioningCompletedDataCopyWith<$Res> { - __$MeshProvisioningCompletedDataCopyWithImpl( - _MeshProvisioningCompletedData _value, $Res Function(_MeshProvisioningCompletedData) _then) - : super(_value, (v) => _then(v as _MeshProvisioningCompletedData)); +class __$$_MeshProvisioningCompletedDataCopyWithImpl<$Res> extends _$MeshProvisioningCompletedDataCopyWithImpl<$Res> + implements _$$_MeshProvisioningCompletedDataCopyWith<$Res> { + __$$_MeshProvisioningCompletedDataCopyWithImpl( + _$_MeshProvisioningCompletedData _value, $Res Function(_$_MeshProvisioningCompletedData) _then) + : super(_value, (v) => _then(v as _$_MeshProvisioningCompletedData)); @override - _MeshProvisioningCompletedData get _value => super._value as _MeshProvisioningCompletedData; + _$_MeshProvisioningCompletedData get _value => super._value as _$_MeshProvisioningCompletedData; @override $Res call({ @@ -627,13 +574,13 @@ class __$MeshProvisioningCompletedDataCopyWithImpl<$Res> extends _$MeshProvision Object? data = freezed, Object? meshNode = freezed, }) { - return _then(_MeshProvisioningCompletedData( + return _then(_$_MeshProvisioningCompletedData( state == freezed ? _value.state : state // ignore: cast_nullable_to_non_nullable as String, data == freezed - ? _value.data + ? _value._data : data // ignore: cast_nullable_to_non_nullable as List, meshNode == freezed @@ -648,15 +595,20 @@ class __$MeshProvisioningCompletedDataCopyWithImpl<$Res> extends _$MeshProvision @JsonSerializable(explicitToJson: true, anyMap: true) class _$_MeshProvisioningCompletedData implements _MeshProvisioningCompletedData { - const _$_MeshProvisioningCompletedData(this.state, this.data, this.meshNode); + const _$_MeshProvisioningCompletedData(this.state, final List data, this.meshNode) : _data = data; factory _$_MeshProvisioningCompletedData.fromJson(Map json) => - _$_$_MeshProvisioningCompletedDataFromJson(json); + _$$_MeshProvisioningCompletedDataFromJson(json); @override final String state; + final List _data; @override - final List data; + List get data { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_data); + } + @override final ProvisionedMeshNodeData? meshNode; @@ -668,45 +620,47 @@ class _$_MeshProvisioningCompletedData implements _MeshProvisioningCompletedData @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _MeshProvisioningCompletedData && - (identical(other.state, state) || const DeepCollectionEquality().equals(other.state, state)) && - (identical(other.data, data) || const DeepCollectionEquality().equals(other.data, data)) && - (identical(other.meshNode, meshNode) || const DeepCollectionEquality().equals(other.meshNode, meshNode))); + (other.runtimeType == runtimeType && + other is _$_MeshProvisioningCompletedData && + const DeepCollectionEquality().equals(other.state, state) && + const DeepCollectionEquality().equals(other._data, _data) && + const DeepCollectionEquality().equals(other.meshNode, meshNode)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ - const DeepCollectionEquality().hash(state) ^ - const DeepCollectionEquality().hash(data) ^ - const DeepCollectionEquality().hash(meshNode); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(state), + const DeepCollectionEquality().hash(_data), const DeepCollectionEquality().hash(meshNode)); @JsonKey(ignore: true) @override - _$MeshProvisioningCompletedDataCopyWith<_MeshProvisioningCompletedData> get copyWith => - __$MeshProvisioningCompletedDataCopyWithImpl<_MeshProvisioningCompletedData>(this, _$identity); + _$$_MeshProvisioningCompletedDataCopyWith<_$_MeshProvisioningCompletedData> get copyWith => + __$$_MeshProvisioningCompletedDataCopyWithImpl<_$_MeshProvisioningCompletedData>(this, _$identity); @override Map toJson() { - return _$_$_MeshProvisioningCompletedDataToJson(this); + return _$$_MeshProvisioningCompletedDataToJson( + this, + ); } } abstract class _MeshProvisioningCompletedData implements MeshProvisioningCompletedData { - const factory _MeshProvisioningCompletedData(String state, List data, ProvisionedMeshNodeData? meshNode) = + const factory _MeshProvisioningCompletedData( + final String state, final List data, final ProvisionedMeshNodeData? meshNode) = _$_MeshProvisioningCompletedData; factory _MeshProvisioningCompletedData.fromJson(Map json) = _$_MeshProvisioningCompletedData.fromJson; @override - String get state => throw _privateConstructorUsedError; + String get state; @override - List get data => throw _privateConstructorUsedError; + List get data; @override - ProvisionedMeshNodeData? get meshNode => throw _privateConstructorUsedError; + ProvisionedMeshNodeData? get meshNode; @override @JsonKey(ignore: true) - _$MeshProvisioningCompletedDataCopyWith<_MeshProvisioningCompletedData> get copyWith => + _$$_MeshProvisioningCompletedDataCopyWith<_$_MeshProvisioningCompletedData> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.g.dart b/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.g.dart index ea85112fd..a68042e32 100644 --- a/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.g.dart +++ b/lib/src/events/data/mesh_provisioning_status/mesh_provisioning_status.g.dart @@ -6,51 +6,46 @@ part of 'mesh_provisioning_status.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_UnprovisionedMeshNodeData _$_$_UnprovisionedMeshNodeDataFromJson(Map json) { - return _$_UnprovisionedMeshNodeData( - json['uuid'] as String, - provisionerPublicKeyXY: (json['provisionerPublicKeyXY'] as List?)?.map((e) => e as int).toList() ?? [], - ); -} - -Map _$_$_UnprovisionedMeshNodeDataToJson(_$_UnprovisionedMeshNodeData instance) => { +_$_UnprovisionedMeshNodeData _$$_UnprovisionedMeshNodeDataFromJson(Map json) => + _$_UnprovisionedMeshNodeData( + json['uuid'] as String, + provisionerPublicKeyXY: + (json['provisionerPublicKeyXY'] as List?)?.map((e) => e as int).toList() ?? const [], + ); + +Map _$$_UnprovisionedMeshNodeDataToJson(_$_UnprovisionedMeshNodeData instance) => { 'uuid': instance.uuid, 'provisionerPublicKeyXY': instance.provisionerPublicKeyXY, }; -_$_ProvisionedMeshNodeData _$_$_ProvisionedMeshNodeDataFromJson(Map json) { - return _$_ProvisionedMeshNodeData( - json['uuid'] as String, - ); -} +_$_ProvisionedMeshNodeData _$$_ProvisionedMeshNodeDataFromJson(Map json) => _$_ProvisionedMeshNodeData( + json['uuid'] as String, + ); -Map _$_$_ProvisionedMeshNodeDataToJson(_$_ProvisionedMeshNodeData instance) => { +Map _$$_ProvisionedMeshNodeDataToJson(_$_ProvisionedMeshNodeData instance) => { 'uuid': instance.uuid, }; -_$_MeshProvisioningStatusData _$_$_MeshProvisioningStatusDataFromJson(Map json) { - return _$_MeshProvisioningStatusData( - json['state'] as String, - (json['data'] as List).map((e) => e as int).toList(), - json['meshNode'] == null ? null : UnprovisionedMeshNodeData.fromJson(json['meshNode'] as Map), - ); -} +_$_MeshProvisioningStatusData _$$_MeshProvisioningStatusDataFromJson(Map json) => _$_MeshProvisioningStatusData( + json['state'] as String, + (json['data'] as List).map((e) => e as int).toList(), + json['meshNode'] == null ? null : UnprovisionedMeshNodeData.fromJson(json['meshNode'] as Map), + ); -Map _$_$_MeshProvisioningStatusDataToJson(_$_MeshProvisioningStatusData instance) => { +Map _$$_MeshProvisioningStatusDataToJson(_$_MeshProvisioningStatusData instance) => { 'state': instance.state, 'data': instance.data, 'meshNode': instance.meshNode?.toJson(), }; -_$_MeshProvisioningCompletedData _$_$_MeshProvisioningCompletedDataFromJson(Map json) { - return _$_MeshProvisioningCompletedData( - json['state'] as String, - (json['data'] as List).map((e) => e as int).toList(), - json['meshNode'] == null ? null : ProvisionedMeshNodeData.fromJson(json['meshNode'] as Map), - ); -} +_$_MeshProvisioningCompletedData _$$_MeshProvisioningCompletedDataFromJson(Map json) => + _$_MeshProvisioningCompletedData( + json['state'] as String, + (json['data'] as List).map((e) => e as int).toList(), + json['meshNode'] == null ? null : ProvisionedMeshNodeData.fromJson(json['meshNode'] as Map), + ); -Map _$_$_MeshProvisioningCompletedDataToJson(_$_MeshProvisioningCompletedData instance) => +Map _$$_MeshProvisioningCompletedDataToJson(_$_MeshProvisioningCompletedData instance) => { 'state': instance.state, 'data': instance.data, diff --git a/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.freezed.dart b/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.freezed.dart index 3fe86ed8f..8a048a9c8 100644 --- a/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.freezed.dart +++ b/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.freezed.dart @@ -1,5 +1,7 @@ +// coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target part of 'send_provisioning_pdu.dart'; @@ -10,31 +12,12 @@ part of 'send_provisioning_pdu.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); SendProvisioningPduData _$SendProvisioningPduDataFromJson(Map json) { return _SendProvisioningPduData.fromJson(json); } -/// @nodoc -class _$SendProvisioningPduDataTearOff { - const _$SendProvisioningPduDataTearOff(); - - _SendProvisioningPduData call(List pdu, UnprovisionedMeshNode meshNode) { - return _SendProvisioningPduData( - pdu, - meshNode, - ); - } - - SendProvisioningPduData fromJson(Map json) { - return SendProvisioningPduData.fromJson(json); - } -} - -/// @nodoc -const $SendProvisioningPduData = _$SendProvisioningPduDataTearOff(); - /// @nodoc mixin _$SendProvisioningPduData { List get pdu => throw _privateConstructorUsedError; @@ -79,31 +62,32 @@ class _$SendProvisioningPduDataCopyWithImpl<$Res> implements $SendProvisioningPd } /// @nodoc -abstract class _$SendProvisioningPduDataCopyWith<$Res> implements $SendProvisioningPduDataCopyWith<$Res> { - factory _$SendProvisioningPduDataCopyWith( - _SendProvisioningPduData value, $Res Function(_SendProvisioningPduData) then) = - __$SendProvisioningPduDataCopyWithImpl<$Res>; +abstract class _$$_SendProvisioningPduDataCopyWith<$Res> implements $SendProvisioningPduDataCopyWith<$Res> { + factory _$$_SendProvisioningPduDataCopyWith( + _$_SendProvisioningPduData value, $Res Function(_$_SendProvisioningPduData) then) = + __$$_SendProvisioningPduDataCopyWithImpl<$Res>; @override $Res call({List pdu, UnprovisionedMeshNode meshNode}); } /// @nodoc -class __$SendProvisioningPduDataCopyWithImpl<$Res> extends _$SendProvisioningPduDataCopyWithImpl<$Res> - implements _$SendProvisioningPduDataCopyWith<$Res> { - __$SendProvisioningPduDataCopyWithImpl(_SendProvisioningPduData _value, $Res Function(_SendProvisioningPduData) _then) - : super(_value, (v) => _then(v as _SendProvisioningPduData)); +class __$$_SendProvisioningPduDataCopyWithImpl<$Res> extends _$SendProvisioningPduDataCopyWithImpl<$Res> + implements _$$_SendProvisioningPduDataCopyWith<$Res> { + __$$_SendProvisioningPduDataCopyWithImpl( + _$_SendProvisioningPduData _value, $Res Function(_$_SendProvisioningPduData) _then) + : super(_value, (v) => _then(v as _$_SendProvisioningPduData)); @override - _SendProvisioningPduData get _value => super._value as _SendProvisioningPduData; + _$_SendProvisioningPduData get _value => super._value as _$_SendProvisioningPduData; @override $Res call({ Object? pdu = freezed, Object? meshNode = freezed, }) { - return _then(_SendProvisioningPduData( + return _then(_$_SendProvisioningPduData( pdu == freezed - ? _value.pdu + ? _value._pdu : pdu // ignore: cast_nullable_to_non_nullable as List, meshNode == freezed @@ -118,12 +102,17 @@ class __$SendProvisioningPduDataCopyWithImpl<$Res> extends _$SendProvisioningPdu @JsonSerializable(explicitToJson: true, anyMap: true) class _$_SendProvisioningPduData implements _SendProvisioningPduData { - const _$_SendProvisioningPduData(this.pdu, this.meshNode); + const _$_SendProvisioningPduData(final List pdu, this.meshNode) : _pdu = pdu; - factory _$_SendProvisioningPduData.fromJson(Map json) => _$_$_SendProvisioningPduDataFromJson(json); + factory _$_SendProvisioningPduData.fromJson(Map json) => _$$_SendProvisioningPduDataFromJson(json); + final List _pdu; @override - final List pdu; + List get pdu { + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_pdu); + } + @override final UnprovisionedMeshNode meshNode; @@ -135,36 +124,41 @@ class _$_SendProvisioningPduData implements _SendProvisioningPduData { @override bool operator ==(dynamic other) { return identical(this, other) || - (other is _SendProvisioningPduData && - (identical(other.pdu, pdu) || const DeepCollectionEquality().equals(other.pdu, pdu)) && - (identical(other.meshNode, meshNode) || const DeepCollectionEquality().equals(other.meshNode, meshNode))); + (other.runtimeType == runtimeType && + other is _$_SendProvisioningPduData && + const DeepCollectionEquality().equals(other._pdu, _pdu) && + const DeepCollectionEquality().equals(other.meshNode, meshNode)); } + @JsonKey(ignore: true) @override - int get hashCode => - runtimeType.hashCode ^ const DeepCollectionEquality().hash(pdu) ^ const DeepCollectionEquality().hash(meshNode); + int get hashCode => Object.hash( + runtimeType, const DeepCollectionEquality().hash(_pdu), const DeepCollectionEquality().hash(meshNode)); @JsonKey(ignore: true) @override - _$SendProvisioningPduDataCopyWith<_SendProvisioningPduData> get copyWith => - __$SendProvisioningPduDataCopyWithImpl<_SendProvisioningPduData>(this, _$identity); + _$$_SendProvisioningPduDataCopyWith<_$_SendProvisioningPduData> get copyWith => + __$$_SendProvisioningPduDataCopyWithImpl<_$_SendProvisioningPduData>(this, _$identity); @override Map toJson() { - return _$_$_SendProvisioningPduDataToJson(this); + return _$$_SendProvisioningPduDataToJson( + this, + ); } } abstract class _SendProvisioningPduData implements SendProvisioningPduData { - const factory _SendProvisioningPduData(List pdu, UnprovisionedMeshNode meshNode) = _$_SendProvisioningPduData; + const factory _SendProvisioningPduData(final List pdu, final UnprovisionedMeshNode meshNode) = + _$_SendProvisioningPduData; factory _SendProvisioningPduData.fromJson(Map json) = _$_SendProvisioningPduData.fromJson; @override - List get pdu => throw _privateConstructorUsedError; + List get pdu; @override - UnprovisionedMeshNode get meshNode => throw _privateConstructorUsedError; + UnprovisionedMeshNode get meshNode; @override @JsonKey(ignore: true) - _$SendProvisioningPduDataCopyWith<_SendProvisioningPduData> get copyWith => throw _privateConstructorUsedError; + _$$_SendProvisioningPduDataCopyWith<_$_SendProvisioningPduData> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.g.dart b/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.g.dart index 6a44b2525..f47edb211 100644 --- a/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.g.dart +++ b/lib/src/events/data/send_provisioning_pdu/send_provisioning_pdu.g.dart @@ -6,14 +6,12 @@ part of 'send_provisioning_pdu.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_SendProvisioningPduData _$_$_SendProvisioningPduDataFromJson(Map json) { - return _$_SendProvisioningPduData( - (json['pdu'] as List).map((e) => e as int).toList(), - UnprovisionedMeshNode.fromJson(json['meshNode'] as Map), - ); -} +_$_SendProvisioningPduData _$$_SendProvisioningPduDataFromJson(Map json) => _$_SendProvisioningPduData( + (json['pdu'] as List).map((e) => e as int).toList(), + UnprovisionedMeshNode.fromJson(json['meshNode'] as Map), + ); -Map _$_$_SendProvisioningPduDataToJson(_$_SendProvisioningPduData instance) => { +Map _$$_SendProvisioningPduDataToJson(_$_SendProvisioningPduData instance) => { 'pdu': instance.pdu, 'meshNode': instance.meshNode.toJson(), }; diff --git a/lib/src/mesh_network.dart b/lib/src/mesh_network.dart index 262fd03e3..ddd628cd0 100644 --- a/lib/src/mesh_network.dart +++ b/lib/src/mesh_network.dart @@ -114,8 +114,8 @@ class MeshNetwork implements IMeshNetwork { @override Future> get groups async { - final _groups = await _methodChannel.invokeMethod('groups'); - return _groups!.cast().map((e) => GroupData.fromJson(e.cast())).toList(); + final groups = await _methodChannel.invokeMethod('groups'); + return groups!.cast().map((e) => GroupData.fromJson(e.cast())).toList(); } @override @@ -124,8 +124,8 @@ class MeshNetwork implements IMeshNetwork { @override Future> elementsForGroup(int groupAddress) async { - final _elements = await _methodChannel.invokeMethod('getElementsForGroup', {'groupAddress': groupAddress}); - return _elements!.cast().map((e) => ElementData.fromJson(e.cast())).toList(); + final elements = await _methodChannel.invokeMethod('getElementsForGroup', {'groupAddress': groupAddress}); + return elements!.cast().map((e) => ElementData.fromJson(e.cast())).toList(); } @override @@ -136,8 +136,8 @@ class MeshNetwork implements IMeshNetwork { @override Future> get nodes async { - final _nodes = await _methodChannel.invokeMethod>('nodes'); - return _nodes!.map((e) => ProvisionedMeshNode(e['uuid'])).toList(); + final nodes = await _methodChannel.invokeMethod>('nodes'); + return nodes!.map((e) => ProvisionedMeshNode(e['uuid'])).toList(); } @override @@ -275,9 +275,9 @@ class MeshNetwork implements IMeshNetwork { @override Future getNode(int address) async { if (Platform.isIOS || Platform.isAndroid) { - final _node = await _methodChannel.invokeMethod('getNode', {'address': address}); - if (_node != null) { - return ProvisionedMeshNode(_node); + final node = await _methodChannel.invokeMethod('getNode', {'address': address}); + if (node != null) { + return ProvisionedMeshNode(node); } else { debugPrint('node not found'); return null; @@ -290,9 +290,9 @@ class MeshNetwork implements IMeshNetwork { @override Future getNodeUsingUUID(String uuid) async { if (Platform.isIOS || Platform.isAndroid) { - final _node = await _methodChannel.invokeMethod('getNodeUsingUUID', {'uuid': uuid}); - if (_node != null) { - return ProvisionedMeshNode(_node); + final node = await _methodChannel.invokeMethod('getNodeUsingUUID', {'uuid': uuid}); + if (node != null) { + return ProvisionedMeshNode(node); } else { debugPrint('node not found'); return null; diff --git a/lib/src/models/mesh_node/provisioned_mesh_node.dart b/lib/src/models/mesh_node/provisioned_mesh_node.dart index ad9d2244d..ea707b993 100644 --- a/lib/src/models/mesh_node/provisioned_mesh_node.dart +++ b/lib/src/models/mesh_node/provisioned_mesh_node.dart @@ -76,7 +76,7 @@ class ProvisionedMeshNode { /// Will return the list of elements of this node as stored in the local database Future> get elements async { - final _elements = await _methodChannel.invokeMethod('elements'); - return _elements!.map((e) => ElementData.fromJson(e)).toList(); + final elements = await _methodChannel.invokeMethod('elements'); + return elements!.map((e) => ElementData.fromJson(e)).toList(); } } diff --git a/lib/src/utils/provisioning.dart b/lib/src/utils/provisioning.dart index 1f6f8f7aa..b7681999a 100644 --- a/lib/src/utils/provisioning.dart +++ b/lib/src/utils/provisioning.dart @@ -138,14 +138,14 @@ Future _provisioning( isHandlingConnectErrors = false; provisionedMeshNode = ProvisionedMeshNode(event.meshNode!.uuid); } catch (e) { - const _msg = 'Error in connection during provisioning process'; - _log('$_msg $e'); - completer.completeError(NrfMeshProvisioningException(ProvisioningFailureCode.reconnection, _msg)); + const msg = 'Error in connection during provisioning process'; + _log('$msg $e'); + completer.completeError(NrfMeshProvisioningException(ProvisioningFailureCode.reconnection, msg)); } } catch (e) { - const _msg = 'unexpected error during provisioning completed listener'; - _log('$_msg $e'); - completer.completeError(NrfMeshProvisioningException(ProvisioningFailureCode.provisioningCompleted, _msg)); + const msg = 'unexpected error during provisioning completed listener'; + _log('$msg $e'); + completer.completeError(NrfMeshProvisioningException(ProvisioningFailureCode.provisioningCompleted, msg)); } }); // If provisioning failed, stop process and notify caller by throwing an error diff --git a/pubspec.lock b/pubspec.lock index bf225d71e..3e8655603 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "38.0.0" + version: "49.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "3.4.1" + version: "5.1.0" args: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -42,35 +42,35 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.3.1" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" build_daemon: dependency: transitive description: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.10" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.8" + version: "2.3.0" build_runner_core: dependency: transitive description: @@ -98,7 +98,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -119,21 +119,21 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" convert: dependency: transitive description: @@ -154,14 +154,14 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "2.2.4" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" file: dependency: transitive description: @@ -182,19 +182,19 @@ packages: source: sdk version: "0.0.0" flutter_lints: - dependency: "direct main" + dependency: "direct dev" description: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_reactive_ble: dependency: "direct main" description: name: flutter_reactive_ble url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -206,14 +206,14 @@ packages: name: freezed url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.1.1" freezed_annotation: dependency: "direct main" description: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.1.0" frontend_server_client: dependency: transitive description: @@ -276,21 +276,21 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.7.0" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "6.1.5" + version: "6.5.1" lints: dependency: transitive description: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" logging: dependency: transitive description: @@ -304,21 +304,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.5" meta: dependency: "direct main" description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -339,7 +339,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" pedantic: dependency: transitive description: @@ -388,14 +388,14 @@ packages: name: reactive_ble_mobile url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" reactive_ble_platform_interface: dependency: transitive description: name: reactive_ble_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "5.0.2" retry: dependency: "direct main" description: @@ -409,7 +409,7 @@ packages: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.27.3" + version: "0.27.5" shelf: dependency: transitive description: @@ -435,21 +435,21 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.6" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.3" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -477,21 +477,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.12" timing: dependency: transitive description: @@ -512,7 +512,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" watcher: dependency: transitive description: @@ -535,5 +535,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index d8ac6c122..849648298 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,34 +1,34 @@ name: nordic_nrf_mesh description: A Flutter plugin to enable mesh network management and communication using Nordic Semiconductor's SDKs. -version: 0.12.0 +version: 0.13.0 homepage: https://www.dooz-domotique.com/ repository: https://github.com/OZEO-DOOZ/nrf_mesh_plugin issue_tracker: https://github.com/OZEO-DOOZ/nrf_mesh_plugin/issues environment: - sdk: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + sdk: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" dependencies: flutter: sdk: flutter # BLE handling - flutter_reactive_ble: ^4.0.1 - rxdart: ^0.27.3 + flutter_reactive_ble: ^5.0.2 + rxdart: ^0.27.5 retry: ^3.1.0 # Models - json_annotation: ^4.4.0 - freezed_annotation: ^1.1.0 + json_annotation: ^4.7.0 + freezed_annotation: ^2.1.0 # static analysis - flutter_lints: ^1.0.4 - meta: ^1.7.0 + meta: ^1.8.0 dev_dependencies: flutter_test: sdk: flutter - build_runner: ^2.1.8 - json_serializable: ^6.1.5 - freezed: ^1.1.1 + build_runner: ^2.3.0 + json_serializable: ^6.5.1 + freezed: ^2.1.1 + flutter_lints: ^2.0.1 flutter: plugin: