From 2fbf6fde43a601568e163521d7f949fb24f45da1 Mon Sep 17 00:00:00 2001 From: diana9905454 Date: Thu, 27 Aug 2026 13:56:18 +0800 Subject: [PATCH 1/2] add harmonyos port --- harmonyos-port/README.md | 69 +++++++++ .../UNIVERSAL_BLE_PIGEON_CONTRACT.md | 78 ++++++++++ .../main/ets/entryability/EntryAbility.ets | 39 +++++ .../ohos/entry/src/main/module.json5 | 40 ++++++ .../cpp/universal_ble_ohos_host.cpp | 134 ++++++++++++++++++ .../universal_ble_ohos/ets/BackgroundSync.ets | 51 +++++++ .../ets/UniversalBleOhosPlugin.ets | 25 ++++ .../universal_ble_ohos/ets/XiaomiLogin.ets | 51 +++++++ harmonyos-port/pubspec.ohos.patch | 42 ++++++ harmonyos-port/runbook.md | 58 ++++++++ 10 files changed, 587 insertions(+) create mode 100644 harmonyos-port/README.md create mode 100644 harmonyos-port/UNIVERSAL_BLE_PIGEON_CONTRACT.md create mode 100644 harmonyos-port/ohos/entry/src/main/ets/entryability/EntryAbility.ets create mode 100644 harmonyos-port/ohos/entry/src/main/module.json5 create mode 100644 harmonyos-port/ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp create mode 100644 harmonyos-port/ohos/universal_ble_ohos/ets/BackgroundSync.ets create mode 100644 harmonyos-port/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets create mode 100644 harmonyos-port/ohos/universal_ble_ohos/ets/XiaomiLogin.ets create mode 100644 harmonyos-port/pubspec.ohos.patch create mode 100644 harmonyos-port/runbook.md diff --git a/harmonyos-port/README.md b/harmonyos-port/README.md new file mode 100644 index 00000000..20b593b3 --- /dev/null +++ b/harmonyos-port/README.md @@ -0,0 +1,69 @@ +# OronBox → HarmonyOS (OpenHarmony NEXT) 移植方案 + +> 本文基于 `OronBox` 真实 `pubspec.yaml`(已逐项核对)与 `universal_ble` 的真实 Pigeon 契约撰写。 +> 本目录 `harmonyos-port/` 是移植脚手架,需在装有 DevEco Studio + OHOS SDK + flutter ohos 的机器上收尾。 + +## 一、结论 + +- **UI 与业务逻辑(约 70% 代码)可直接复用**:Flutter-OH(CPF-Flutter)社区适配已成熟。 +- **真正要动刀的只有 4 处平台强相关代码**:BLE 蓝牙、原生 C/C++ 库、后台同步、WebView 登录。 +- 最小可用版(砍掉音频 WASM/原生库、mDNS)约 3~4 周;全功能约 5~8 周。 + +## 二、版本决策(关键) + +- OronBox 用 fvm 锁 **Flutter 3.47.1**,但 `pubspec.yaml` 的 `environment.sdk: ^3.13.0`,约束宽松。 +- 鸿蒙社区适配版 **CPF-Flutter**(`atomgit.com/CPF-Flutter/flutter_flutter`)已发布到 `oh-3.44.9-release`。 +- **选用 `oh-3.44.9-release`**:离 3.47.1 仅差 3 个 minor,降级幅度远小于退回 3.35.7,依赖约束冲突最少。 +- 需把 `OronBox/.fvmrc` 的 3.47.1 改到 3.44.9,并处理少量 Dart/插件 API 差异。 + +## 三、依赖兼容性矩阵(基于真实 pubspec) + +| 依赖 | 版本 | ohos 现状 | 处理 | +|------|------|-----------|------| +| flutter / flutter_localizations | sdk | CPF-Flutter 提供 | 换 ohos flutter | +| go_router | ^17.3.0 | ✅ 纯 Dart | 直接复用 | +| flutter_riverpod | ^3.3.2 | ✅ 纯 Dart | 直接复用 | +| url_launcher | ^6.3.1 | ✅ CPF 已适配 | 换依赖 | +| shared_preferences | ^2.5.5 | ✅ 已适配 | 换依赖 | +| path_provider | ^2.1.6 | ✅ 已适配 | 换依赖 | +| protobuf / fixnum | ^6.0.0 / ^1.1.1 | ✅ 纯 Dart | 直接复用 | +| **universal_ble** | ^2.1.0 | ❌ 无 ohos | **fork 加 Pigeon C++ host(见下)** | +| **flutter_soloud** | ^4.0.12 | ❌ C++ 原生 | 首版砍掉音频,后续 NDK 移植 | +| **wasm_run_flutter** | ^0.1.0 | ❌ WASM runtime | 首版 stub,后续 NDK | +| **quickjs_engine** | ^0.1.5 | ❌ C 原生 | NDK 交叉编译(纯 C+CMake,难度中) | +| **mdns_dart** | ^2.2.2 | ❌ 原生 mDNS | 首版 stub,用 ohos 网络发现替代 | +| **desktop_drop** | ^0.8.0 | ❌ 桌面专用 | 条件导入守卫(仅 desktop 启用) | +| **window_manager** | ^0.5.2 | ❌ 桌面专用 | 条件导入守卫 | +| **tray_manager** | ^0.5.3 | ❌ 桌面专用 | 条件导入守卫 | +| oronbox_network | git zxor-org | ✅ 纯 Dart | 直接复用 | +| dio / file_picker / cross_file 等 | — | ⚠️ 部分需 ohos 适配 | 逐个核对 CPF 列表 | + +## 四、四个攻坚点 + +1. **BLE(最核心)**:app 的 GATT 逻辑全在 `lib/src/core/services/ble_gatt_driver.dart`,只通过 `UniversalBle.*` 调用。 + → **fork `universal_ble` 加 `ohos` 平台**,用 Pigeon 生成 C++ host,在 C++ 里调 `@ohos.bluetooth.ble`。 + → 这样 `ble_gatt_driver.dart` 一行都不用改。真实契约见 `UNIVERSAL_BLE_PIGEON_CONTRACT.md`,C++ 骨架见 `ohos/universal_ble_ohos/cpp/`。 +2. **原生 C/C++ 库**:`flutter_soloud`/`quickjs_engine`/`wasm_run` 需用 OHOS NDK(`--target=aarch64-linux-ohos`)交叉编译,经 NAPI 挂入 ohos 工程。首版建议砍掉音频与 WASM。 +3. **后台定时同步**:鸿蒙后台管控严格,需用 `backgroundTaskManager` 长时任务(BLUETOOTH_INTERACTION)+ 代理提醒,纯轮询会被杀。模板见 `ohos/universal_ble_ohos/ets/BackgroundSync.ets`。 +4. **WebView 登录**:小米 2FA 用 ArkWeb(`webview_flutter` 的 ohos 适配版)。模板见 `ohos/universal_ble_ohos/ets/XiaomiLogin.ets`。 + +## 五、建议执行顺序 + +空壳 ohos 工程 → 换通用插件 → BLE 真机连通一台手环 → 迁移原生库 → 后台任务。每步单独提交,方便回退。 + +## 六、许可证 + +OronBox 为 **AGPL-3.0**:你移植后的版本一旦分发(含网络服务)必须同样开源;对 `universal_ble` 的 fork 同理。 + +## 七、本目录文件清单 + +- `README.md` — 本文件(方案 + 依赖矩阵) +- `UNIVERSAL_BLE_PIGEON_CONTRACT.md` — BLE 平台通道真实契约 +- `runbook.md` — DevEco 内逐步执行手册 +- `pubspec.ohos.patch` — pubspec.yaml 需做的具体修改 +- `ohos/entry/src/main/module.json5` — 权限与能力声明 +- `ohos/entry/src/main/ets/entryability/EntryAbility.ets` — 平台通道注册入口 +- `ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets` — NAPI 加载器 +- `ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp` — Pigeon C++ host 骨架 +- `ohos/universal_ble_ohos/ets/BackgroundSync.ets` — 后台同步模板 +- `ohos/universal_ble_ohos/ets/XiaomiLogin.ets` — 小米登录模板 diff --git a/harmonyos-port/UNIVERSAL_BLE_PIGEON_CONTRACT.md b/harmonyos-port/UNIVERSAL_BLE_PIGEON_CONTRACT.md new file mode 100644 index 00000000..928ae602 --- /dev/null +++ b/harmonyos-port/UNIVERSAL_BLE_PIGEON_CONTRACT.md @@ -0,0 +1,78 @@ +# universal_ble — OpenHarmony 平台通道契约(必须逐条对齐) + +> 来源:`Navideck/universal_ble`(OronBox 使用 `^2.1.0`)。 +> 关键修正:它不是普通 `MethodChannel`,而是用 **Pigeon** 生成跨平台消息层。 +> 通道名 = Pigeon `@HostApi(name: '...')` 的类名;必须用 `StandardMessageCodec`,不能手写 MethodChannel 字符串方法。 + +## 通道(HostApi = 原生端需实现;FlutterApi = Dart 端回调) + +| 类名 | 类型 | 说明 | +|------|------|------| +| `UniversalBlePlatformChannel` | HostApi | 中心设备(Central),app 真正调用 | +| `UniversalBleCallbackChannel` | FlutterApi | 事件回调:扫描结果 / 连接状态 / 特征值变化 | +| `UniversalBlePeripheralChannel` | HostApi | 外设模式(app 不用,可留空实现) | +| `UniversalBleAndroidChannel` | HostApi | 仅 Android | + +## UniversalBlePlatformChannel 方法签名(需在 C++ host 实现) + +```dart +// 返回值/参数已简化,完整以 pigeon 定义文件为准 +Future getBluetoothAvailabilityState(); +Future isBluetoothEnabled(); +Future startScan(ScanFilter filter, bool androidUseFineLocation); +Future stopScan(); +Future connect(String deviceId); +Future disconnect(String deviceId); +Future getConnectionState(String deviceId); +Future> discoverServices(String deviceId); +Future readValue(String deviceId, String characteristicId, [String? descriptorId]); +Future writeValue(String deviceId, String characteristicId, Uint8List value, WriteType writeType); +Future setNotifiable(String deviceId, String characteristicId, BleInputProperty bleInputProperty); +Future requestMtu(String deviceId, int mtu); +Future pair(String deviceId); +Future isPaired(String deviceId); +Future getRssi(String deviceId); +``` + +## UniversalBleCallbackChannel 回调(C++ 端需主动调用,把事件推回 Dart) + +```dart +void onScanResult(ScanResult result); +void onConnectionChanged(String deviceId, ConnectionState connectionState); +void onValueChanged(String deviceId, String characteristicId, Uint8List value); +void onPairingStateChange(String deviceId, bool isPaired, String? error); +void onBluetoothAvailabilityChange(BleAvailabilityState state); +``` + +## 枚举 / 数据模型(节选) + +- `BleAvailabilityState`:unknown / unavailable / turningOn / on / turningOff / off +- `ConnectionState`:unknown / connecting / connected / disconnecting / disconnected +- `WriteType`:withResponse / withoutResponse +- `BleInputProperty`:notification / indication +- `ScanResult`:`deviceId, name, rssi, manufacturerData, serviceData, ...` +- `Service` / `Characteristic`:`uuid, characteristics[], properties...` + +## OpenHarmony 侧实现路径 + +1. **生成 C++ Pigeon 骨架**(在 fork 根目录): + ```bash + flutter pub run pigeon \ + --input pigeon/universal_ble.dart \ + --cpp_header_out ohos/include \ + --cpp_source_out ohos/src + ``` +2. 继承生成的 `UniversalBlePlatformChannel`,在每个方法体里调用 `@ohos.bluetooth.ble` + (`GattClientDevice`:`connect` / `discoverServices` / `readCharacteristicValue` / + `writeCharacteristicValue` / `setCharacteristicChangeNotification` / `setDeviceMtuSize` 等)。 +3. 用 `UniversalBleCallbackChannel` 把扫描/连接/特征值事件推回 Dart。 +4. OronBox 的 `pubspec.yaml` 把 `universal_ble` 指向这个 fork(git 依赖)。 + +## ohos 权限(module.json5 需声明) + +- `ohos.permission.ACCESS_BLUETOOTH` +- `ohos.permission.USE_BLUETOOTH` +- `ohos.permission.LOCATION`(扫描需要) +- `ohos.permission.APPROXIMATELY_LOCATION`(API 12+) + +> 注意:OpenHarmony 的 BLE 后台连接策略、扫描节流、MTU 协商与 Android 有差异,必须真机调试。 diff --git a/harmonyos-port/ohos/entry/src/main/ets/entryability/EntryAbility.ets b/harmonyos-port/ohos/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 00000000..6cf1f06e --- /dev/null +++ b/harmonyos-port/ohos/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,39 @@ +// EntryAbility.ets — 应用入口,注册 universal_ble 的 NAPI 插件 +// 参考实现:实际方法名/参数以你本地 CPF-Flutter 生成的 flutter_ohos 工程为准。 +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { universalBleOhosPlugin } from '../../../universal_ble_ohos/ets/UniversalBleOhosPlugin'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onCreate'); + // 注册 BLE 平台通道(NAPI 加载 C++ Pigeon host) + universalBleOhosPlugin.register(); + } + + onDestroy(): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'OronBox', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + } + }); + } + + onWindowStageDestroy(): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + hilog.info(0x0000, 'OronBox', '%{public}s', 'Ability onBackground'); + } +} diff --git a/harmonyos-port/ohos/entry/src/main/module.json5 b/harmonyos-port/ohos/entry/src/main/module.json5 new file mode 100644 index 00000000..0f679512 --- /dev/null +++ b/harmonyos-port/ohos/entry/src/main/module.json5 @@ -0,0 +1,40 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": ["entity.system.home"], + "actions": ["action.system.home"] + } + ] + } + ], + "requestPermissions": [ + { "name": "ohos.permission.ACCESS_BLUETOOTH", "reason": "$string:perm_ble", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.USE_BLUETOOTH", "reason": "$string:perm_ble", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.LOCATION", "reason": "$string:perm_loc", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.APPROXIMATELY_LOCATION", "reason": "$string:perm_loc", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.INTERNET", "reason": "$string:perm_net", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", "reason": "$string:perm_bg", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } } + ] + } +} diff --git a/harmonyos-port/ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp b/harmonyos-port/ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp new file mode 100644 index 00000000..8a177f36 --- /dev/null +++ b/harmonyos-port/ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp @@ -0,0 +1,134 @@ +// universal_ble_ohos_host.cpp — Pigeon C++ host 骨架 +// +// 正确流程(在 fork 的 universal_ble 根目录执行,生成基础类): +// flutter pub run pigeon \ +// --input pigeon/universal_ble.dart \ +// --cpp_header_out ohos/include \ +// --cpp_source_out ohos/src +// +// 然后继承生成的 UniversalBlePlatformChannel,在每个方法体里调用 +// @ohos.bluetooth.ble(GattClientDevice 等)。下面仅列出方法签名与 TODO, +// 未编译,@ohos.bluetooth.ble 具体函数名请按你的 SDK 版本核对。 +// +// 编译:用 OHOS NDK(--target=aarch64-linux-ohos)通过 CMake 产出 +// libuniversal_ble_ohos.so,供上方 .ets 加载。 + +#include "universal_ble.g.h" // pigeon 生成的头(执行 pigeon 后存在) +#include +#include +#include +#include "napi/native_api.h" + +// 占位:真实实现需 #include 对应 OpenHarmony BLE C API 或走 @ohos.bluetooth.ble 的 NAPI 封装 +namespace universal_ble { + +// 继承 pigeon 生成的 UniversalBlePlatformChannel +class UniversalBleOhosHost : public UniversalBlePlatformChannel { + public: + // ---- 以下每个方法都需实现,调用 @ohos.bluetooth.ble 对应能力 ---- + + // 蓝牙可用状态 + BleAvailabilityState GetBluetoothAvailabilityState() override { + // TODO: 调 bluetooth 状态监听,返回 on/off/turningOn... + return BleAvailabilityState::kOff; + } + + bool IsBluetoothEnabled() override { + // TODO: 返回上一项是否为 on + return false; + } + + void StartScan(const ScanFilter& filter, bool android_use_fine_location) override { + // TODO: ble.startBLEScan(...) 注册扫描回调,结果经 OnScanResult 推回 Dart + (void)filter; (void)android_use_fine_location; + } + + void StopScan() override { + // TODO: ble.stopBLEScan(...) + } + + void Connect(const std::string& device_id) override { + // TODO: GattClientDevice(device_id).connect(...) + } + + void Disconnect(const std::string& device_id) override { + // TODO: device.disconnect() + } + + ConnectionState GetConnectionState(const std::string& device_id) override { + // TODO: 查询并返回连接状态 + (void)device_id; + return ConnectionState::kDisconnected; + } + + std::vector DiscoverServices(const std::string& device_id) override { + // TODO: device.getServices() / getCharacteristics() + (void)device_id; + return {}; + } + + std::vector ReadValue(const std::string& device_id, + const std::string& characteristic_id, + const std::optional& descriptor_id) override { + // TODO: device.readCharacteristicValue(...) + (void)device_id; (void)characteristic_id; (void)descriptor_id; + return {}; + } + + void WriteValue(const std::string& device_id, + const std::string& characteristic_id, + const std::vector& value, + WriteType write_type) override { + // TODO: device.writeCharacteristicValue(..., write_type == withResponse) + (void)device_id; (void)characteristic_id; (void)value; (void)write_type; + } + + void SetNotifiable(const std::string& device_id, + const std::string& characteristic_id, + BleInputProperty property) override { + // TODO: device.setCharacteristicChangeNotification(...) 订阅 notify/indicate + (void)device_id; (void)characteristic_id; (void)property; + } + + int64_t RequestMtu(const std::string& device_id, int64_t mtu) override { + // TODO: device.setDeviceMtuSize(mtu) + (void)device_id; (void)mtu; + return 23; + } + + void Pair(const std::string& device_id) override { + // TODO: device.pair() + (void)device_id; + } + + bool IsPaired(const std::string& device_id) override { + // TODO: 查询配对状态 + (void)device_id; + return false; + } + + int64_t GetRssi(const std::string& device_id) override { + // TODO: device.getRssi() + (void)device_id; + return 0; + } + + // ---- 事件回调:C++ 侧主动调用,把事件推回 Dart ---- + void PushScanResult(const ScanResult& r) { GetCallback()->OnScanResult(r); } + void PushConnectionChanged(const std::string& device_id, ConnectionState s) { + GetCallback()->OnConnectionChanged(device_id, s); + } + void PushValueChanged(const std::string& device_id, const std::string& characteristic_id, + const std::vector& value) { + GetCallback()->OnValueChanged(device_id, characteristic_id, value); + } +}; + +} // namespace universal_ble + +// NAPI 注册入口(供 .ets 的 registerUniversalBleHost 调用) +extern "C" bool registerUniversalBleHost() { + // 把 UniversalBleOhosHost 实例设置给 pigeon 生成的通道 + // UniversalBlePlatformChannel::SetUp(/*binaryMessenger*/, std::make_unique()); + return true; +} diff --git a/harmonyos-port/ohos/universal_ble_ohos/ets/BackgroundSync.ets b/harmonyos-port/ohos/universal_ble_ohos/ets/BackgroundSync.ets new file mode 100644 index 00000000..2187cab1 --- /dev/null +++ b/harmonyos-port/ohos/universal_ble_ohos/ets/BackgroundSync.ets @@ -0,0 +1,51 @@ +// BackgroundSync.ets — 后台定时同步模板 +// 鸿蒙对后台管控严格,纯定时轮询会被系统杀掉。 +// 做法:用 backgroundTaskManager 申请长时任务(BLUETOOTH_INTERACTION)维持 BLE 连接, +// 配合代理提醒(reminderAgent)做周期唤醒。 +import { backgroundTaskManager } from '@kit.BackgroundTasksKit'; +import { reminderAgent } from '@kit.NotificationKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG = 'OronBox:BgSync'; + +// 申请长时任务(需在 module.json5 声明 KEEP_BACKGROUND_RUNNING 权限) +export function startBackgroundSync(): void { + try { + backgroundTaskManager.startRunningTask({ + abilityName: 'EntryAbility', + // 蓝牙交互类长时任务 + // @ts-ignore 具体枚举以 SDK 版本为准 + backgroundTaskType: backgroundTaskManager.BackgroundTaskType.BLUETOOTH_INTERACTION, + } as never); + hilog.info(0x0000, TAG, 'startRunningTask ok'); + } catch (e) { + hilog.error(0x0000, TAG, 'startRunningTask failed: %{public}s', JSON.stringify(e)); + } +} + +export function stopBackgroundSync(): void { + try { + backgroundTaskManager.stopRunningTask('EntryAbility'); + hilog.info(0x0000, TAG, 'stopRunningTask ok'); + } catch (e) { + hilog.error(0x0000, TAG, 'stopRunningTask failed: %{public}s', JSON.stringify(e)); + } +} + +// 注册周期提醒(每 N 分钟唤醒一次做同步) +export function schedulePeriodicSync(minutes: number): void { + try { + const reminder: reminderAgent.ReminderRequestTimer = { + reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, + triggerTimeInSeconds: minutes * 60, + title: 'OronBox 同步', + content: '正在同步可穿戴设备数据', + // slotType / notificationId 等字段按 SDK 文档补齐 + } as reminderAgent.ReminderRequestTimer; + reminderAgent.publishReminder(reminder).then((id) => { + hilog.info(0x0000, TAG, 'publishReminder id=%{public}d', id); + }); + } catch (e) { + hilog.error(0x0000, TAG, 'publishReminder failed: %{public}s', JSON.stringify(e)); + } +} diff --git a/harmonyos-port/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets b/harmonyos-port/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets new file mode 100644 index 00000000..1ec3de82 --- /dev/null +++ b/harmonyos-port/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets @@ -0,0 +1,25 @@ +// UniversalBleOhosPlugin.ets — NAPI 加载器 +// 真正的 BLE 逻辑在 C++ Pigeon host(universal_ble_ohos_host.cpp)里。 +// 这里只负责把 .so 加载进来并触发注册。 +import { hilog } from '@kit.PerformanceAnalysisKit'; +import native from 'libuniversal_ble_ohos.so'; // 由 CMake 产物提供 + +export class UniversalBleOhosPlugin { + private static registered = false; + + static register(): void { + if (UniversalBleOhosPlugin.registered) { + return; + } + try { + // 调用 C++ 侧导出的注册函数(函数名需与 cpp 中 napi_module / 注册宏一致) + const ok = (native as unknown as { registerUniversalBleHost?: () => boolean }).registerUniversalBleHost?.(); + UniversalBleOhosPlugin.registered = ok !== false; + hilog.info(0x0000, 'OronBox', 'UniversalBleOhosPlugin registered=%{public}s', String(UniversalBleOhosPlugin.registered)); + } catch (e) { + hilog.error(0x0000, 'OronBox', 'UniversalBleOhosPlugin register failed: %{public}s', JSON.stringify(e)); + } + } +} + +export const universalBleOhosPlugin = new UniversalBleOhosPlugin(); diff --git a/harmonyos-port/ohos/universal_ble_ohos/ets/XiaomiLogin.ets b/harmonyos-port/ohos/universal_ble_ohos/ets/XiaomiLogin.ets new file mode 100644 index 00000000..6c7438a9 --- /dev/null +++ b/harmonyos-port/ohos/universal_ble_ohos/ets/XiaomiLogin.ets @@ -0,0 +1,51 @@ +// XiaomiLogin.ets — 小米账号 2FA 登录(ArkWeb) +// 小米 OAuth/2FA 需要 WebView。鸿蒙用 ArkWeb 内核(webview_flutter 的 ohos 适配版)。 +// 注意 cookie 持久化行为差异:登录态需自行用 @ohos.web.webview 的 CookieManager 管理。 +import { webview } from '@kit.ArkWeb'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; + +const TAG = 'OronBox:XiaomiLogin'; +const MI_AUTH_URL = 'https://account.xiaomi.com/oauth2/authorize?...'; // 按小米开放平台参数补齐 + +export class XiaomiLogin { + private controller: webview.WebviewController = new webview.WebviewController(); + + aboutToAppear(): void { + // 允许 JavaScript 与文件访问(按安全策略收紧) + webview.WebviewController.setWebDebuggingAccess(true); + } + + build(): void { + // 实际组件请在页面中使用 标签,这里仅给出控制器与回调逻辑 + this.controller.loadUrl(MI_AUTH_URL); + } + + // 监听登录完成后回调 URL,提取 token + onPageFinished(url: string): void { + hilog.info(0x0000, TAG, 'page finished: %{public}s', url); + if (url.includes('oronbox://auth-callback')) { + const token = this.extractToken(url); + hilog.info(0x0000, TAG, 'token captured'); + // TODO: 把 token 通过 MethodChannel / 全局状态交给 Dart 层 + void token; + } + } + + private extractToken(url: string): string { + const m = url.match(/[?&]token=([^&]+)/); + return m ? m[1] : ''; + } + + // 持久化 cookie(ArkWeb 与 flutter webview 的 cookie 可能不同源,需手动桥接) + persistCookies(): void { + try { + const cm = webview.CookieManager.getInstance(); + cm.getCookieSync(MI_AUTH_URL, (cookie: string) => { + hilog.info(0x0000, TAG, 'cookie: %{public}s', cookie); + }); + } catch (e) { + hilog.error(0x0000, TAG, 'getCookie failed: %{public}s', JSON.stringify(e as BusinessError)); + } + } +} diff --git a/harmonyos-port/pubspec.ohos.patch b/harmonyos-port/pubspec.ohos.patch new file mode 100644 index 00000000..9c0fb9c7 --- /dev/null +++ b/harmonyos-port/pubspec.ohos.patch @@ -0,0 +1,42 @@ +# OronBox pubspec.yaml — 鸿蒙适配需做的具体修改 +# 说明:因当前环境 git 不可用,本文件为“手动修改指引”,请在 DevEco 中按此改动 pubspec.yaml。 +# 无法直接 `git apply`(沙箱 git 提交不可持久化)。 + +## 1) 降低 Flutter SDK 下限以匹配 oh-3.44.9-release +# 原文: +# environment: +# sdk: ^3.13.0 +# 若 flutter pub get 报 SDK 冲突,把 ^3.13.0 放宽(通常 3.13 已满足 3.44.9,可不改; +# 若用 fvm,把 .fvmrc 的 3.47.1 改为 3.44.9)。 + +## 2) universal_ble 改为指向你 fork 的 ohos 分支(关键) +# 原文: +# universal_ble: ^2.1.0 +# 改为(替换为你自己的 fork 地址/分支): + universal_ble: + git: + url: https://github.com/diana9905454/universal_ble.git + ref: ohos-pigeon-host +# 说明:该 fork 在 ohos/ 下用 Pigeon 生成了 C++ host(见 UNIVERSAL_BLE_PIGEON_CONTRACT.md)。 + +## 3) 桌面专用插件加条件(ohos 不编译这些) +# desktop_drop / window_manager / tray_manager 仅桌面用,ohos 构建会失败。 +# 做法:在 lib/ 代码中把它们的 import 包进平台守卫,例如: +# // lib/src/desktop/desktop_stub.dart +# // ignore: unused_import +# import 'package:window_manager/window_manager.dart' +# if (dart.library.ffi) 'package:window_manager/window_manager.dart'; +# 或在 pubspec 里临时注释掉这三个依赖,先跑通 ohos,再补桌面守卫。 + +## 4) flutter_soloud / wasm_run_flutter / quickjs_engine / mdns_dart 首版处理 +# 首版建议注释掉以下依赖,用 stub 替代,先跑通主体: +# # flutter_soloud: ^4.0.12 +# # wasm_run_flutter: ^0.1.0 +# # quickjs_engine: ^0.1.5 +# # mdns_dart: ^2.2.2 +# 后续再按需用 OHOS NDK 移植(quickjs 纯 C 较易;soloud 最难)。 + +## 5) 验证 +# flutter pub get +# flutter create --platforms=ohos . # 若已生成可跳过 +# flutter build hap diff --git a/harmonyos-port/runbook.md b/harmonyos-port/runbook.md new file mode 100644 index 00000000..947650f4 --- /dev/null +++ b/harmonyos-port/runbook.md @@ -0,0 +1,58 @@ +# OronBox 鸿蒙移植 — DevEco 执行手册 + +> 前提:本机已装 **DevEco Studio 6.x** + **OHOS SDK(API + Toolchains + Native)** + **CPF-Flutter oh-3.44.9-release**(已 `flutter config --ohos-sdk` 关联)。 +> 估算耗时基于一个熟悉 Flutter + 略懂 ArkTS 的开发者。 + +## 阶段 0:环境(GUI,需你手动) + +1. DevEco → Settings → SDK Manager → 勾 API + Toolchains + Native,Apply 下载完。 +2. 验证:`SDK目录/toolchains/bin/hdc.exe` 存在;`flutter doctor -v` 的 ohos 工具链全绿。 +3. clone flutter ohos:`git clone https://atomgit.com/CPF-Flutter/flutter_flutter.git` → `git checkout oh-3.44.9-release`。 + +## 阶段 1:生成空壳 ohos 工程(约 10 分钟) + +```bash +cd OronBox +flutter create --platforms=ohos . # 生成 ohos/ 标准工程 +flutter pub get +flutter run -d ohos # 先跑通空壳(需真机/模拟器) +``` + +## 阶段 2:降级 Flutter 版本(约 3~5 天,最大体力活) + +- 把 `.fvmrc` 的 3.47.1 改成 3.44.9。 +- 把 `pubspec.yaml` 的 `environment.sdk` 与依赖约束按 `pubspec.ohos.patch` 调整。 +- `flutter pub get` 解决冲突;逐个处理 Dart 3.13→3.7 语法回退(主要是某些包的 API 变动)。 + +## 阶段 3:换通用插件(约 1~2 天) + +- `url_launcher` / `shared_preferences` / `path_provider` / `go_router` 等:CPF-Flutter 组织下已有 ohos 适配版,按 `pubspec.ohos.patch` 替换/锁定版本。 +- 桌面专用插件(`window_manager` / `tray_manager` / `desktop_drop`)加条件导入守卫: + 在 `lib/` 里把它们的 import 包进 `if (dart.library.ffi) ...` 或 platform 判断,ohos 走 stub。 + +## 阶段 4:BLE(核心,约 1~2 周) + +1. fork `Navideck/universal_ble` 到你的账号,加 `ohos` 平台目录。 +2. `flutter pub run pigeon ...`(见 `UNIVERSAL_BLE_PIGEON_CONTRACT.md`)生成 C++ 骨架。 +3. 把 `ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp` 的 TODO 填上:每个方法调 `@ohos.bluetooth.ble`。 +4. 注册 NAPI 模块(`ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets`)。 +5. OronBox `pubspec.yaml` 的 `universal_ble` 改为 git 指向该 fork。 +6. 真机连通一台小米/ZeppOS 手环,验证扫描/连接/GATT 读写/notify。 + +## 阶段 5:后台同步 + 登录(约 3~5 天) + +- 后台:`ohos/universal_ble_ohos/ets/BackgroundSync.ets` 模板 → 长时任务 + 代理提醒。 +- 登录:`ohos/universal_ble_ohos/ets/XiaomiLogin.ets` 模板 → ArkWeb 加载小米 2FA。 + +## 阶段 6:原生库(可选,按需求) + +- 砍掉 `flutter_soloud`(音频)、`wasm_run`/`quickjs_engine`(首版 stub)。 +- 后续:`quickjs_engine` 纯 C+CMake 用 OHOS NDK 交叉编译较易;`flutter_soloud` 无现成适配,工作量最大。 + +## 验收 + +- [ ] `flutter build hap` 成功 +- [ ] 真机安装,BLE 连上一台手环并读写数据 +- [ ] 后台定时同步生效 +- [ ] 小米账号登录可用 +- [ ] 提交到 fork 的 `feat/harmonyos-ohos-port` 分支并开源(AGPL-3.0) From ebea7a803cad91d2675439da064f2eceb96819b5 Mon Sep 17 00:00:00 2001 From: diana9905454 Date: Sun, 30 Aug 2026 03:02:14 +0800 Subject: [PATCH 2/2] feat(ohos): add HarmonyOS port with native bridges and UI adaptation --- .fvmrc | 2 +- .gitignore | 8 + .metadata | 29 +- lib/main.dart | 11 + .../app/generated/app_localizations_en.dart | 1 - .../app/generated/app_localizations_ja.dart | 1 - .../app/generated/app_localizations_ru.dart | 1 - .../app/generated/app_localizations_zh.dart | 1 - lib/src/app/layout/app_navigation_bar.dart | 85 + lib/src/app/oronbox_app.dart | 5 +- lib/src/app/theme/dynamic_color_adapter.dart | 5 +- .../core/extensions/riverpod_mounted_ext.dart | 22 + lib/src/core/models/bt_models.freezed.dart | 3688 +++++++-------- lib/src/core/models/bt_models.g.dart | 122 +- lib/src/core/models/sync_models.freezed.dart | 1830 ++++---- lib/src/core/models/sync_models.g.dart | 68 +- lib/src/core/services/ble_gatt_driver.dart | 29 +- lib/src/core/services/ohos_ble_channel.dart | 299 ++ lib/src/core/services/ohos_file_picker.dart | 179 + .../models/astrobox_models.freezed.dart | 4154 ++++++++--------- .../astrobox/models/astrobox_models.g.dart | 211 +- .../services/bandbbs_auth_service.dart | 1 + .../debug/pages/debug_window_app.dart | 2 +- .../pages/switch/device_switch_page.dart | 23 + .../plugins/pages/plugin_window_app.dart | 2 +- .../creator/creator_workspace_controller.dart | 1 + .../settings/pages/about_software_page.dart | 22 +- .../settings/pages/clean_mode_page.dart | 29 +- .../settings/pages/settings_page.dart | 30 +- .../services/update_check_service.dart | 17 + .../appTestCardList.json | 30 + .../atomicServiceTestCardList.json | 30 + .../defaultCardVersion.txt | 1 + ohos/.gitignore | 20 + ohos/AppScope/app.json5 | 10 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 24515 bytes ohos/build-profile.json5 | 53 + ohos/entry/.gitignore | 7 + ohos/entry/build-profile.json5 | 15 + ohos/entry/hvigorfile.ts | 7 + ohos/entry/oh-package.json5 | 11 + .../src/main/ets/AutoFillManagerStub.d.ts | 50 + .../main/ets/entryability/EntryAbility.ets | 54 + ohos/entry/src/main/ets/pages/Index.ets | 24 + .../src/main/ets/plugins/AppLinksBridge.ets | 91 + .../src/main/ets/plugins/ClassicSppBridge.ets | 260 ++ .../src/main/ets/plugins/FilePickerBridge.ets | 126 + .../src/main/ets/plugins/OhosBleBridge.ets | 439 ++ .../src/main/ets/plugins/StubPlugins.ets | 174 + .../src/main/ets/plugins/UrlLauncherStub.ets | 105 + ohos/entry/src/main/module.json5 | 58 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 32 + .../src/main/resources/base/media/icon.png | Bin 0 -> 24515 bytes .../resources/base/profile/main_pages.json | 5 + .../main/resources/en_US/element/string.json | 16 + .../main/resources/rawfile/buildinfo.json5 | 8 + .../main/resources/zh_CN/element/string.json | 16 + .../src/ohosTest/ets/test/Ability.test.ets | 35 + .../entry/src/ohosTest/ets/test/List.test.ets | 5 + .../ohosTest/ets/testability/TestAbility.ets | 48 + .../ohosTest/ets/testability/pages/Index.ets | 36 + .../ets/testrunner/OpenHarmonyTestRunner.ts | 50 + ohos/entry/src/ohosTest/module.json5 | 37 + .../resources/base/element/color.json | 8 + .../resources/base/element/string.json | 16 + .../ohosTest/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + ohos/hvigor/hvigor-config.json5 | 6 + ohos/hvigorconfig.ts | 4 + ohos/hvigorfile.ts | 8 + ohos/oh-package.json5 | 13 + .../cpp/universal_ble_ohos_host.cpp | 134 + .../universal_ble_ohos/ets/BackgroundSync.ets | 51 + .../ets/UniversalBleOhosPlugin.ets | 25 + ohos/universal_ble_ohos/ets/XiaomiLogin.ets | 51 + pubspec.lock | 674 ++- pubspec.yaml | 42 +- test/widget_test.dart | 30 + 80 files changed, 7986 insertions(+), 5828 deletions(-) create mode 100644 lib/src/core/extensions/riverpod_mounted_ext.dart create mode 100644 lib/src/core/services/ohos_ble_channel.dart create mode 100644 lib/src/core/services/ohos_file_picker.dart create mode 100644 ohos/.appanalyzer/appanalyzerCardConfig/appTestCardList.json create mode 100644 ohos/.appanalyzer/appanalyzerCardConfig/atomicServiceTestCardList.json create mode 100644 ohos/.appanalyzer/appanalyzerCardConfig/defaultCardVersion.txt create mode 100644 ohos/.gitignore create mode 100644 ohos/AppScope/app.json5 create mode 100644 ohos/AppScope/resources/base/element/string.json create mode 100644 ohos/AppScope/resources/base/media/app_icon.png create mode 100644 ohos/build-profile.json5 create mode 100644 ohos/entry/.gitignore create mode 100644 ohos/entry/build-profile.json5 create mode 100644 ohos/entry/hvigorfile.ts create mode 100644 ohos/entry/oh-package.json5 create mode 100644 ohos/entry/src/main/ets/AutoFillManagerStub.d.ts create mode 100644 ohos/entry/src/main/ets/entryability/EntryAbility.ets create mode 100644 ohos/entry/src/main/ets/pages/Index.ets create mode 100644 ohos/entry/src/main/ets/plugins/AppLinksBridge.ets create mode 100644 ohos/entry/src/main/ets/plugins/ClassicSppBridge.ets create mode 100644 ohos/entry/src/main/ets/plugins/FilePickerBridge.ets create mode 100644 ohos/entry/src/main/ets/plugins/OhosBleBridge.ets create mode 100644 ohos/entry/src/main/ets/plugins/StubPlugins.ets create mode 100644 ohos/entry/src/main/ets/plugins/UrlLauncherStub.ets create mode 100644 ohos/entry/src/main/module.json5 create mode 100644 ohos/entry/src/main/resources/base/element/color.json create mode 100644 ohos/entry/src/main/resources/base/element/string.json create mode 100644 ohos/entry/src/main/resources/base/media/icon.png create mode 100644 ohos/entry/src/main/resources/base/profile/main_pages.json create mode 100644 ohos/entry/src/main/resources/en_US/element/string.json create mode 100644 ohos/entry/src/main/resources/rawfile/buildinfo.json5 create mode 100644 ohos/entry/src/main/resources/zh_CN/element/string.json create mode 100644 ohos/entry/src/ohosTest/ets/test/Ability.test.ets create mode 100644 ohos/entry/src/ohosTest/ets/test/List.test.ets create mode 100644 ohos/entry/src/ohosTest/ets/testability/TestAbility.ets create mode 100644 ohos/entry/src/ohosTest/ets/testability/pages/Index.ets create mode 100644 ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts create mode 100644 ohos/entry/src/ohosTest/module.json5 create mode 100644 ohos/entry/src/ohosTest/resources/base/element/color.json create mode 100644 ohos/entry/src/ohosTest/resources/base/element/string.json create mode 100644 ohos/entry/src/ohosTest/resources/base/media/icon.png create mode 100644 ohos/entry/src/ohosTest/resources/base/profile/test_pages.json create mode 100644 ohos/hvigor/hvigor-config.json5 create mode 100644 ohos/hvigorconfig.ts create mode 100644 ohos/hvigorfile.ts create mode 100644 ohos/oh-package.json5 create mode 100644 ohos/universal_ble_ohos/cpp/universal_ble_ohos_host.cpp create mode 100644 ohos/universal_ble_ohos/ets/BackgroundSync.ets create mode 100644 ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets create mode 100644 ohos/universal_ble_ohos/ets/XiaomiLogin.ets create mode 100644 test/widget_test.dart diff --git a/.fvmrc b/.fvmrc index 86d02647..084b2bc5 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { - "flutter": "3.47.1" + "flutter": "3.41.9" } diff --git a/.gitignore b/.gitignore index 9d93d46a..65b62a8d 100644 --- a/.gitignore +++ b/.gitignore @@ -143,3 +143,11 @@ server /.kimi-code/ CONTEXT.md tmp/script.md + +# HarmonyOS port build/debug temp files +HANDOFF.md +hvigor-env-dump.json +lock_result.txt +node-procs.txt +proc_list.txt +ps-test.txt diff --git a/.metadata b/.metadata index 2459a95d..6f8a1e68 100644 --- a/.metadata +++ b/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled and should not be manually edited. version: - revision: "ad70ec4617166f1c38e5d2bfd388af71fda14f06" - channel: "stable" + revision: "2f31a8af0a8418dc593bb65c6dbca9405de74902" + channel: "[user-branch]" project_type: app @@ -13,26 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: android - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: ios - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: linux - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: macos - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: web - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - - platform: windows - create_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 - base_revision: ad70ec4617166f1c38e5d2bfd388af71fda14f06 + create_revision: 2f31a8af0a8418dc593bb65c6dbca9405de74902 + base_revision: 2f31a8af0a8418dc593bb65c6dbca9405de74902 + - platform: ohos + create_revision: 2f31a8af0a8418dc593bb65c6dbca9405de74902 + base_revision: 2f31a8af0a8418dc593bb65c6dbca9405de74902 # User provided section diff --git a/lib/main.dart b/lib/main.dart index 3c19a669..78b29dfb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:oronbox/src/app/oronbox_app.dart'; @@ -13,14 +14,24 @@ import 'package:oronbox/src/core/logging/diagnostic_event.dart'; import 'package:oronbox/src/core/services/license_registry_service.dart'; import 'package:oronbox/src/core/services/bluetooth_permission_bootstrap.dart'; import 'package:oronbox/src/core/services/shared_prefs_service.dart'; +import 'package:oronbox/src/core/services/ohos_ble_channel.dart'; +import 'package:oronbox/src/core/services/ohos_file_picker.dart'; +import 'package:file_picker_platform_interface/file_picker_platform_interface.dart'; import 'package:oronbox/src/host/gui_host_overrides.dart'; import 'package:oronbox/src/features/devices/widgets/device_deep_link_handler.dart'; import 'package:oronbox/src/features/debug/pages/debug_window_app.dart'; import 'package:oronbox/src/features/plugins/pages/plugin_window_app.dart'; +import 'package:universal_ble/universal_ble.dart'; void main(List args) async { final startupStopwatch = Stopwatch()..start(); WidgetsFlutterBinding.ensureInitialized(); + // 鸿蒙端:universal_ble 无原生实现,注入基于 @ohos.bluetooth.ble 的桥接实现。 + if (defaultTargetPlatform == TargetPlatform.ohos) { + UniversalBle.setInstance(OhosUniversalBlePlatform.instance); + // file_picker 同样无鸿蒙实现,注入基于鸿蒙 photoAccessHelper/picker 的桥接。 + FilePickerPlatform.instance = OhosFilePickerPlatform(); + } final window = WindowLaunchSpec.parse(args); final process = switch (window.role) { OronBoxWindowRole.debug => DiagnosticProcess.debugWindow, diff --git a/lib/src/app/generated/app_localizations_en.dart b/lib/src/app/generated/app_localizations_en.dart index 4bdc60f2..c0d54640 100644 --- a/lib/src/app/generated/app_localizations_en.dart +++ b/lib/src/app/generated/app_localizations_en.dart @@ -1,6 +1,5 @@ // ignore: unused_import import 'package:intl/intl.dart' as intl; - import 'app_localizations.dart'; // ignore_for_file: type=lint diff --git a/lib/src/app/generated/app_localizations_ja.dart b/lib/src/app/generated/app_localizations_ja.dart index fc138b91..99fe38a6 100644 --- a/lib/src/app/generated/app_localizations_ja.dart +++ b/lib/src/app/generated/app_localizations_ja.dart @@ -1,6 +1,5 @@ // ignore: unused_import import 'package:intl/intl.dart' as intl; - import 'app_localizations.dart'; // ignore_for_file: type=lint diff --git a/lib/src/app/generated/app_localizations_ru.dart b/lib/src/app/generated/app_localizations_ru.dart index b17bee89..76622452 100644 --- a/lib/src/app/generated/app_localizations_ru.dart +++ b/lib/src/app/generated/app_localizations_ru.dart @@ -1,6 +1,5 @@ // ignore: unused_import import 'package:intl/intl.dart' as intl; - import 'app_localizations.dart'; // ignore_for_file: type=lint diff --git a/lib/src/app/generated/app_localizations_zh.dart b/lib/src/app/generated/app_localizations_zh.dart index 0702cd8d..af3466d1 100644 --- a/lib/src/app/generated/app_localizations_zh.dart +++ b/lib/src/app/generated/app_localizations_zh.dart @@ -1,6 +1,5 @@ // ignore: unused_import import 'package:intl/intl.dart' as intl; - import 'app_localizations.dart'; // ignore_for_file: type=lint diff --git a/lib/src/app/layout/app_navigation_bar.dart b/lib/src/app/layout/app_navigation_bar.dart index c8c85f3a..810d56c4 100644 --- a/lib/src/app/layout/app_navigation_bar.dart +++ b/lib/src/app/layout/app_navigation_bar.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'dart:ui'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; @@ -242,6 +244,22 @@ class AppBottomNavigationBar extends ConsumerWidget { // indicator from the previous branch instead of appearing pre-selected. final activeBranch = ShellBranchIndex.maybeOf(context) ?? currentBranch; final selectedIndex = branchIndices.indexOf(activeBranch); + // 鸿蒙端底部导航栏加沉浸光感(毛玻璃 + 顶部高光渐变)。 + if (defaultTargetPlatform == TargetPlatform.ohos) { + return _OhosImmersiveNavigationBar( + destinations: [ + for (final index in branchIndices) + bottomNavDestination(context, l10n, queue, doneAt, index), + ], + selectedIndex: selectedIndex < 0 ? 0 : selectedIndex, + onDestinationSelected: (index) { + final branch = branchIndices[index]; + if (branch != activeBranch) { + StatefulNavigationShell.of(context).goBranch(branch); + } + }, + ); + } return NavigationBar( destinations: [ for (final index in branchIndices) @@ -258,6 +276,73 @@ class AppBottomNavigationBar extends ConsumerWidget { } } +/// 鸿蒙沉浸式底部导航栏:半透明毛玻璃背景 + 顶部柔和高光,营造 HarmonyOS +/// 标志性的「光感」质感。 +class _OhosImmersiveNavigationBar extends StatelessWidget { + const _OhosImmersiveNavigationBar({ + required this.destinations, + required this.selectedIndex, + required this.onDestinationSelected, + }); + + final List destinations; + final int selectedIndex; + final ValueChanged onDestinationSelected; + + @override + Widget build(BuildContext context) { + final scheme = Theme.of(context).colorScheme; + return ClipRect( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 24, sigmaY: 24), + child: Container( + decoration: BoxDecoration( + color: scheme.surface.withValues(alpha: 0.72), + border: Border( + top: BorderSide( + color: scheme.outlineVariant.withValues(alpha: 0.4), + width: 0.5, + ), + ), + ), + child: Stack( + children: [ + // 顶部高光渐变:HarmonyOS 导航栏顶部的柔和光晕。 + Positioned( + left: 0, + right: 0, + top: 0, + height: 1.5, + child: IgnorePointer( + child: DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + scheme.primary.withValues(alpha: 0.0), + scheme.primary.withValues(alpha: 0.35), + scheme.primary.withValues(alpha: 0.0), + ], + ), + ), + ), + ), + ), + NavigationBar( + backgroundColor: Colors.transparent, + elevation: 0, + height: 68, + destinations: destinations, + selectedIndex: selectedIndex, + onDestinationSelected: onDestinationSelected, + ), + ], + ), + ), + ), + ); + } +} + class PrimaryBranchScaffold extends StatelessWidget { const PrimaryBranchScaffold({ super.key, diff --git a/lib/src/app/oronbox_app.dart b/lib/src/app/oronbox_app.dart index df910bc3..c66d6af9 100644 --- a/lib/src/app/oronbox_app.dart +++ b/lib/src/app/oronbox_app.dart @@ -15,7 +15,8 @@ import 'package:oronbox/src/features/devices/widgets/xms_wearable_bridge.dart'; import 'package:oronbox/src/features/plugins/widgets/plugin_host_request_handler.dart'; import 'package:oronbox/src/features/settings/services/update_check_service.dart'; import 'package:oronbox/src/app/widgets/app_error_gate.dart'; -import 'package:material_ui/material_ui.dart' as material_ui; +// material_ui resolves to package:flutter/material.dart on this Flutter fork. +import 'package:flutter/material.dart' as material_ui; final _desktopAccentColorProvider = FutureProvider((ref) { final source = ref.watch( @@ -79,7 +80,7 @@ class OronBoxApp extends ConsumerWidget { child: AppErrorGate( child: PluginHostRequestHandler( child: XmsWearableBridge( - child: UpdateCheckHandler( + child: ConditionalUpdateCheckHandler( child: FileOpenHandler( child: XiaomiAutomaticSyncScheduler( child: DeviceDeepLinkHandler( diff --git a/lib/src/app/theme/dynamic_color_adapter.dart b/lib/src/app/theme/dynamic_color_adapter.dart index dc7a5c0c..09560444 100644 --- a/lib/src/app/theme/dynamic_color_adapter.dart +++ b/lib/src/app/theme/dynamic_color_adapter.dart @@ -2,8 +2,11 @@ // they are deprecated in the current Material color API. // ignore_for_file: deprecated_member_use +// material_ui is now package:flutter/material.dart (Dart 3.11.5 / Flutter 3.41.9 +// ships with the in-tree Material library; the externally extracted material_ui +// package only became available for Dart 3.12+). import 'package:flutter/material.dart' as flutter; -import 'package:material_ui/material_ui.dart' as material_ui; +import 'package:flutter/material.dart' as material_ui; /// Converts the `material_ui` color scheme returned by dynamic_color 2.x to /// Flutter's Material color scheme used by the rest of OronBox. diff --git a/lib/src/core/extensions/riverpod_mounted_ext.dart b/lib/src/core/extensions/riverpod_mounted_ext.dart new file mode 100644 index 00000000..921f97f6 --- /dev/null +++ b/lib/src/core/extensions/riverpod_mounted_ext.dart @@ -0,0 +1,22 @@ +/// Compatibility shim for riverpod 2.6.1. +/// +/// `NotifierProviderRef.mounted` was introduced in riverpod 3.x. In 2.6.1 the +/// getter exists on the runtime element (`NotifierProviderElement`) but is not +/// declared on the `NotifierProviderRef` interface, so `ref.mounted` fails to +/// compile. This extension bridges the gap via a dynamic dispatch — safe +/// because `ref` always returns the backing element at runtime. +import 'package:riverpod/riverpod.dart'; + +extension NotifierProviderRefMounted on NotifierProviderRef { + /// Whether the provider element backing this ref is still mounted. + /// + /// Returns `false` if the dynamic lookup fails (defensive default). + bool get mounted { + final dynamic element = this; + try { + return (element.mounted as bool?) ?? false; + } catch (_) { + return false; + } + } +} diff --git a/lib/src/core/models/bt_models.freezed.dart b/lib/src/core/models/bt_models.freezed.dart index 77dff9b8..5396093e 100644 --- a/lib/src/core/models/bt_models.freezed.dart +++ b/lib/src/core/models/bt_models.freezed.dart @@ -1,6 +1,6 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file -// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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, unnecessary_question_mark part of 'bt_models.dart'; @@ -9,2255 +9,1943 @@ part of 'bt_models.dart'; // FreezedGenerator // ************************************************************************** -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off 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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +BTDeviceInfo _$BTDeviceInfoFromJson(Map json) { + return _BTDeviceInfo.fromJson(json); +} + /// @nodoc mixin _$BTDeviceInfo { - - String get name; String get addr; String get connectType; -/// Create a copy of BTDeviceInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$BTDeviceInfoCopyWith get copyWith => _$BTDeviceInfoCopyWithImpl(this as BTDeviceInfo, _$identity); + String get name => throw _privateConstructorUsedError; + String get addr => throw _privateConstructorUsedError; + String get connectType => throw _privateConstructorUsedError; /// Serializes this BTDeviceInfo to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is BTDeviceInfo&&(identical(other.name, name) || other.name == name)&&(identical(other.addr, addr) || other.addr == addr)&&(identical(other.connectType, connectType) || other.connectType == connectType)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,addr,connectType); + Map toJson() => throw _privateConstructorUsedError; -@override -String toString() { - return 'BTDeviceInfo(name: $name, addr: $addr, connectType: $connectType)'; + /// Create a copy of BTDeviceInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $BTDeviceInfoCopyWith get copyWith => + throw _privateConstructorUsedError; } - +/// @nodoc +abstract class $BTDeviceInfoCopyWith<$Res> { + factory $BTDeviceInfoCopyWith( + BTDeviceInfo value, + $Res Function(BTDeviceInfo) then, + ) = _$BTDeviceInfoCopyWithImpl<$Res, BTDeviceInfo>; + @useResult + $Res call({String name, String addr, String connectType}); } /// @nodoc -abstract mixin class $BTDeviceInfoCopyWith<$Res> { - factory $BTDeviceInfoCopyWith(BTDeviceInfo value, $Res Function(BTDeviceInfo) _then) = _$BTDeviceInfoCopyWithImpl; -@useResult -$Res call({ - String name, String addr, String connectType -}); - - - - +class _$BTDeviceInfoCopyWithImpl<$Res, $Val extends BTDeviceInfo> + implements $BTDeviceInfoCopyWith<$Res> { + _$BTDeviceInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of BTDeviceInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? name = null, + Object? addr = null, + Object? connectType = null, + }) { + return _then( + _value.copyWith( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + addr: null == addr + ? _value.addr + : addr // ignore: cast_nullable_to_non_nullable + as String, + connectType: null == connectType + ? _value.connectType + : connectType // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } } + /// @nodoc -class _$BTDeviceInfoCopyWithImpl<$Res> +abstract class _$$BTDeviceInfoImplCopyWith<$Res> implements $BTDeviceInfoCopyWith<$Res> { - _$BTDeviceInfoCopyWithImpl(this._self, this._then); - - final BTDeviceInfo _self; - final $Res Function(BTDeviceInfo) _then; - -/// Create a copy of BTDeviceInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? addr = null,Object? connectType = null,}) { - return _then(BTDeviceInfo( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,addr: null == addr ? _self.addr : addr // ignore: cast_nullable_to_non_nullable -as String,connectType: null == connectType ? _self.connectType : connectType // ignore: cast_nullable_to_non_nullable -as String, - )); -} - -} - - -/// Adds pattern-matching-related methods to [BTDeviceInfo]. -extension BTDeviceInfoPatterns on BTDeviceInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _BTDeviceInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _BTDeviceInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _BTDeviceInfo value) $default,){ -final _that = this; -switch (_that) { -case _BTDeviceInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BTDeviceInfo value)? $default,){ -final _that = this; -switch (_that) { -case _BTDeviceInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String name, String addr, String connectType)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _BTDeviceInfo() when $default != null: -return $default(_that.name,_that.addr,_that.connectType);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String name, String addr, String connectType) $default,) {final _that = this; -switch (_that) { -case _BTDeviceInfo(): -return $default(_that.name,_that.addr,_that.connectType);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String name, String addr, String connectType)? $default,) {final _that = this; -switch (_that) { -case _BTDeviceInfo() when $default != null: -return $default(_that.name,_that.addr,_that.connectType);case _: - return null; - -} + factory _$$BTDeviceInfoImplCopyWith( + _$BTDeviceInfoImpl value, + $Res Function(_$BTDeviceInfoImpl) then, + ) = __$$BTDeviceInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String name, String addr, String connectType}); } +/// @nodoc +class __$$BTDeviceInfoImplCopyWithImpl<$Res> + extends _$BTDeviceInfoCopyWithImpl<$Res, _$BTDeviceInfoImpl> + implements _$$BTDeviceInfoImplCopyWith<$Res> { + __$$BTDeviceInfoImplCopyWithImpl( + _$BTDeviceInfoImpl _value, + $Res Function(_$BTDeviceInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of BTDeviceInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? name = null, + Object? addr = null, + Object? connectType = null, + }) { + return _then( + _$BTDeviceInfoImpl( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + addr: null == addr + ? _value.addr + : addr // ignore: cast_nullable_to_non_nullable + as String, + connectType: null == connectType + ? _value.connectType + : connectType // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$BTDeviceInfoImpl implements _BTDeviceInfo { + const _$BTDeviceInfoImpl({ + required this.name, + required this.addr, + required this.connectType, + }); -class _BTDeviceInfo implements BTDeviceInfo { - const _BTDeviceInfo({required this.name, required this.addr, required this.connectType}); - factory _BTDeviceInfo.fromJson(Map json) => _$BTDeviceInfoFromJson(json); - -@override final String name; -@override final String addr; -@override final String connectType; - -/// Create a copy of BTDeviceInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$BTDeviceInfoCopyWith<_BTDeviceInfo> get copyWith => __$BTDeviceInfoCopyWithImpl<_BTDeviceInfo>(this, _$identity); - -@override -Map toJson() { - return _$BTDeviceInfoToJson(this, ); -} + factory _$BTDeviceInfoImpl.fromJson(Map json) => + _$$BTDeviceInfoImplFromJson(json); -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _BTDeviceInfo&&(identical(other.name, name) || other.name == name)&&(identical(other.addr, addr) || other.addr == addr)&&(identical(other.connectType, connectType) || other.connectType == connectType)); -} + @override + final String name; + @override + final String addr; + @override + final String connectType; -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,addr,connectType); - -@override -String toString() { - return 'BTDeviceInfo(name: $name, addr: $addr, connectType: $connectType)'; -} + @override + String toString() { + return 'BTDeviceInfo(name: $name, addr: $addr, connectType: $connectType)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$BTDeviceInfoImpl && + (identical(other.name, name) || other.name == name) && + (identical(other.addr, addr) || other.addr == addr) && + (identical(other.connectType, connectType) || + other.connectType == connectType)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, name, addr, connectType); + + /// Create a copy of BTDeviceInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$BTDeviceInfoImplCopyWith<_$BTDeviceInfoImpl> get copyWith => + __$$BTDeviceInfoImplCopyWithImpl<_$BTDeviceInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$BTDeviceInfoImplToJson(this); + } } -/// @nodoc -abstract mixin class _$BTDeviceInfoCopyWith<$Res> implements $BTDeviceInfoCopyWith<$Res> { - factory _$BTDeviceInfoCopyWith(_BTDeviceInfo value, $Res Function(_BTDeviceInfo) _then) = __$BTDeviceInfoCopyWithImpl; -@override @useResult -$Res call({ - String name, String addr, String connectType -}); - +abstract class _BTDeviceInfo implements BTDeviceInfo { + const factory _BTDeviceInfo({ + required final String name, + required final String addr, + required final String connectType, + }) = _$BTDeviceInfoImpl; + factory _BTDeviceInfo.fromJson(Map json) = + _$BTDeviceInfoImpl.fromJson; + @override + String get name; + @override + String get addr; + @override + String get connectType; + /// Create a copy of BTDeviceInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$BTDeviceInfoImplCopyWith<_$BTDeviceInfoImpl> get copyWith => + throw _privateConstructorUsedError; } -/// @nodoc -class __$BTDeviceInfoCopyWithImpl<$Res> - implements _$BTDeviceInfoCopyWith<$Res> { - __$BTDeviceInfoCopyWithImpl(this._self, this._then); - - final _BTDeviceInfo _self; - final $Res Function(_BTDeviceInfo) _then; - -/// Create a copy of BTDeviceInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? addr = null,Object? connectType = null,}) { - return _then(_BTDeviceInfo( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,addr: null == addr ? _self.addr : addr // ignore: cast_nullable_to_non_nullable -as String,connectType: null == connectType ? _self.connectType : connectType // ignore: cast_nullable_to_non_nullable -as String, - )); -} - +MiWearState _$MiWearStateFromJson(Map json) { + return _MiWearState.fromJson(json); } - /// @nodoc mixin _$MiWearState { - - String get name; String get addr; String get connectType; String? get authkey; String? get codename; bool get disconnected; -/// Create a copy of MiWearState -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$MiWearStateCopyWith get copyWith => _$MiWearStateCopyWithImpl(this as MiWearState, _$identity); + String get name => throw _privateConstructorUsedError; + String get addr => throw _privateConstructorUsedError; + String get connectType => throw _privateConstructorUsedError; + String? get authkey => throw _privateConstructorUsedError; + String? get codename => throw _privateConstructorUsedError; + bool get disconnected => throw _privateConstructorUsedError; /// Serializes this MiWearState to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is MiWearState&&(identical(other.name, name) || other.name == name)&&(identical(other.addr, addr) || other.addr == addr)&&(identical(other.connectType, connectType) || other.connectType == connectType)&&(identical(other.authkey, authkey) || other.authkey == authkey)&&(identical(other.codename, codename) || other.codename == codename)&&(identical(other.disconnected, disconnected) || other.disconnected == disconnected)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,addr,connectType,authkey,codename,disconnected); - -@override -String toString() { - return 'MiWearState(name: $name, addr: $addr, connectType: $connectType, authkey: $authkey, codename: $codename, disconnected: $disconnected)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of MiWearState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $MiWearStateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $MiWearStateCopyWith<$Res> { - factory $MiWearStateCopyWith(MiWearState value, $Res Function(MiWearState) _then) = _$MiWearStateCopyWithImpl; -@useResult -$Res call({ - String name, String addr, String connectType, String? authkey, String? codename, bool disconnected -}); - - - - +abstract class $MiWearStateCopyWith<$Res> { + factory $MiWearStateCopyWith( + MiWearState value, + $Res Function(MiWearState) then, + ) = _$MiWearStateCopyWithImpl<$Res, MiWearState>; + @useResult + $Res call({ + String name, + String addr, + String connectType, + String? authkey, + String? codename, + bool disconnected, + }); } + /// @nodoc -class _$MiWearStateCopyWithImpl<$Res> +class _$MiWearStateCopyWithImpl<$Res, $Val extends MiWearState> implements $MiWearStateCopyWith<$Res> { - _$MiWearStateCopyWithImpl(this._self, this._then); - - final MiWearState _self; - final $Res Function(MiWearState) _then; - -/// Create a copy of MiWearState -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? addr = null,Object? connectType = null,Object? authkey = freezed,Object? codename = freezed,Object? disconnected = null,}) { - return _then(MiWearState( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,addr: null == addr ? _self.addr : addr // ignore: cast_nullable_to_non_nullable -as String,connectType: null == connectType ? _self.connectType : connectType // ignore: cast_nullable_to_non_nullable -as String,authkey: freezed == authkey ? _self.authkey : authkey // ignore: cast_nullable_to_non_nullable -as String?,codename: freezed == codename ? _self.codename : codename // ignore: cast_nullable_to_non_nullable -as String?,disconnected: null == disconnected ? _self.disconnected : disconnected // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - -} - - -/// Adds pattern-matching-related methods to [MiWearState]. -extension MiWearStatePatterns on MiWearState { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _MiWearState value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _MiWearState() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _MiWearState value) $default,){ -final _that = this; -switch (_that) { -case _MiWearState(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _MiWearState value)? $default,){ -final _that = this; -switch (_that) { -case _MiWearState() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String name, String addr, String connectType, String? authkey, String? codename, bool disconnected)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _MiWearState() when $default != null: -return $default(_that.name,_that.addr,_that.connectType,_that.authkey,_that.codename,_that.disconnected);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String name, String addr, String connectType, String? authkey, String? codename, bool disconnected) $default,) {final _that = this; -switch (_that) { -case _MiWearState(): -return $default(_that.name,_that.addr,_that.connectType,_that.authkey,_that.codename,_that.disconnected);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String name, String addr, String connectType, String? authkey, String? codename, bool disconnected)? $default,) {final _that = this; -switch (_that) { -case _MiWearState() when $default != null: -return $default(_that.name,_that.addr,_that.connectType,_that.authkey,_that.codename,_that.disconnected);case _: - return null; - -} -} - + _$MiWearStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of MiWearState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? name = null, + Object? addr = null, + Object? connectType = null, + Object? authkey = freezed, + Object? codename = freezed, + Object? disconnected = null, + }) { + return _then( + _value.copyWith( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + addr: null == addr + ? _value.addr + : addr // ignore: cast_nullable_to_non_nullable + as String, + connectType: null == connectType + ? _value.connectType + : connectType // ignore: cast_nullable_to_non_nullable + as String, + authkey: freezed == authkey + ? _value.authkey + : authkey // ignore: cast_nullable_to_non_nullable + as String?, + codename: freezed == codename + ? _value.codename + : codename // ignore: cast_nullable_to_non_nullable + as String?, + disconnected: null == disconnected + ? _value.disconnected + : disconnected // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _MiWearState implements MiWearState { - const _MiWearState({required this.name, required this.addr, required this.connectType, this.authkey, this.codename, this.disconnected = false}); - factory _MiWearState.fromJson(Map json) => _$MiWearStateFromJson(json); - -@override final String name; -@override final String addr; -@override final String connectType; -@override final String? authkey; -@override final String? codename; -@override@JsonKey() final bool disconnected; - -/// Create a copy of MiWearState -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$MiWearStateCopyWith<_MiWearState> get copyWith => __$MiWearStateCopyWithImpl<_MiWearState>(this, _$identity); - -@override -Map toJson() { - return _$MiWearStateToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _MiWearState&&(identical(other.name, name) || other.name == name)&&(identical(other.addr, addr) || other.addr == addr)&&(identical(other.connectType, connectType) || other.connectType == connectType)&&(identical(other.authkey, authkey) || other.authkey == authkey)&&(identical(other.codename, codename) || other.codename == codename)&&(identical(other.disconnected, disconnected) || other.disconnected == disconnected)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,addr,connectType,authkey,codename,disconnected); - -@override -String toString() { - return 'MiWearState(name: $name, addr: $addr, connectType: $connectType, authkey: $authkey, codename: $codename, disconnected: $disconnected)'; +abstract class _$$MiWearStateImplCopyWith<$Res> + implements $MiWearStateCopyWith<$Res> { + factory _$$MiWearStateImplCopyWith( + _$MiWearStateImpl value, + $Res Function(_$MiWearStateImpl) then, + ) = __$$MiWearStateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String name, + String addr, + String connectType, + String? authkey, + String? codename, + bool disconnected, + }); } - +/// @nodoc +class __$$MiWearStateImplCopyWithImpl<$Res> + extends _$MiWearStateCopyWithImpl<$Res, _$MiWearStateImpl> + implements _$$MiWearStateImplCopyWith<$Res> { + __$$MiWearStateImplCopyWithImpl( + _$MiWearStateImpl _value, + $Res Function(_$MiWearStateImpl) _then, + ) : super(_value, _then); + + /// Create a copy of MiWearState + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? name = null, + Object? addr = null, + Object? connectType = null, + Object? authkey = freezed, + Object? codename = freezed, + Object? disconnected = null, + }) { + return _then( + _$MiWearStateImpl( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + addr: null == addr + ? _value.addr + : addr // ignore: cast_nullable_to_non_nullable + as String, + connectType: null == connectType + ? _value.connectType + : connectType // ignore: cast_nullable_to_non_nullable + as String, + authkey: freezed == authkey + ? _value.authkey + : authkey // ignore: cast_nullable_to_non_nullable + as String?, + codename: freezed == codename + ? _value.codename + : codename // ignore: cast_nullable_to_non_nullable + as String?, + disconnected: null == disconnected + ? _value.disconnected + : disconnected // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); + } } /// @nodoc -abstract mixin class _$MiWearStateCopyWith<$Res> implements $MiWearStateCopyWith<$Res> { - factory _$MiWearStateCopyWith(_MiWearState value, $Res Function(_MiWearState) _then) = __$MiWearStateCopyWithImpl; -@override @useResult -$Res call({ - String name, String addr, String connectType, String? authkey, String? codename, bool disconnected -}); - - - +@JsonSerializable() +class _$MiWearStateImpl implements _MiWearState { + const _$MiWearStateImpl({ + required this.name, + required this.addr, + required this.connectType, + this.authkey, + this.codename, + this.disconnected = false, + }); -} -/// @nodoc -class __$MiWearStateCopyWithImpl<$Res> - implements _$MiWearStateCopyWith<$Res> { - __$MiWearStateCopyWithImpl(this._self, this._then); + factory _$MiWearStateImpl.fromJson(Map json) => + _$$MiWearStateImplFromJson(json); + + @override + final String name; + @override + final String addr; + @override + final String connectType; + @override + final String? authkey; + @override + final String? codename; + @override + @JsonKey() + final bool disconnected; + + @override + String toString() { + return 'MiWearState(name: $name, addr: $addr, connectType: $connectType, authkey: $authkey, codename: $codename, disconnected: $disconnected)'; + } - final _MiWearState _self; - final $Res Function(_MiWearState) _then; + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$MiWearStateImpl && + (identical(other.name, name) || other.name == name) && + (identical(other.addr, addr) || other.addr == addr) && + (identical(other.connectType, connectType) || + other.connectType == connectType) && + (identical(other.authkey, authkey) || other.authkey == authkey) && + (identical(other.codename, codename) || + other.codename == codename) && + (identical(other.disconnected, disconnected) || + other.disconnected == disconnected)); + } -/// Create a copy of MiWearState -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? addr = null,Object? connectType = null,Object? authkey = freezed,Object? codename = freezed,Object? disconnected = null,}) { - return _then(_MiWearState( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,addr: null == addr ? _self.addr : addr // ignore: cast_nullable_to_non_nullable -as String,connectType: null == connectType ? _self.connectType : connectType // ignore: cast_nullable_to_non_nullable -as String,authkey: freezed == authkey ? _self.authkey : authkey // ignore: cast_nullable_to_non_nullable -as String?,codename: freezed == codename ? _self.codename : codename // ignore: cast_nullable_to_non_nullable -as String?,disconnected: null == disconnected ? _self.disconnected : disconnected // ignore: cast_nullable_to_non_nullable -as bool, - )); + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + name, + addr, + connectType, + authkey, + codename, + disconnected, + ); + + /// Create a copy of MiWearState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$MiWearStateImplCopyWith<_$MiWearStateImpl> get copyWith => + __$$MiWearStateImplCopyWithImpl<_$MiWearStateImpl>(this, _$identity); + + @override + Map toJson() { + return _$$MiWearStateImplToJson(this); + } } - +abstract class _MiWearState implements MiWearState { + const factory _MiWearState({ + required final String name, + required final String addr, + required final String connectType, + final String? authkey, + final String? codename, + final bool disconnected, + }) = _$MiWearStateImpl; + + factory _MiWearState.fromJson(Map json) = + _$MiWearStateImpl.fromJson; + + @override + String get name; + @override + String get addr; + @override + String get connectType; + @override + String? get authkey; + @override + String? get codename; + @override + bool get disconnected; + + /// Create a copy of MiWearState + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$MiWearStateImplCopyWith<_$MiWearStateImpl> get copyWith => + throw _privateConstructorUsedError; +} + +ChargeInfo _$ChargeInfoFromJson(Map json) { + return _ChargeInfo.fromJson(json); } - /// @nodoc mixin _$ChargeInfo { - - int get state; int? get timestamp; -/// Create a copy of ChargeInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$ChargeInfoCopyWith get copyWith => _$ChargeInfoCopyWithImpl(this as ChargeInfo, _$identity); + int get state => throw _privateConstructorUsedError; + int? get timestamp => throw _privateConstructorUsedError; /// Serializes this ChargeInfo to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is ChargeInfo&&(identical(other.state, state) || other.state == state)&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,state,timestamp); + Map toJson() => throw _privateConstructorUsedError; -@override -String toString() { - return 'ChargeInfo(state: $state, timestamp: $timestamp)'; + /// Create a copy of ChargeInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ChargeInfoCopyWith get copyWith => + throw _privateConstructorUsedError; } - +/// @nodoc +abstract class $ChargeInfoCopyWith<$Res> { + factory $ChargeInfoCopyWith( + ChargeInfo value, + $Res Function(ChargeInfo) then, + ) = _$ChargeInfoCopyWithImpl<$Res, ChargeInfo>; + @useResult + $Res call({int state, int? timestamp}); } /// @nodoc -abstract mixin class $ChargeInfoCopyWith<$Res> { - factory $ChargeInfoCopyWith(ChargeInfo value, $Res Function(ChargeInfo) _then) = _$ChargeInfoCopyWithImpl; -@useResult -$Res call({ - int state, int? timestamp -}); - - - - +class _$ChargeInfoCopyWithImpl<$Res, $Val extends ChargeInfo> + implements $ChargeInfoCopyWith<$Res> { + _$ChargeInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ChargeInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? state = null, Object? timestamp = freezed}) { + return _then( + _value.copyWith( + state: null == state + ? _value.state + : state // ignore: cast_nullable_to_non_nullable + as int, + timestamp: freezed == timestamp + ? _value.timestamp + : timestamp // ignore: cast_nullable_to_non_nullable + as int?, + ) + as $Val, + ); + } } + /// @nodoc -class _$ChargeInfoCopyWithImpl<$Res> +abstract class _$$ChargeInfoImplCopyWith<$Res> implements $ChargeInfoCopyWith<$Res> { - _$ChargeInfoCopyWithImpl(this._self, this._then); - - final ChargeInfo _self; - final $Res Function(ChargeInfo) _then; - -/// Create a copy of ChargeInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? state = null,Object? timestamp = freezed,}) { - return _then(ChargeInfo( -state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable -as int,timestamp: freezed == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable -as int?, - )); -} - -} - - -/// Adds pattern-matching-related methods to [ChargeInfo]. -extension ChargeInfoPatterns on ChargeInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _ChargeInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _ChargeInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _ChargeInfo value) $default,){ -final _that = this; -switch (_that) { -case _ChargeInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _ChargeInfo value)? $default,){ -final _that = this; -switch (_that) { -case _ChargeInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int state, int? timestamp)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _ChargeInfo() when $default != null: -return $default(_that.state,_that.timestamp);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int state, int? timestamp) $default,) {final _that = this; -switch (_that) { -case _ChargeInfo(): -return $default(_that.state,_that.timestamp);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int state, int? timestamp)? $default,) {final _that = this; -switch (_that) { -case _ChargeInfo() when $default != null: -return $default(_that.state,_that.timestamp);case _: - return null; - -} + factory _$$ChargeInfoImplCopyWith( + _$ChargeInfoImpl value, + $Res Function(_$ChargeInfoImpl) then, + ) = __$$ChargeInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int state, int? timestamp}); } +/// @nodoc +class __$$ChargeInfoImplCopyWithImpl<$Res> + extends _$ChargeInfoCopyWithImpl<$Res, _$ChargeInfoImpl> + implements _$$ChargeInfoImplCopyWith<$Res> { + __$$ChargeInfoImplCopyWithImpl( + _$ChargeInfoImpl _value, + $Res Function(_$ChargeInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ChargeInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? state = null, Object? timestamp = freezed}) { + return _then( + _$ChargeInfoImpl( + state: null == state + ? _value.state + : state // ignore: cast_nullable_to_non_nullable + as int, + timestamp: freezed == timestamp + ? _value.timestamp + : timestamp // ignore: cast_nullable_to_non_nullable + as int?, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$ChargeInfoImpl implements _ChargeInfo { + const _$ChargeInfoImpl({this.state = 0, this.timestamp}); -class _ChargeInfo implements ChargeInfo { - const _ChargeInfo({this.state = 0, this.timestamp}); - factory _ChargeInfo.fromJson(Map json) => _$ChargeInfoFromJson(json); + factory _$ChargeInfoImpl.fromJson(Map json) => + _$$ChargeInfoImplFromJson(json); -@override@JsonKey() final int state; -@override final int? timestamp; - -/// Create a copy of ChargeInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$ChargeInfoCopyWith<_ChargeInfo> get copyWith => __$ChargeInfoCopyWithImpl<_ChargeInfo>(this, _$identity); - -@override -Map toJson() { - return _$ChargeInfoToJson(this, ); -} + @override + @JsonKey() + final int state; + @override + final int? timestamp; -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChargeInfo&&(identical(other.state, state) || other.state == state)&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,state,timestamp); - -@override -String toString() { - return 'ChargeInfo(state: $state, timestamp: $timestamp)'; -} + @override + String toString() { + return 'ChargeInfo(state: $state, timestamp: $timestamp)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChargeInfoImpl && + (identical(other.state, state) || other.state == state) && + (identical(other.timestamp, timestamp) || + other.timestamp == timestamp)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, state, timestamp); + + /// Create a copy of ChargeInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ChargeInfoImplCopyWith<_$ChargeInfoImpl> get copyWith => + __$$ChargeInfoImplCopyWithImpl<_$ChargeInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$ChargeInfoImplToJson(this); + } } -/// @nodoc -abstract mixin class _$ChargeInfoCopyWith<$Res> implements $ChargeInfoCopyWith<$Res> { - factory _$ChargeInfoCopyWith(_ChargeInfo value, $Res Function(_ChargeInfo) _then) = __$ChargeInfoCopyWithImpl; -@override @useResult -$Res call({ - int state, int? timestamp -}); - - +abstract class _ChargeInfo implements ChargeInfo { + const factory _ChargeInfo({final int state, final int? timestamp}) = + _$ChargeInfoImpl; + factory _ChargeInfo.fromJson(Map json) = + _$ChargeInfoImpl.fromJson; -} -/// @nodoc -class __$ChargeInfoCopyWithImpl<$Res> - implements _$ChargeInfoCopyWith<$Res> { - __$ChargeInfoCopyWithImpl(this._self, this._then); - - final _ChargeInfo _self; - final $Res Function(_ChargeInfo) _then; + @override + int get state; + @override + int? get timestamp; -/// Create a copy of ChargeInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? state = null,Object? timestamp = freezed,}) { - return _then(_ChargeInfo( -state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable -as int,timestamp: freezed == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable -as int?, - )); + /// Create a copy of ChargeInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ChargeInfoImplCopyWith<_$ChargeInfoImpl> get copyWith => + throw _privateConstructorUsedError; } - +BatteryStatus _$BatteryStatusFromJson(Map json) { + return _BatteryStatus.fromJson(json); } - /// @nodoc mixin _$BatteryStatus { - - int get capacity; ChargeStatus get chargeStatus; ChargeInfo? get chargeInfo; -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$BatteryStatusCopyWith get copyWith => _$BatteryStatusCopyWithImpl(this as BatteryStatus, _$identity); + int get capacity => throw _privateConstructorUsedError; + ChargeStatus get chargeStatus => throw _privateConstructorUsedError; + ChargeInfo? get chargeInfo => throw _privateConstructorUsedError; /// Serializes this BatteryStatus to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is BatteryStatus&&(identical(other.capacity, capacity) || other.capacity == capacity)&&(identical(other.chargeStatus, chargeStatus) || other.chargeStatus == chargeStatus)&&(identical(other.chargeInfo, chargeInfo) || other.chargeInfo == chargeInfo)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,capacity,chargeStatus,chargeInfo); - -@override -String toString() { - return 'BatteryStatus(capacity: $capacity, chargeStatus: $chargeStatus, chargeInfo: $chargeInfo)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $BatteryStatusCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $BatteryStatusCopyWith<$Res> { - factory $BatteryStatusCopyWith(BatteryStatus value, $Res Function(BatteryStatus) _then) = _$BatteryStatusCopyWithImpl; -@useResult -$Res call({ - int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo -}); - - -$ChargeInfoCopyWith<$Res>? get chargeInfo; +abstract class $BatteryStatusCopyWith<$Res> { + factory $BatteryStatusCopyWith( + BatteryStatus value, + $Res Function(BatteryStatus) then, + ) = _$BatteryStatusCopyWithImpl<$Res, BatteryStatus>; + @useResult + $Res call({int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo}); + $ChargeInfoCopyWith<$Res>? get chargeInfo; } + /// @nodoc -class _$BatteryStatusCopyWithImpl<$Res> +class _$BatteryStatusCopyWithImpl<$Res, $Val extends BatteryStatus> implements $BatteryStatusCopyWith<$Res> { - _$BatteryStatusCopyWithImpl(this._self, this._then); - - final BatteryStatus _self; - final $Res Function(BatteryStatus) _then; - -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? capacity = null,Object? chargeStatus = null,Object? chargeInfo = freezed,}) { - return _then(BatteryStatus( -capacity: null == capacity ? _self.capacity : capacity // ignore: cast_nullable_to_non_nullable -as int,chargeStatus: null == chargeStatus ? _self.chargeStatus : chargeStatus // ignore: cast_nullable_to_non_nullable -as ChargeStatus,chargeInfo: freezed == chargeInfo ? _self.chargeInfo : chargeInfo // ignore: cast_nullable_to_non_nullable -as ChargeInfo?, - )); -} -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$ChargeInfoCopyWith<$Res>? get chargeInfo { - if (_self.chargeInfo == null) { - return null; + _$BatteryStatusCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? capacity = null, + Object? chargeStatus = null, + Object? chargeInfo = freezed, + }) { + return _then( + _value.copyWith( + capacity: null == capacity + ? _value.capacity + : capacity // ignore: cast_nullable_to_non_nullable + as int, + chargeStatus: null == chargeStatus + ? _value.chargeStatus + : chargeStatus // ignore: cast_nullable_to_non_nullable + as ChargeStatus, + chargeInfo: freezed == chargeInfo + ? _value.chargeInfo + : chargeInfo // ignore: cast_nullable_to_non_nullable + as ChargeInfo?, + ) + as $Val, + ); } - return $ChargeInfoCopyWith<$Res>(_self.chargeInfo!, (value) { - return _then(_self.copyWith(chargeInfo: value)); - }); -} + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $ChargeInfoCopyWith<$Res>? get chargeInfo { + if (_value.chargeInfo == null) { + return null; + } + + return $ChargeInfoCopyWith<$Res>(_value.chargeInfo!, (value) { + return _then(_value.copyWith(chargeInfo: value) as $Val); + }); + } } +/// @nodoc +abstract class _$$BatteryStatusImplCopyWith<$Res> + implements $BatteryStatusCopyWith<$Res> { + factory _$$BatteryStatusImplCopyWith( + _$BatteryStatusImpl value, + $Res Function(_$BatteryStatusImpl) then, + ) = __$$BatteryStatusImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo}); -/// Adds pattern-matching-related methods to [BatteryStatus]. -extension BatteryStatusPatterns on BatteryStatus { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _BatteryStatus value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _BatteryStatus() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _BatteryStatus value) $default,){ -final _that = this; -switch (_that) { -case _BatteryStatus(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BatteryStatus value)? $default,){ -final _that = this; -switch (_that) { -case _BatteryStatus() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _BatteryStatus() when $default != null: -return $default(_that.capacity,_that.chargeStatus,_that.chargeInfo);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo) $default,) {final _that = this; -switch (_that) { -case _BatteryStatus(): -return $default(_that.capacity,_that.chargeStatus,_that.chargeInfo);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo)? $default,) {final _that = this; -switch (_that) { -case _BatteryStatus() when $default != null: -return $default(_that.capacity,_that.chargeStatus,_that.chargeInfo);case _: - return null; - -} + @override + $ChargeInfoCopyWith<$Res>? get chargeInfo; } +/// @nodoc +class __$$BatteryStatusImplCopyWithImpl<$Res> + extends _$BatteryStatusCopyWithImpl<$Res, _$BatteryStatusImpl> + implements _$$BatteryStatusImplCopyWith<$Res> { + __$$BatteryStatusImplCopyWithImpl( + _$BatteryStatusImpl _value, + $Res Function(_$BatteryStatusImpl) _then, + ) : super(_value, _then); + + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? capacity = null, + Object? chargeStatus = null, + Object? chargeInfo = freezed, + }) { + return _then( + _$BatteryStatusImpl( + capacity: null == capacity + ? _value.capacity + : capacity // ignore: cast_nullable_to_non_nullable + as int, + chargeStatus: null == chargeStatus + ? _value.chargeStatus + : chargeStatus // ignore: cast_nullable_to_non_nullable + as ChargeStatus, + chargeInfo: freezed == chargeInfo + ? _value.chargeInfo + : chargeInfo // ignore: cast_nullable_to_non_nullable + as ChargeInfo?, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$BatteryStatusImpl implements _BatteryStatus { + const _$BatteryStatusImpl({ + required this.capacity, + this.chargeStatus = ChargeStatus.unknown, + this.chargeInfo, + }); -class _BatteryStatus implements BatteryStatus { - const _BatteryStatus({required this.capacity, this.chargeStatus = ChargeStatus.unknown, this.chargeInfo}); - factory _BatteryStatus.fromJson(Map json) => _$BatteryStatusFromJson(json); - -@override final int capacity; -@override@JsonKey() final ChargeStatus chargeStatus; -@override final ChargeInfo? chargeInfo; - -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$BatteryStatusCopyWith<_BatteryStatus> get copyWith => __$BatteryStatusCopyWithImpl<_BatteryStatus>(this, _$identity); - -@override -Map toJson() { - return _$BatteryStatusToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _BatteryStatus&&(identical(other.capacity, capacity) || other.capacity == capacity)&&(identical(other.chargeStatus, chargeStatus) || other.chargeStatus == chargeStatus)&&(identical(other.chargeInfo, chargeInfo) || other.chargeInfo == chargeInfo)); -} + factory _$BatteryStatusImpl.fromJson(Map json) => + _$$BatteryStatusImplFromJson(json); -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,capacity,chargeStatus,chargeInfo); + @override + final int capacity; + @override + @JsonKey() + final ChargeStatus chargeStatus; + @override + final ChargeInfo? chargeInfo; -@override -String toString() { - return 'BatteryStatus(capacity: $capacity, chargeStatus: $chargeStatus, chargeInfo: $chargeInfo)'; -} + @override + String toString() { + return 'BatteryStatus(capacity: $capacity, chargeStatus: $chargeStatus, chargeInfo: $chargeInfo)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$BatteryStatusImpl && + (identical(other.capacity, capacity) || + other.capacity == capacity) && + (identical(other.chargeStatus, chargeStatus) || + other.chargeStatus == chargeStatus) && + (identical(other.chargeInfo, chargeInfo) || + other.chargeInfo == chargeInfo)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, capacity, chargeStatus, chargeInfo); + + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$BatteryStatusImplCopyWith<_$BatteryStatusImpl> get copyWith => + __$$BatteryStatusImplCopyWithImpl<_$BatteryStatusImpl>(this, _$identity); + + @override + Map toJson() { + return _$$BatteryStatusImplToJson(this); + } } -/// @nodoc -abstract mixin class _$BatteryStatusCopyWith<$Res> implements $BatteryStatusCopyWith<$Res> { - factory _$BatteryStatusCopyWith(_BatteryStatus value, $Res Function(_BatteryStatus) _then) = __$BatteryStatusCopyWithImpl; -@override @useResult -$Res call({ - int capacity, ChargeStatus chargeStatus, ChargeInfo? chargeInfo -}); +abstract class _BatteryStatus implements BatteryStatus { + const factory _BatteryStatus({ + required final int capacity, + final ChargeStatus chargeStatus, + final ChargeInfo? chargeInfo, + }) = _$BatteryStatusImpl; + factory _BatteryStatus.fromJson(Map json) = + _$BatteryStatusImpl.fromJson; -@override $ChargeInfoCopyWith<$Res>? get chargeInfo; + @override + int get capacity; + @override + ChargeStatus get chargeStatus; + @override + ChargeInfo? get chargeInfo; + /// Create a copy of BatteryStatus + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$BatteryStatusImplCopyWith<_$BatteryStatusImpl> get copyWith => + throw _privateConstructorUsedError; } -/// @nodoc -class __$BatteryStatusCopyWithImpl<$Res> - implements _$BatteryStatusCopyWith<$Res> { - __$BatteryStatusCopyWithImpl(this._self, this._then); - - final _BatteryStatus _self; - final $Res Function(_BatteryStatus) _then; - -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? capacity = null,Object? chargeStatus = null,Object? chargeInfo = freezed,}) { - return _then(_BatteryStatus( -capacity: null == capacity ? _self.capacity : capacity // ignore: cast_nullable_to_non_nullable -as int,chargeStatus: null == chargeStatus ? _self.chargeStatus : chargeStatus // ignore: cast_nullable_to_non_nullable -as ChargeStatus,chargeInfo: freezed == chargeInfo ? _self.chargeInfo : chargeInfo // ignore: cast_nullable_to_non_nullable -as ChargeInfo?, - )); -} - -/// Create a copy of BatteryStatus -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$ChargeInfoCopyWith<$Res>? get chargeInfo { - if (_self.chargeInfo == null) { - return null; - } - return $ChargeInfoCopyWith<$Res>(_self.chargeInfo!, (value) { - return _then(_self.copyWith(chargeInfo: value)); - }); -} +AppInfo _$AppInfoFromJson(Map json) { + return _AppInfo.fromJson(json); } - /// @nodoc mixin _$AppInfo { - - String get packageName; List get fingerprint; int get versionCode; bool get canRemove; String get appName; -/// Create a copy of AppInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AppInfoCopyWith get copyWith => _$AppInfoCopyWithImpl(this as AppInfo, _$identity); + String get packageName => throw _privateConstructorUsedError; + List get fingerprint => throw _privateConstructorUsedError; + int get versionCode => throw _privateConstructorUsedError; + bool get canRemove => throw _privateConstructorUsedError; + String get appName => throw _privateConstructorUsedError; /// Serializes this AppInfo to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AppInfo&&(identical(other.packageName, packageName) || other.packageName == packageName)&&const DeepCollectionEquality().equals(other.fingerprint, fingerprint)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.canRemove, canRemove) || other.canRemove == canRemove)&&(identical(other.appName, appName) || other.appName == appName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,packageName,const DeepCollectionEquality().hash(fingerprint),versionCode,canRemove,appName); - -@override -String toString() { - return 'AppInfo(packageName: $packageName, fingerprint: $fingerprint, versionCode: $versionCode, canRemove: $canRemove, appName: $appName)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AppInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AppInfoCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AppInfoCopyWith<$Res> { - factory $AppInfoCopyWith(AppInfo value, $Res Function(AppInfo) _then) = _$AppInfoCopyWithImpl; -@useResult -$Res call({ - String packageName, List fingerprint, int versionCode, bool canRemove, String appName -}); - - - - +abstract class $AppInfoCopyWith<$Res> { + factory $AppInfoCopyWith(AppInfo value, $Res Function(AppInfo) then) = + _$AppInfoCopyWithImpl<$Res, AppInfo>; + @useResult + $Res call({ + String packageName, + List fingerprint, + int versionCode, + bool canRemove, + String appName, + }); } + /// @nodoc -class _$AppInfoCopyWithImpl<$Res> +class _$AppInfoCopyWithImpl<$Res, $Val extends AppInfo> implements $AppInfoCopyWith<$Res> { - _$AppInfoCopyWithImpl(this._self, this._then); - - final AppInfo _self; - final $Res Function(AppInfo) _then; - -/// Create a copy of AppInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? packageName = null,Object? fingerprint = null,Object? versionCode = null,Object? canRemove = null,Object? appName = null,}) { - return _then(AppInfo( -packageName: null == packageName ? _self.packageName : packageName // ignore: cast_nullable_to_non_nullable -as String,fingerprint: null == fingerprint ? _self.fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable -as List,versionCode: null == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int,canRemove: null == canRemove ? _self.canRemove : canRemove // ignore: cast_nullable_to_non_nullable -as bool,appName: null == appName ? _self.appName : appName // ignore: cast_nullable_to_non_nullable -as String, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AppInfo]. -extension AppInfoPatterns on AppInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AppInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AppInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AppInfo value) $default,){ -final _that = this; -switch (_that) { -case _AppInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AppInfo value)? $default,){ -final _that = this; -switch (_that) { -case _AppInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String packageName, List fingerprint, int versionCode, bool canRemove, String appName)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AppInfo() when $default != null: -return $default(_that.packageName,_that.fingerprint,_that.versionCode,_that.canRemove,_that.appName);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String packageName, List fingerprint, int versionCode, bool canRemove, String appName) $default,) {final _that = this; -switch (_that) { -case _AppInfo(): -return $default(_that.packageName,_that.fingerprint,_that.versionCode,_that.canRemove,_that.appName);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String packageName, List fingerprint, int versionCode, bool canRemove, String appName)? $default,) {final _that = this; -switch (_that) { -case _AppInfo() when $default != null: -return $default(_that.packageName,_that.fingerprint,_that.versionCode,_that.canRemove,_that.appName);case _: - return null; - -} -} - + _$AppInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AppInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? packageName = null, + Object? fingerprint = null, + Object? versionCode = null, + Object? canRemove = null, + Object? appName = null, + }) { + return _then( + _value.copyWith( + packageName: null == packageName + ? _value.packageName + : packageName // ignore: cast_nullable_to_non_nullable + as String, + fingerprint: null == fingerprint + ? _value.fingerprint + : fingerprint // ignore: cast_nullable_to_non_nullable + as List, + versionCode: null == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int, + canRemove: null == canRemove + ? _value.canRemove + : canRemove // ignore: cast_nullable_to_non_nullable + as bool, + appName: null == appName + ? _value.appName + : appName // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AppInfo implements AppInfo { - const _AppInfo({required this.packageName, List fingerprint = const [], this.versionCode = 0, this.canRemove = false, required this.appName}): _fingerprint = fingerprint; - factory _AppInfo.fromJson(Map json) => _$AppInfoFromJson(json); - -@override final String packageName; - final List _fingerprint; -@override@JsonKey() List get fingerprint { - if (_fingerprint is EqualUnmodifiableListView) return _fingerprint; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_fingerprint); -} - -@override@JsonKey() final int versionCode; -@override@JsonKey() final bool canRemove; -@override final String appName; - -/// Create a copy of AppInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AppInfoCopyWith<_AppInfo> get copyWith => __$AppInfoCopyWithImpl<_AppInfo>(this, _$identity); - -@override -Map toJson() { - return _$AppInfoToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppInfo&&(identical(other.packageName, packageName) || other.packageName == packageName)&&const DeepCollectionEquality().equals(other._fingerprint, _fingerprint)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.canRemove, canRemove) || other.canRemove == canRemove)&&(identical(other.appName, appName) || other.appName == appName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,packageName,const DeepCollectionEquality().hash(_fingerprint),versionCode,canRemove,appName); - -@override -String toString() { - return 'AppInfo(packageName: $packageName, fingerprint: $fingerprint, versionCode: $versionCode, canRemove: $canRemove, appName: $appName)'; +abstract class _$$AppInfoImplCopyWith<$Res> implements $AppInfoCopyWith<$Res> { + factory _$$AppInfoImplCopyWith( + _$AppInfoImpl value, + $Res Function(_$AppInfoImpl) then, + ) = __$$AppInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String packageName, + List fingerprint, + int versionCode, + bool canRemove, + String appName, + }); } - +/// @nodoc +class __$$AppInfoImplCopyWithImpl<$Res> + extends _$AppInfoCopyWithImpl<$Res, _$AppInfoImpl> + implements _$$AppInfoImplCopyWith<$Res> { + __$$AppInfoImplCopyWithImpl( + _$AppInfoImpl _value, + $Res Function(_$AppInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AppInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? packageName = null, + Object? fingerprint = null, + Object? versionCode = null, + Object? canRemove = null, + Object? appName = null, + }) { + return _then( + _$AppInfoImpl( + packageName: null == packageName + ? _value.packageName + : packageName // ignore: cast_nullable_to_non_nullable + as String, + fingerprint: null == fingerprint + ? _value._fingerprint + : fingerprint // ignore: cast_nullable_to_non_nullable + as List, + versionCode: null == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int, + canRemove: null == canRemove + ? _value.canRemove + : canRemove // ignore: cast_nullable_to_non_nullable + as bool, + appName: null == appName + ? _value.appName + : appName // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } } /// @nodoc -abstract mixin class _$AppInfoCopyWith<$Res> implements $AppInfoCopyWith<$Res> { - factory _$AppInfoCopyWith(_AppInfo value, $Res Function(_AppInfo) _then) = __$AppInfoCopyWithImpl; -@override @useResult -$Res call({ - String packageName, List fingerprint, int versionCode, bool canRemove, String appName -}); - +@JsonSerializable() +class _$AppInfoImpl implements _AppInfo { + const _$AppInfoImpl({ + required this.packageName, + final List fingerprint = const [], + this.versionCode = 0, + this.canRemove = false, + required this.appName, + }) : _fingerprint = fingerprint; + + factory _$AppInfoImpl.fromJson(Map json) => + _$$AppInfoImplFromJson(json); + + @override + final String packageName; + final List _fingerprint; + @override + @JsonKey() + List get fingerprint { + if (_fingerprint is EqualUnmodifiableListView) return _fingerprint; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_fingerprint); + } + @override + @JsonKey() + final int versionCode; + @override + @JsonKey() + final bool canRemove; + @override + final String appName; + + @override + String toString() { + return 'AppInfo(packageName: $packageName, fingerprint: $fingerprint, versionCode: $versionCode, canRemove: $canRemove, appName: $appName)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AppInfoImpl && + (identical(other.packageName, packageName) || + other.packageName == packageName) && + const DeepCollectionEquality().equals( + other._fingerprint, + _fingerprint, + ) && + (identical(other.versionCode, versionCode) || + other.versionCode == versionCode) && + (identical(other.canRemove, canRemove) || + other.canRemove == canRemove) && + (identical(other.appName, appName) || other.appName == appName)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + packageName, + const DeepCollectionEquality().hash(_fingerprint), + versionCode, + canRemove, + appName, + ); + + /// Create a copy of AppInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AppInfoImplCopyWith<_$AppInfoImpl> get copyWith => + __$$AppInfoImplCopyWithImpl<_$AppInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$AppInfoImplToJson(this); + } } -/// @nodoc -class __$AppInfoCopyWithImpl<$Res> - implements _$AppInfoCopyWith<$Res> { - __$AppInfoCopyWithImpl(this._self, this._then); - final _AppInfo _self; - final $Res Function(_AppInfo) _then; +abstract class _AppInfo implements AppInfo { + const factory _AppInfo({ + required final String packageName, + final List fingerprint, + final int versionCode, + final bool canRemove, + required final String appName, + }) = _$AppInfoImpl; -/// Create a copy of AppInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? packageName = null,Object? fingerprint = null,Object? versionCode = null,Object? canRemove = null,Object? appName = null,}) { - return _then(_AppInfo( -packageName: null == packageName ? _self.packageName : packageName // ignore: cast_nullable_to_non_nullable -as String,fingerprint: null == fingerprint ? _self._fingerprint : fingerprint // ignore: cast_nullable_to_non_nullable -as List,versionCode: null == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int,canRemove: null == canRemove ? _self.canRemove : canRemove // ignore: cast_nullable_to_non_nullable -as bool,appName: null == appName ? _self.appName : appName // ignore: cast_nullable_to_non_nullable -as String, - )); -} + factory _AppInfo.fromJson(Map json) = _$AppInfoImpl.fromJson; + @override + String get packageName; + @override + List get fingerprint; + @override + int get versionCode; + @override + bool get canRemove; + @override + String get appName; + /// Create a copy of AppInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AppInfoImplCopyWith<_$AppInfoImpl> get copyWith => + throw _privateConstructorUsedError; } +StorageInfo _$StorageInfoFromJson(Map json) { + return _StorageInfo.fromJson(json); +} /// @nodoc mixin _$StorageInfo { - - int get used; int get total; -/// Create a copy of StorageInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$StorageInfoCopyWith get copyWith => _$StorageInfoCopyWithImpl(this as StorageInfo, _$identity); + int get used => throw _privateConstructorUsedError; + int get total => throw _privateConstructorUsedError; /// Serializes this StorageInfo to a JSON map. - Map toJson(); - + Map toJson() => throw _privateConstructorUsedError; -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is StorageInfo&&(identical(other.used, used) || other.used == used)&&(identical(other.total, total) || other.total == total)); + /// Create a copy of StorageInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $StorageInfoCopyWith get copyWith => + throw _privateConstructorUsedError; } -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,used,total); - -@override -String toString() { - return 'StorageInfo(used: $used, total: $total)'; -} - - +/// @nodoc +abstract class $StorageInfoCopyWith<$Res> { + factory $StorageInfoCopyWith( + StorageInfo value, + $Res Function(StorageInfo) then, + ) = _$StorageInfoCopyWithImpl<$Res, StorageInfo>; + @useResult + $Res call({int used, int total}); } /// @nodoc -abstract mixin class $StorageInfoCopyWith<$Res> { - factory $StorageInfoCopyWith(StorageInfo value, $Res Function(StorageInfo) _then) = _$StorageInfoCopyWithImpl; -@useResult -$Res call({ - int used, int total -}); - - - - +class _$StorageInfoCopyWithImpl<$Res, $Val extends StorageInfo> + implements $StorageInfoCopyWith<$Res> { + _$StorageInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of StorageInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? used = null, Object? total = null}) { + return _then( + _value.copyWith( + used: null == used + ? _value.used + : used // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } } + /// @nodoc -class _$StorageInfoCopyWithImpl<$Res> +abstract class _$$StorageInfoImplCopyWith<$Res> implements $StorageInfoCopyWith<$Res> { - _$StorageInfoCopyWithImpl(this._self, this._then); - - final StorageInfo _self; - final $Res Function(StorageInfo) _then; - -/// Create a copy of StorageInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? used = null,Object? total = null,}) { - return _then(StorageInfo( -used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable -as int,total: null == total ? _self.total : total // ignore: cast_nullable_to_non_nullable -as int, - )); -} - -} - - -/// Adds pattern-matching-related methods to [StorageInfo]. -extension StorageInfoPatterns on StorageInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _StorageInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _StorageInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _StorageInfo value) $default,){ -final _that = this; -switch (_that) { -case _StorageInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _StorageInfo value)? $default,){ -final _that = this; -switch (_that) { -case _StorageInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int used, int total)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _StorageInfo() when $default != null: -return $default(_that.used,_that.total);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int used, int total) $default,) {final _that = this; -switch (_that) { -case _StorageInfo(): -return $default(_that.used,_that.total);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int used, int total)? $default,) {final _that = this; -switch (_that) { -case _StorageInfo() when $default != null: -return $default(_that.used,_that.total);case _: - return null; - -} + factory _$$StorageInfoImplCopyWith( + _$StorageInfoImpl value, + $Res Function(_$StorageInfoImpl) then, + ) = __$$StorageInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int used, int total}); } +/// @nodoc +class __$$StorageInfoImplCopyWithImpl<$Res> + extends _$StorageInfoCopyWithImpl<$Res, _$StorageInfoImpl> + implements _$$StorageInfoImplCopyWith<$Res> { + __$$StorageInfoImplCopyWithImpl( + _$StorageInfoImpl _value, + $Res Function(_$StorageInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of StorageInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? used = null, Object? total = null}) { + return _then( + _$StorageInfoImpl( + used: null == used + ? _value.used + : used // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$StorageInfoImpl implements _StorageInfo { + const _$StorageInfoImpl({required this.used, required this.total}); -class _StorageInfo implements StorageInfo { - const _StorageInfo({required this.used, required this.total}); - factory _StorageInfo.fromJson(Map json) => _$StorageInfoFromJson(json); + factory _$StorageInfoImpl.fromJson(Map json) => + _$$StorageInfoImplFromJson(json); -@override final int used; -@override final int total; - -/// Create a copy of StorageInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$StorageInfoCopyWith<_StorageInfo> get copyWith => __$StorageInfoCopyWithImpl<_StorageInfo>(this, _$identity); - -@override -Map toJson() { - return _$StorageInfoToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _StorageInfo&&(identical(other.used, used) || other.used == used)&&(identical(other.total, total) || other.total == total)); -} + @override + final int used; + @override + final int total; -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,used,total); - -@override -String toString() { - return 'StorageInfo(used: $used, total: $total)'; -} + @override + String toString() { + return 'StorageInfo(used: $used, total: $total)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$StorageInfoImpl && + (identical(other.used, used) || other.used == used) && + (identical(other.total, total) || other.total == total)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, used, total); + + /// Create a copy of StorageInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$StorageInfoImplCopyWith<_$StorageInfoImpl> get copyWith => + __$$StorageInfoImplCopyWithImpl<_$StorageInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$StorageInfoImplToJson(this); + } } -/// @nodoc -abstract mixin class _$StorageInfoCopyWith<$Res> implements $StorageInfoCopyWith<$Res> { - factory _$StorageInfoCopyWith(_StorageInfo value, $Res Function(_StorageInfo) _then) = __$StorageInfoCopyWithImpl; -@override @useResult -$Res call({ - int used, int total -}); - - +abstract class _StorageInfo implements StorageInfo { + const factory _StorageInfo({ + required final int used, + required final int total, + }) = _$StorageInfoImpl; + factory _StorageInfo.fromJson(Map json) = + _$StorageInfoImpl.fromJson; -} -/// @nodoc -class __$StorageInfoCopyWithImpl<$Res> - implements _$StorageInfoCopyWith<$Res> { - __$StorageInfoCopyWithImpl(this._self, this._then); - - final _StorageInfo _self; - final $Res Function(_StorageInfo) _then; + @override + int get used; + @override + int get total; -/// Create a copy of StorageInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? used = null,Object? total = null,}) { - return _then(_StorageInfo( -used: null == used ? _self.used : used // ignore: cast_nullable_to_non_nullable -as int,total: null == total ? _self.total : total // ignore: cast_nullable_to_non_nullable -as int, - )); + /// Create a copy of StorageInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$StorageInfoImplCopyWith<_$StorageInfoImpl> get copyWith => + throw _privateConstructorUsedError; } - +SystemInfo _$SystemInfoFromJson(Map json) { + return _SystemInfo.fromJson(json); } - /// @nodoc mixin _$SystemInfo { - - String get serialNumber; String get firmwareVersion; String get imei; String get model; StorageInfo? get storageInfo; -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$SystemInfoCopyWith get copyWith => _$SystemInfoCopyWithImpl(this as SystemInfo, _$identity); + String get serialNumber => throw _privateConstructorUsedError; + String get firmwareVersion => throw _privateConstructorUsedError; + String get imei => throw _privateConstructorUsedError; + String get model => throw _privateConstructorUsedError; + StorageInfo? get storageInfo => throw _privateConstructorUsedError; /// Serializes this SystemInfo to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is SystemInfo&&(identical(other.serialNumber, serialNumber) || other.serialNumber == serialNumber)&&(identical(other.firmwareVersion, firmwareVersion) || other.firmwareVersion == firmwareVersion)&&(identical(other.imei, imei) || other.imei == imei)&&(identical(other.model, model) || other.model == model)&&(identical(other.storageInfo, storageInfo) || other.storageInfo == storageInfo)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,serialNumber,firmwareVersion,imei,model,storageInfo); - -@override -String toString() { - return 'SystemInfo(serialNumber: $serialNumber, firmwareVersion: $firmwareVersion, imei: $imei, model: $model, storageInfo: $storageInfo)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SystemInfoCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $SystemInfoCopyWith<$Res> { - factory $SystemInfoCopyWith(SystemInfo value, $Res Function(SystemInfo) _then) = _$SystemInfoCopyWithImpl; -@useResult -$Res call({ - String serialNumber, String firmwareVersion, String imei, String model, StorageInfo? storageInfo -}); - - -$StorageInfoCopyWith<$Res>? get storageInfo; +abstract class $SystemInfoCopyWith<$Res> { + factory $SystemInfoCopyWith( + SystemInfo value, + $Res Function(SystemInfo) then, + ) = _$SystemInfoCopyWithImpl<$Res, SystemInfo>; + @useResult + $Res call({ + String serialNumber, + String firmwareVersion, + String imei, + String model, + StorageInfo? storageInfo, + }); + $StorageInfoCopyWith<$Res>? get storageInfo; } + /// @nodoc -class _$SystemInfoCopyWithImpl<$Res> +class _$SystemInfoCopyWithImpl<$Res, $Val extends SystemInfo> implements $SystemInfoCopyWith<$Res> { - _$SystemInfoCopyWithImpl(this._self, this._then); - - final SystemInfo _self; - final $Res Function(SystemInfo) _then; - -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? serialNumber = null,Object? firmwareVersion = null,Object? imei = null,Object? model = null,Object? storageInfo = freezed,}) { - return _then(SystemInfo( -serialNumber: null == serialNumber ? _self.serialNumber : serialNumber // ignore: cast_nullable_to_non_nullable -as String,firmwareVersion: null == firmwareVersion ? _self.firmwareVersion : firmwareVersion // ignore: cast_nullable_to_non_nullable -as String,imei: null == imei ? _self.imei : imei // ignore: cast_nullable_to_non_nullable -as String,model: null == model ? _self.model : model // ignore: cast_nullable_to_non_nullable -as String,storageInfo: freezed == storageInfo ? _self.storageInfo : storageInfo // ignore: cast_nullable_to_non_nullable -as StorageInfo?, - )); -} -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$StorageInfoCopyWith<$Res>? get storageInfo { - if (_self.storageInfo == null) { - return null; + _$SystemInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? serialNumber = null, + Object? firmwareVersion = null, + Object? imei = null, + Object? model = null, + Object? storageInfo = freezed, + }) { + return _then( + _value.copyWith( + serialNumber: null == serialNumber + ? _value.serialNumber + : serialNumber // ignore: cast_nullable_to_non_nullable + as String, + firmwareVersion: null == firmwareVersion + ? _value.firmwareVersion + : firmwareVersion // ignore: cast_nullable_to_non_nullable + as String, + imei: null == imei + ? _value.imei + : imei // ignore: cast_nullable_to_non_nullable + as String, + model: null == model + ? _value.model + : model // ignore: cast_nullable_to_non_nullable + as String, + storageInfo: freezed == storageInfo + ? _value.storageInfo + : storageInfo // ignore: cast_nullable_to_non_nullable + as StorageInfo?, + ) + as $Val, + ); } - return $StorageInfoCopyWith<$Res>(_self.storageInfo!, (value) { - return _then(_self.copyWith(storageInfo: value)); - }); -} + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $StorageInfoCopyWith<$Res>? get storageInfo { + if (_value.storageInfo == null) { + return null; + } + + return $StorageInfoCopyWith<$Res>(_value.storageInfo!, (value) { + return _then(_value.copyWith(storageInfo: value) as $Val); + }); + } } +/// @nodoc +abstract class _$$SystemInfoImplCopyWith<$Res> + implements $SystemInfoCopyWith<$Res> { + factory _$$SystemInfoImplCopyWith( + _$SystemInfoImpl value, + $Res Function(_$SystemInfoImpl) then, + ) = __$$SystemInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String serialNumber, + String firmwareVersion, + String imei, + String model, + StorageInfo? storageInfo, + }); -/// Adds pattern-matching-related methods to [SystemInfo]. -extension SystemInfoPatterns on SystemInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _SystemInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _SystemInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _SystemInfo value) $default,){ -final _that = this; -switch (_that) { -case _SystemInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SystemInfo value)? $default,){ -final _that = this; -switch (_that) { -case _SystemInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String serialNumber, String firmwareVersion, String imei, String model, StorageInfo? storageInfo)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _SystemInfo() when $default != null: -return $default(_that.serialNumber,_that.firmwareVersion,_that.imei,_that.model,_that.storageInfo);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String serialNumber, String firmwareVersion, String imei, String model, StorageInfo? storageInfo) $default,) {final _that = this; -switch (_that) { -case _SystemInfo(): -return $default(_that.serialNumber,_that.firmwareVersion,_that.imei,_that.model,_that.storageInfo);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String serialNumber, String firmwareVersion, String imei, String model, StorageInfo? storageInfo)? $default,) {final _that = this; -switch (_that) { -case _SystemInfo() when $default != null: -return $default(_that.serialNumber,_that.firmwareVersion,_that.imei,_that.model,_that.storageInfo);case _: - return null; - -} + @override + $StorageInfoCopyWith<$Res>? get storageInfo; } +/// @nodoc +class __$$SystemInfoImplCopyWithImpl<$Res> + extends _$SystemInfoCopyWithImpl<$Res, _$SystemInfoImpl> + implements _$$SystemInfoImplCopyWith<$Res> { + __$$SystemInfoImplCopyWithImpl( + _$SystemInfoImpl _value, + $Res Function(_$SystemInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? serialNumber = null, + Object? firmwareVersion = null, + Object? imei = null, + Object? model = null, + Object? storageInfo = freezed, + }) { + return _then( + _$SystemInfoImpl( + serialNumber: null == serialNumber + ? _value.serialNumber + : serialNumber // ignore: cast_nullable_to_non_nullable + as String, + firmwareVersion: null == firmwareVersion + ? _value.firmwareVersion + : firmwareVersion // ignore: cast_nullable_to_non_nullable + as String, + imei: null == imei + ? _value.imei + : imei // ignore: cast_nullable_to_non_nullable + as String, + model: null == model + ? _value.model + : model // ignore: cast_nullable_to_non_nullable + as String, + storageInfo: freezed == storageInfo + ? _value.storageInfo + : storageInfo // ignore: cast_nullable_to_non_nullable + as StorageInfo?, + ), + ); + } } /// @nodoc @JsonSerializable() +class _$SystemInfoImpl implements _SystemInfo { + const _$SystemInfoImpl({ + required this.serialNumber, + required this.firmwareVersion, + required this.imei, + required this.model, + this.storageInfo, + }); -class _SystemInfo implements SystemInfo { - const _SystemInfo({required this.serialNumber, required this.firmwareVersion, required this.imei, required this.model, this.storageInfo}); - factory _SystemInfo.fromJson(Map json) => _$SystemInfoFromJson(json); - -@override final String serialNumber; -@override final String firmwareVersion; -@override final String imei; -@override final String model; -@override final StorageInfo? storageInfo; - -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$SystemInfoCopyWith<_SystemInfo> get copyWith => __$SystemInfoCopyWithImpl<_SystemInfo>(this, _$identity); - -@override -Map toJson() { - return _$SystemInfoToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _SystemInfo&&(identical(other.serialNumber, serialNumber) || other.serialNumber == serialNumber)&&(identical(other.firmwareVersion, firmwareVersion) || other.firmwareVersion == firmwareVersion)&&(identical(other.imei, imei) || other.imei == imei)&&(identical(other.model, model) || other.model == model)&&(identical(other.storageInfo, storageInfo) || other.storageInfo == storageInfo)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,serialNumber,firmwareVersion,imei,model,storageInfo); - -@override -String toString() { - return 'SystemInfo(serialNumber: $serialNumber, firmwareVersion: $firmwareVersion, imei: $imei, model: $model, storageInfo: $storageInfo)'; -} + factory _$SystemInfoImpl.fromJson(Map json) => + _$$SystemInfoImplFromJson(json); + + @override + final String serialNumber; + @override + final String firmwareVersion; + @override + final String imei; + @override + final String model; + @override + final StorageInfo? storageInfo; + + @override + String toString() { + return 'SystemInfo(serialNumber: $serialNumber, firmwareVersion: $firmwareVersion, imei: $imei, model: $model, storageInfo: $storageInfo)'; + } + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SystemInfoImpl && + (identical(other.serialNumber, serialNumber) || + other.serialNumber == serialNumber) && + (identical(other.firmwareVersion, firmwareVersion) || + other.firmwareVersion == firmwareVersion) && + (identical(other.imei, imei) || other.imei == imei) && + (identical(other.model, model) || other.model == model) && + (identical(other.storageInfo, storageInfo) || + other.storageInfo == storageInfo)); + } + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + serialNumber, + firmwareVersion, + imei, + model, + storageInfo, + ); + + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SystemInfoImplCopyWith<_$SystemInfoImpl> get copyWith => + __$$SystemInfoImplCopyWithImpl<_$SystemInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$SystemInfoImplToJson(this); + } } -/// @nodoc -abstract mixin class _$SystemInfoCopyWith<$Res> implements $SystemInfoCopyWith<$Res> { - factory _$SystemInfoCopyWith(_SystemInfo value, $Res Function(_SystemInfo) _then) = __$SystemInfoCopyWithImpl; -@override @useResult -$Res call({ - String serialNumber, String firmwareVersion, String imei, String model, StorageInfo? storageInfo -}); +abstract class _SystemInfo implements SystemInfo { + const factory _SystemInfo({ + required final String serialNumber, + required final String firmwareVersion, + required final String imei, + required final String model, + final StorageInfo? storageInfo, + }) = _$SystemInfoImpl; + factory _SystemInfo.fromJson(Map json) = + _$SystemInfoImpl.fromJson; -@override $StorageInfoCopyWith<$Res>? get storageInfo; + @override + String get serialNumber; + @override + String get firmwareVersion; + @override + String get imei; + @override + String get model; + @override + StorageInfo? get storageInfo; + /// Create a copy of SystemInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SystemInfoImplCopyWith<_$SystemInfoImpl> get copyWith => + throw _privateConstructorUsedError; } -/// @nodoc -class __$SystemInfoCopyWithImpl<$Res> - implements _$SystemInfoCopyWith<$Res> { - __$SystemInfoCopyWithImpl(this._self, this._then); - - final _SystemInfo _self; - final $Res Function(_SystemInfo) _then; - -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? serialNumber = null,Object? firmwareVersion = null,Object? imei = null,Object? model = null,Object? storageInfo = freezed,}) { - return _then(_SystemInfo( -serialNumber: null == serialNumber ? _self.serialNumber : serialNumber // ignore: cast_nullable_to_non_nullable -as String,firmwareVersion: null == firmwareVersion ? _self.firmwareVersion : firmwareVersion // ignore: cast_nullable_to_non_nullable -as String,imei: null == imei ? _self.imei : imei // ignore: cast_nullable_to_non_nullable -as String,model: null == model ? _self.model : model // ignore: cast_nullable_to_non_nullable -as String,storageInfo: freezed == storageInfo ? _self.storageInfo : storageInfo // ignore: cast_nullable_to_non_nullable -as StorageInfo?, - )); -} - -/// Create a copy of SystemInfo -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$StorageInfoCopyWith<$Res>? get storageInfo { - if (_self.storageInfo == null) { - return null; - } - return $StorageInfoCopyWith<$Res>(_self.storageInfo!, (value) { - return _then(_self.copyWith(storageInfo: value)); - }); -} +WatchfaceInfo _$WatchfaceInfoFromJson(Map json) { + return _WatchfaceInfo.fromJson(json); } - /// @nodoc mixin _$WatchfaceInfo { - - String get id; String get name; bool get isCurrent; bool get canRemove; int get versionCode; bool get canEdit; String get backgroundColor; String get backgroundImage; String get style; List get backgroundImageList; -/// Create a copy of WatchfaceInfo -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$WatchfaceInfoCopyWith get copyWith => _$WatchfaceInfoCopyWithImpl(this as WatchfaceInfo, _$identity); + String get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + bool get isCurrent => throw _privateConstructorUsedError; + bool get canRemove => throw _privateConstructorUsedError; + int get versionCode => throw _privateConstructorUsedError; + bool get canEdit => throw _privateConstructorUsedError; + String get backgroundColor => throw _privateConstructorUsedError; + String get backgroundImage => throw _privateConstructorUsedError; + String get style => throw _privateConstructorUsedError; + List get backgroundImageList => throw _privateConstructorUsedError; /// Serializes this WatchfaceInfo to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is WatchfaceInfo&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent)&&(identical(other.canRemove, canRemove) || other.canRemove == canRemove)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.canEdit, canEdit) || other.canEdit == canEdit)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.backgroundImage, backgroundImage) || other.backgroundImage == backgroundImage)&&(identical(other.style, style) || other.style == style)&&const DeepCollectionEquality().equals(other.backgroundImageList, backgroundImageList)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,isCurrent,canRemove,versionCode,canEdit,backgroundColor,backgroundImage,style,const DeepCollectionEquality().hash(backgroundImageList)); - -@override -String toString() { - return 'WatchfaceInfo(id: $id, name: $name, isCurrent: $isCurrent, canRemove: $canRemove, versionCode: $versionCode, canEdit: $canEdit, backgroundColor: $backgroundColor, backgroundImage: $backgroundImage, style: $style, backgroundImageList: $backgroundImageList)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of WatchfaceInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $WatchfaceInfoCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $WatchfaceInfoCopyWith<$Res> { - factory $WatchfaceInfoCopyWith(WatchfaceInfo value, $Res Function(WatchfaceInfo) _then) = _$WatchfaceInfoCopyWithImpl; -@useResult -$Res call({ - String id, String name, bool isCurrent, bool canRemove, int versionCode, bool canEdit, String backgroundColor, String backgroundImage, String style, List backgroundImageList -}); - - - - +abstract class $WatchfaceInfoCopyWith<$Res> { + factory $WatchfaceInfoCopyWith( + WatchfaceInfo value, + $Res Function(WatchfaceInfo) then, + ) = _$WatchfaceInfoCopyWithImpl<$Res, WatchfaceInfo>; + @useResult + $Res call({ + String id, + String name, + bool isCurrent, + bool canRemove, + int versionCode, + bool canEdit, + String backgroundColor, + String backgroundImage, + String style, + List backgroundImageList, + }); } + /// @nodoc -class _$WatchfaceInfoCopyWithImpl<$Res> +class _$WatchfaceInfoCopyWithImpl<$Res, $Val extends WatchfaceInfo> implements $WatchfaceInfoCopyWith<$Res> { - _$WatchfaceInfoCopyWithImpl(this._self, this._then); - - final WatchfaceInfo _self; - final $Res Function(WatchfaceInfo) _then; - -/// Create a copy of WatchfaceInfo -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? isCurrent = null,Object? canRemove = null,Object? versionCode = null,Object? canEdit = null,Object? backgroundColor = null,Object? backgroundImage = null,Object? style = null,Object? backgroundImageList = null,}) { - return _then(WatchfaceInfo( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable -as bool,canRemove: null == canRemove ? _self.canRemove : canRemove // ignore: cast_nullable_to_non_nullable -as bool,versionCode: null == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int,canEdit: null == canEdit ? _self.canEdit : canEdit // ignore: cast_nullable_to_non_nullable -as bool,backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable -as String,backgroundImage: null == backgroundImage ? _self.backgroundImage : backgroundImage // ignore: cast_nullable_to_non_nullable -as String,style: null == style ? _self.style : style // ignore: cast_nullable_to_non_nullable -as String,backgroundImageList: null == backgroundImageList ? _self.backgroundImageList : backgroundImageList // ignore: cast_nullable_to_non_nullable -as List, - )); -} - -} - - -/// Adds pattern-matching-related methods to [WatchfaceInfo]. -extension WatchfaceInfoPatterns on WatchfaceInfo { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _WatchfaceInfo value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _WatchfaceInfo() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _WatchfaceInfo value) $default,){ -final _that = this; -switch (_that) { -case _WatchfaceInfo(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _WatchfaceInfo value)? $default,){ -final _that = this; -switch (_that) { -case _WatchfaceInfo() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String name, bool isCurrent, bool canRemove, int versionCode, bool canEdit, String backgroundColor, String backgroundImage, String style, List backgroundImageList)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _WatchfaceInfo() when $default != null: -return $default(_that.id,_that.name,_that.isCurrent,_that.canRemove,_that.versionCode,_that.canEdit,_that.backgroundColor,_that.backgroundImage,_that.style,_that.backgroundImageList);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String id, String name, bool isCurrent, bool canRemove, int versionCode, bool canEdit, String backgroundColor, String backgroundImage, String style, List backgroundImageList) $default,) {final _that = this; -switch (_that) { -case _WatchfaceInfo(): -return $default(_that.id,_that.name,_that.isCurrent,_that.canRemove,_that.versionCode,_that.canEdit,_that.backgroundColor,_that.backgroundImage,_that.style,_that.backgroundImageList);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String name, bool isCurrent, bool canRemove, int versionCode, bool canEdit, String backgroundColor, String backgroundImage, String style, List backgroundImageList)? $default,) {final _that = this; -switch (_that) { -case _WatchfaceInfo() when $default != null: -return $default(_that.id,_that.name,_that.isCurrent,_that.canRemove,_that.versionCode,_that.canEdit,_that.backgroundColor,_that.backgroundImage,_that.style,_that.backgroundImageList);case _: - return null; - -} -} - + _$WatchfaceInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of WatchfaceInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? isCurrent = null, + Object? canRemove = null, + Object? versionCode = null, + Object? canEdit = null, + Object? backgroundColor = null, + Object? backgroundImage = null, + Object? style = null, + Object? backgroundImageList = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + isCurrent: null == isCurrent + ? _value.isCurrent + : isCurrent // ignore: cast_nullable_to_non_nullable + as bool, + canRemove: null == canRemove + ? _value.canRemove + : canRemove // ignore: cast_nullable_to_non_nullable + as bool, + versionCode: null == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int, + canEdit: null == canEdit + ? _value.canEdit + : canEdit // ignore: cast_nullable_to_non_nullable + as bool, + backgroundColor: null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as String, + backgroundImage: null == backgroundImage + ? _value.backgroundImage + : backgroundImage // ignore: cast_nullable_to_non_nullable + as String, + style: null == style + ? _value.style + : style // ignore: cast_nullable_to_non_nullable + as String, + backgroundImageList: null == backgroundImageList + ? _value.backgroundImageList + : backgroundImageList // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _WatchfaceInfo implements WatchfaceInfo { - const _WatchfaceInfo({required this.id, required this.name, this.isCurrent = false, this.canRemove = false, this.versionCode = 0, this.canEdit = false, this.backgroundColor = '', this.backgroundImage = '', this.style = '', List backgroundImageList = const []}): _backgroundImageList = backgroundImageList; - factory _WatchfaceInfo.fromJson(Map json) => _$WatchfaceInfoFromJson(json); - -@override final String id; -@override final String name; -@override@JsonKey() final bool isCurrent; -@override@JsonKey() final bool canRemove; -@override@JsonKey() final int versionCode; -@override@JsonKey() final bool canEdit; -@override@JsonKey() final String backgroundColor; -@override@JsonKey() final String backgroundImage; -@override@JsonKey() final String style; - final List _backgroundImageList; -@override@JsonKey() List get backgroundImageList { - if (_backgroundImageList is EqualUnmodifiableListView) return _backgroundImageList; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_backgroundImageList); -} - - -/// Create a copy of WatchfaceInfo -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$WatchfaceInfoCopyWith<_WatchfaceInfo> get copyWith => __$WatchfaceInfoCopyWithImpl<_WatchfaceInfo>(this, _$identity); - -@override -Map toJson() { - return _$WatchfaceInfoToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _WatchfaceInfo&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.isCurrent, isCurrent) || other.isCurrent == isCurrent)&&(identical(other.canRemove, canRemove) || other.canRemove == canRemove)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.canEdit, canEdit) || other.canEdit == canEdit)&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.backgroundImage, backgroundImage) || other.backgroundImage == backgroundImage)&&(identical(other.style, style) || other.style == style)&&const DeepCollectionEquality().equals(other._backgroundImageList, _backgroundImageList)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,isCurrent,canRemove,versionCode,canEdit,backgroundColor,backgroundImage,style,const DeepCollectionEquality().hash(_backgroundImageList)); - -@override -String toString() { - return 'WatchfaceInfo(id: $id, name: $name, isCurrent: $isCurrent, canRemove: $canRemove, versionCode: $versionCode, canEdit: $canEdit, backgroundColor: $backgroundColor, backgroundImage: $backgroundImage, style: $style, backgroundImageList: $backgroundImageList)'; +abstract class _$$WatchfaceInfoImplCopyWith<$Res> + implements $WatchfaceInfoCopyWith<$Res> { + factory _$$WatchfaceInfoImplCopyWith( + _$WatchfaceInfoImpl value, + $Res Function(_$WatchfaceInfoImpl) then, + ) = __$$WatchfaceInfoImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + String name, + bool isCurrent, + bool canRemove, + int versionCode, + bool canEdit, + String backgroundColor, + String backgroundImage, + String style, + List backgroundImageList, + }); } - +/// @nodoc +class __$$WatchfaceInfoImplCopyWithImpl<$Res> + extends _$WatchfaceInfoCopyWithImpl<$Res, _$WatchfaceInfoImpl> + implements _$$WatchfaceInfoImplCopyWith<$Res> { + __$$WatchfaceInfoImplCopyWithImpl( + _$WatchfaceInfoImpl _value, + $Res Function(_$WatchfaceInfoImpl) _then, + ) : super(_value, _then); + + /// Create a copy of WatchfaceInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? isCurrent = null, + Object? canRemove = null, + Object? versionCode = null, + Object? canEdit = null, + Object? backgroundColor = null, + Object? backgroundImage = null, + Object? style = null, + Object? backgroundImageList = null, + }) { + return _then( + _$WatchfaceInfoImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + isCurrent: null == isCurrent + ? _value.isCurrent + : isCurrent // ignore: cast_nullable_to_non_nullable + as bool, + canRemove: null == canRemove + ? _value.canRemove + : canRemove // ignore: cast_nullable_to_non_nullable + as bool, + versionCode: null == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int, + canEdit: null == canEdit + ? _value.canEdit + : canEdit // ignore: cast_nullable_to_non_nullable + as bool, + backgroundColor: null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as String, + backgroundImage: null == backgroundImage + ? _value.backgroundImage + : backgroundImage // ignore: cast_nullable_to_non_nullable + as String, + style: null == style + ? _value.style + : style // ignore: cast_nullable_to_non_nullable + as String, + backgroundImageList: null == backgroundImageList + ? _value._backgroundImageList + : backgroundImageList // ignore: cast_nullable_to_non_nullable + as List, + ), + ); + } } /// @nodoc -abstract mixin class _$WatchfaceInfoCopyWith<$Res> implements $WatchfaceInfoCopyWith<$Res> { - factory _$WatchfaceInfoCopyWith(_WatchfaceInfo value, $Res Function(_WatchfaceInfo) _then) = __$WatchfaceInfoCopyWithImpl; -@override @useResult -$Res call({ - String id, String name, bool isCurrent, bool canRemove, int versionCode, bool canEdit, String backgroundColor, String backgroundImage, String style, List backgroundImageList -}); - - - +@JsonSerializable() +class _$WatchfaceInfoImpl implements _WatchfaceInfo { + const _$WatchfaceInfoImpl({ + required this.id, + required this.name, + this.isCurrent = false, + this.canRemove = false, + this.versionCode = 0, + this.canEdit = false, + this.backgroundColor = '', + this.backgroundImage = '', + this.style = '', + final List backgroundImageList = const [], + }) : _backgroundImageList = backgroundImageList; + + factory _$WatchfaceInfoImpl.fromJson(Map json) => + _$$WatchfaceInfoImplFromJson(json); + + @override + final String id; + @override + final String name; + @override + @JsonKey() + final bool isCurrent; + @override + @JsonKey() + final bool canRemove; + @override + @JsonKey() + final int versionCode; + @override + @JsonKey() + final bool canEdit; + @override + @JsonKey() + final String backgroundColor; + @override + @JsonKey() + final String backgroundImage; + @override + @JsonKey() + final String style; + final List _backgroundImageList; + @override + @JsonKey() + List get backgroundImageList { + if (_backgroundImageList is EqualUnmodifiableListView) + return _backgroundImageList; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_backgroundImageList); + } -} -/// @nodoc -class __$WatchfaceInfoCopyWithImpl<$Res> - implements _$WatchfaceInfoCopyWith<$Res> { - __$WatchfaceInfoCopyWithImpl(this._self, this._then); + @override + String toString() { + return 'WatchfaceInfo(id: $id, name: $name, isCurrent: $isCurrent, canRemove: $canRemove, versionCode: $versionCode, canEdit: $canEdit, backgroundColor: $backgroundColor, backgroundImage: $backgroundImage, style: $style, backgroundImageList: $backgroundImageList)'; + } - final _WatchfaceInfo _self; - final $Res Function(_WatchfaceInfo) _then; + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$WatchfaceInfoImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.isCurrent, isCurrent) || + other.isCurrent == isCurrent) && + (identical(other.canRemove, canRemove) || + other.canRemove == canRemove) && + (identical(other.versionCode, versionCode) || + other.versionCode == versionCode) && + (identical(other.canEdit, canEdit) || other.canEdit == canEdit) && + (identical(other.backgroundColor, backgroundColor) || + other.backgroundColor == backgroundColor) && + (identical(other.backgroundImage, backgroundImage) || + other.backgroundImage == backgroundImage) && + (identical(other.style, style) || other.style == style) && + const DeepCollectionEquality().equals( + other._backgroundImageList, + _backgroundImageList, + )); + } -/// Create a copy of WatchfaceInfo -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? isCurrent = null,Object? canRemove = null,Object? versionCode = null,Object? canEdit = null,Object? backgroundColor = null,Object? backgroundImage = null,Object? style = null,Object? backgroundImageList = null,}) { - return _then(_WatchfaceInfo( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,isCurrent: null == isCurrent ? _self.isCurrent : isCurrent // ignore: cast_nullable_to_non_nullable -as bool,canRemove: null == canRemove ? _self.canRemove : canRemove // ignore: cast_nullable_to_non_nullable -as bool,versionCode: null == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int,canEdit: null == canEdit ? _self.canEdit : canEdit // ignore: cast_nullable_to_non_nullable -as bool,backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable -as String,backgroundImage: null == backgroundImage ? _self.backgroundImage : backgroundImage // ignore: cast_nullable_to_non_nullable -as String,style: null == style ? _self.style : style // ignore: cast_nullable_to_non_nullable -as String,backgroundImageList: null == backgroundImageList ? _self._backgroundImageList : backgroundImageList // ignore: cast_nullable_to_non_nullable -as List, - )); + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + isCurrent, + canRemove, + versionCode, + canEdit, + backgroundColor, + backgroundImage, + style, + const DeepCollectionEquality().hash(_backgroundImageList), + ); + + /// Create a copy of WatchfaceInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$WatchfaceInfoImplCopyWith<_$WatchfaceInfoImpl> get copyWith => + __$$WatchfaceInfoImplCopyWithImpl<_$WatchfaceInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$WatchfaceInfoImplToJson(this); + } } - +abstract class _WatchfaceInfo implements WatchfaceInfo { + const factory _WatchfaceInfo({ + required final String id, + required final String name, + final bool isCurrent, + final bool canRemove, + final int versionCode, + final bool canEdit, + final String backgroundColor, + final String backgroundImage, + final String style, + final List backgroundImageList, + }) = _$WatchfaceInfoImpl; + + factory _WatchfaceInfo.fromJson(Map json) = + _$WatchfaceInfoImpl.fromJson; + + @override + String get id; + @override + String get name; + @override + bool get isCurrent; + @override + bool get canRemove; + @override + int get versionCode; + @override + bool get canEdit; + @override + String get backgroundColor; + @override + String get backgroundImage; + @override + String get style; + @override + List get backgroundImageList; + + /// Create a copy of WatchfaceInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$WatchfaceInfoImplCopyWith<_$WatchfaceInfoImpl> get copyWith => + throw _privateConstructorUsedError; } - -// dart format on diff --git a/lib/src/core/models/bt_models.g.dart b/lib/src/core/models/bt_models.g.dart index c225bbd0..e064cd3d 100644 --- a/lib/src/core/models/bt_models.g.dart +++ b/lib/src/core/models/bt_models.g.dart @@ -6,30 +6,31 @@ part of 'bt_models.dart'; // JsonSerializableGenerator // ************************************************************************** -_BTDeviceInfo _$BTDeviceInfoFromJson(Map json) => - _BTDeviceInfo( +_$BTDeviceInfoImpl _$$BTDeviceInfoImplFromJson(Map json) => + _$BTDeviceInfoImpl( name: json['name'] as String, addr: json['addr'] as String, connectType: json['connectType'] as String, ); -Map _$BTDeviceInfoToJson(_BTDeviceInfo instance) => +Map _$$BTDeviceInfoImplToJson(_$BTDeviceInfoImpl instance) => { 'name': instance.name, 'addr': instance.addr, 'connectType': instance.connectType, }; -_MiWearState _$MiWearStateFromJson(Map json) => _MiWearState( - name: json['name'] as String, - addr: json['addr'] as String, - connectType: json['connectType'] as String, - authkey: json['authkey'] as String?, - codename: json['codename'] as String?, - disconnected: json['disconnected'] as bool? ?? false, -); +_$MiWearStateImpl _$$MiWearStateImplFromJson(Map json) => + _$MiWearStateImpl( + name: json['name'] as String, + addr: json['addr'] as String, + connectType: json['connectType'] as String, + authkey: json['authkey'] as String?, + codename: json['codename'] as String?, + disconnected: json['disconnected'] as bool? ?? false, + ); -Map _$MiWearStateToJson(_MiWearState instance) => +Map _$$MiWearStateImplToJson(_$MiWearStateImpl instance) => { 'name': instance.name, 'addr': instance.addr, @@ -39,16 +40,17 @@ Map _$MiWearStateToJson(_MiWearState instance) => 'disconnected': instance.disconnected, }; -_ChargeInfo _$ChargeInfoFromJson(Map json) => _ChargeInfo( - state: (json['state'] as num?)?.toInt() ?? 0, - timestamp: (json['timestamp'] as num?)?.toInt(), -); +_$ChargeInfoImpl _$$ChargeInfoImplFromJson(Map json) => + _$ChargeInfoImpl( + state: (json['state'] as num?)?.toInt() ?? 0, + timestamp: (json['timestamp'] as num?)?.toInt(), + ); -Map _$ChargeInfoToJson(_ChargeInfo instance) => +Map _$$ChargeInfoImplToJson(_$ChargeInfoImpl instance) => {'state': instance.state, 'timestamp': instance.timestamp}; -_BatteryStatus _$BatteryStatusFromJson(Map json) => - _BatteryStatus( +_$BatteryStatusImpl _$$BatteryStatusImplFromJson(Map json) => + _$BatteryStatusImpl( capacity: (json['capacity'] as num).toInt(), chargeStatus: $enumDecodeNullable(_$ChargeStatusEnumMap, json['chargeStatus']) ?? @@ -58,7 +60,7 @@ _BatteryStatus _$BatteryStatusFromJson(Map json) => : ChargeInfo.fromJson(json['chargeInfo'] as Map), ); -Map _$BatteryStatusToJson(_BatteryStatus instance) => +Map _$$BatteryStatusImplToJson(_$BatteryStatusImpl instance) => { 'capacity': instance.capacity, 'chargeStatus': _$ChargeStatusEnumMap[instance.chargeStatus]!, @@ -72,45 +74,49 @@ const _$ChargeStatusEnumMap = { ChargeStatus.full: 'full', }; -_AppInfo _$AppInfoFromJson(Map json) => _AppInfo( - packageName: json['packageName'] as String, - fingerprint: - (json['fingerprint'] as List?) - ?.map((e) => (e as num).toInt()) - .toList() ?? - const [], - versionCode: (json['versionCode'] as num?)?.toInt() ?? 0, - canRemove: json['canRemove'] as bool? ?? false, - appName: json['appName'] as String, -); - -Map _$AppInfoToJson(_AppInfo instance) => { - 'packageName': instance.packageName, - 'fingerprint': instance.fingerprint, - 'versionCode': instance.versionCode, - 'canRemove': instance.canRemove, - 'appName': instance.appName, -}; +_$AppInfoImpl _$$AppInfoImplFromJson(Map json) => + _$AppInfoImpl( + packageName: json['packageName'] as String, + fingerprint: + (json['fingerprint'] as List?) + ?.map((e) => (e as num).toInt()) + .toList() ?? + const [], + versionCode: (json['versionCode'] as num?)?.toInt() ?? 0, + canRemove: json['canRemove'] as bool? ?? false, + appName: json['appName'] as String, + ); -_StorageInfo _$StorageInfoFromJson(Map json) => _StorageInfo( - used: (json['used'] as num).toInt(), - total: (json['total'] as num).toInt(), -); +Map _$$AppInfoImplToJson(_$AppInfoImpl instance) => + { + 'packageName': instance.packageName, + 'fingerprint': instance.fingerprint, + 'versionCode': instance.versionCode, + 'canRemove': instance.canRemove, + 'appName': instance.appName, + }; -Map _$StorageInfoToJson(_StorageInfo instance) => +_$StorageInfoImpl _$$StorageInfoImplFromJson(Map json) => + _$StorageInfoImpl( + used: (json['used'] as num).toInt(), + total: (json['total'] as num).toInt(), + ); + +Map _$$StorageInfoImplToJson(_$StorageInfoImpl instance) => {'used': instance.used, 'total': instance.total}; -_SystemInfo _$SystemInfoFromJson(Map json) => _SystemInfo( - serialNumber: json['serialNumber'] as String, - firmwareVersion: json['firmwareVersion'] as String, - imei: json['imei'] as String, - model: json['model'] as String, - storageInfo: json['storageInfo'] == null - ? null - : StorageInfo.fromJson(json['storageInfo'] as Map), -); - -Map _$SystemInfoToJson(_SystemInfo instance) => +_$SystemInfoImpl _$$SystemInfoImplFromJson(Map json) => + _$SystemInfoImpl( + serialNumber: json['serialNumber'] as String, + firmwareVersion: json['firmwareVersion'] as String, + imei: json['imei'] as String, + model: json['model'] as String, + storageInfo: json['storageInfo'] == null + ? null + : StorageInfo.fromJson(json['storageInfo'] as Map), + ); + +Map _$$SystemInfoImplToJson(_$SystemInfoImpl instance) => { 'serialNumber': instance.serialNumber, 'firmwareVersion': instance.firmwareVersion, @@ -119,8 +125,8 @@ Map _$SystemInfoToJson(_SystemInfo instance) => 'storageInfo': instance.storageInfo, }; -_WatchfaceInfo _$WatchfaceInfoFromJson(Map json) => - _WatchfaceInfo( +_$WatchfaceInfoImpl _$$WatchfaceInfoImplFromJson(Map json) => + _$WatchfaceInfoImpl( id: json['id'] as String, name: json['name'] as String, isCurrent: json['isCurrent'] as bool? ?? false, @@ -137,7 +143,7 @@ _WatchfaceInfo _$WatchfaceInfoFromJson(Map json) => const [], ); -Map _$WatchfaceInfoToJson(_WatchfaceInfo instance) => +Map _$$WatchfaceInfoImplToJson(_$WatchfaceInfoImpl instance) => { 'id': instance.id, 'name': instance.name, diff --git a/lib/src/core/models/sync_models.freezed.dart b/lib/src/core/models/sync_models.freezed.dart index ff4a2eca..6a43d154 100644 --- a/lib/src/core/models/sync_models.freezed.dart +++ b/lib/src/core/models/sync_models.freezed.dart @@ -1,6 +1,6 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file -// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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, unnecessary_question_mark part of 'sync_models.dart'; @@ -9,1143 +9,873 @@ part of 'sync_models.dart'; // FreezedGenerator // ************************************************************************** -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off 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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +TimeSyncProps _$TimeSyncPropsFromJson(Map json) { + return _TimeSyncProps.fromJson(json); +} + /// @nodoc mixin _$TimeSyncProps { - - SyncDate get date; SyncTime get time; SyncTimeZone get timezone; bool get is12HourFormat; -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$TimeSyncPropsCopyWith get copyWith => _$TimeSyncPropsCopyWithImpl(this as TimeSyncProps, _$identity); + SyncDate get date => throw _privateConstructorUsedError; + SyncTime get time => throw _privateConstructorUsedError; + SyncTimeZone get timezone => throw _privateConstructorUsedError; + bool get is12HourFormat => throw _privateConstructorUsedError; /// Serializes this TimeSyncProps to a JSON map. - Map toJson(); - + Map toJson() => throw _privateConstructorUsedError; -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is TimeSyncProps&&(identical(other.date, date) || other.date == date)&&(identical(other.time, time) || other.time == time)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.is12HourFormat, is12HourFormat) || other.is12HourFormat == is12HourFormat)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,date,time,timezone,is12HourFormat); - -@override -String toString() { - return 'TimeSyncProps(date: $date, time: $time, timezone: $timezone, is12HourFormat: $is12HourFormat)'; + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $TimeSyncPropsCopyWith get copyWith => + throw _privateConstructorUsedError; } +/// @nodoc +abstract class $TimeSyncPropsCopyWith<$Res> { + factory $TimeSyncPropsCopyWith( + TimeSyncProps value, + $Res Function(TimeSyncProps) then, + ) = _$TimeSyncPropsCopyWithImpl<$Res, TimeSyncProps>; + @useResult + $Res call({ + SyncDate date, + SyncTime time, + SyncTimeZone timezone, + bool is12HourFormat, + }); + $SyncDateCopyWith<$Res> get date; + $SyncTimeCopyWith<$Res> get time; + $SyncTimeZoneCopyWith<$Res> get timezone; } /// @nodoc -abstract mixin class $TimeSyncPropsCopyWith<$Res> { - factory $TimeSyncPropsCopyWith(TimeSyncProps value, $Res Function(TimeSyncProps) _then) = _$TimeSyncPropsCopyWithImpl; -@useResult -$Res call({ - SyncDate date, SyncTime time, SyncTimeZone timezone, bool is12HourFormat -}); - - -$SyncDateCopyWith<$Res> get date;$SyncTimeCopyWith<$Res> get time;$SyncTimeZoneCopyWith<$Res> get timezone; - +class _$TimeSyncPropsCopyWithImpl<$Res, $Val extends TimeSyncProps> + implements $TimeSyncPropsCopyWith<$Res> { + _$TimeSyncPropsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? time = null, + Object? timezone = null, + Object? is12HourFormat = null, + }) { + return _then( + _value.copyWith( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as SyncDate, + time: null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as SyncTime, + timezone: null == timezone + ? _value.timezone + : timezone // ignore: cast_nullable_to_non_nullable + as SyncTimeZone, + is12HourFormat: null == is12HourFormat + ? _value.is12HourFormat + : is12HourFormat // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); + } + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SyncDateCopyWith<$Res> get date { + return $SyncDateCopyWith<$Res>(_value.date, (value) { + return _then(_value.copyWith(date: value) as $Val); + }); + } + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SyncTimeCopyWith<$Res> get time { + return $SyncTimeCopyWith<$Res>(_value.time, (value) { + return _then(_value.copyWith(time: value) as $Val); + }); + } + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SyncTimeZoneCopyWith<$Res> get timezone { + return $SyncTimeZoneCopyWith<$Res>(_value.timezone, (value) { + return _then(_value.copyWith(timezone: value) as $Val); + }); + } } + /// @nodoc -class _$TimeSyncPropsCopyWithImpl<$Res> +abstract class _$$TimeSyncPropsImplCopyWith<$Res> implements $TimeSyncPropsCopyWith<$Res> { - _$TimeSyncPropsCopyWithImpl(this._self, this._then); - - final TimeSyncProps _self; - final $Res Function(TimeSyncProps) _then; - -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? date = null,Object? time = null,Object? timezone = null,Object? is12HourFormat = null,}) { - return _then(TimeSyncProps( -date: null == date ? _self.date : date // ignore: cast_nullable_to_non_nullable -as SyncDate,time: null == time ? _self.time : time // ignore: cast_nullable_to_non_nullable -as SyncTime,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable -as SyncTimeZone,is12HourFormat: null == is12HourFormat ? _self.is12HourFormat : is12HourFormat // ignore: cast_nullable_to_non_nullable -as bool, - )); -} -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncDateCopyWith<$Res> get date { - - return $SyncDateCopyWith<$Res>(_self.date, (value) { - return _then(_self.copyWith(date: value)); - }); -}/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncTimeCopyWith<$Res> get time { - - return $SyncTimeCopyWith<$Res>(_self.time, (value) { - return _then(_self.copyWith(time: value)); + factory _$$TimeSyncPropsImplCopyWith( + _$TimeSyncPropsImpl value, + $Res Function(_$TimeSyncPropsImpl) then, + ) = __$$TimeSyncPropsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + SyncDate date, + SyncTime time, + SyncTimeZone timezone, + bool is12HourFormat, }); -}/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncTimeZoneCopyWith<$Res> get timezone { - - return $SyncTimeZoneCopyWith<$Res>(_self.timezone, (value) { - return _then(_self.copyWith(timezone: value)); - }); -} -} - - -/// Adds pattern-matching-related methods to [TimeSyncProps]. -extension TimeSyncPropsPatterns on TimeSyncProps { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _TimeSyncProps value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _TimeSyncProps() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _TimeSyncProps value) $default,){ -final _that = this; -switch (_that) { -case _TimeSyncProps(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _TimeSyncProps value)? $default,){ -final _that = this; -switch (_that) { -case _TimeSyncProps() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( SyncDate date, SyncTime time, SyncTimeZone timezone, bool is12HourFormat)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _TimeSyncProps() when $default != null: -return $default(_that.date,_that.time,_that.timezone,_that.is12HourFormat);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( SyncDate date, SyncTime time, SyncTimeZone timezone, bool is12HourFormat) $default,) {final _that = this; -switch (_that) { -case _TimeSyncProps(): -return $default(_that.date,_that.time,_that.timezone,_that.is12HourFormat);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( SyncDate date, SyncTime time, SyncTimeZone timezone, bool is12HourFormat)? $default,) {final _that = this; -switch (_that) { -case _TimeSyncProps() when $default != null: -return $default(_that.date,_that.time,_that.timezone,_that.is12HourFormat);case _: - return null; - -} -} + @override + $SyncDateCopyWith<$Res> get date; + @override + $SyncTimeCopyWith<$Res> get time; + @override + $SyncTimeZoneCopyWith<$Res> get timezone; } /// @nodoc -@JsonSerializable() - -class _TimeSyncProps implements TimeSyncProps { - const _TimeSyncProps({required this.date, required this.time, required this.timezone, this.is12HourFormat = false}); - factory _TimeSyncProps.fromJson(Map json) => _$TimeSyncPropsFromJson(json); - -@override final SyncDate date; -@override final SyncTime time; -@override final SyncTimeZone timezone; -@override@JsonKey() final bool is12HourFormat; - -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$TimeSyncPropsCopyWith<_TimeSyncProps> get copyWith => __$TimeSyncPropsCopyWithImpl<_TimeSyncProps>(this, _$identity); - -@override -Map toJson() { - return _$TimeSyncPropsToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _TimeSyncProps&&(identical(other.date, date) || other.date == date)&&(identical(other.time, time) || other.time == time)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.is12HourFormat, is12HourFormat) || other.is12HourFormat == is12HourFormat)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,date,time,timezone,is12HourFormat); - -@override -String toString() { - return 'TimeSyncProps(date: $date, time: $time, timezone: $timezone, is12HourFormat: $is12HourFormat)'; -} - - +class __$$TimeSyncPropsImplCopyWithImpl<$Res> + extends _$TimeSyncPropsCopyWithImpl<$Res, _$TimeSyncPropsImpl> + implements _$$TimeSyncPropsImplCopyWith<$Res> { + __$$TimeSyncPropsImplCopyWithImpl( + _$TimeSyncPropsImpl _value, + $Res Function(_$TimeSyncPropsImpl) _then, + ) : super(_value, _then); + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? date = null, + Object? time = null, + Object? timezone = null, + Object? is12HourFormat = null, + }) { + return _then( + _$TimeSyncPropsImpl( + date: null == date + ? _value.date + : date // ignore: cast_nullable_to_non_nullable + as SyncDate, + time: null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as SyncTime, + timezone: null == timezone + ? _value.timezone + : timezone // ignore: cast_nullable_to_non_nullable + as SyncTimeZone, + is12HourFormat: null == is12HourFormat + ? _value.is12HourFormat + : is12HourFormat // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); + } } /// @nodoc -abstract mixin class _$TimeSyncPropsCopyWith<$Res> implements $TimeSyncPropsCopyWith<$Res> { - factory _$TimeSyncPropsCopyWith(_TimeSyncProps value, $Res Function(_TimeSyncProps) _then) = __$TimeSyncPropsCopyWithImpl; -@override @useResult -$Res call({ - SyncDate date, SyncTime time, SyncTimeZone timezone, bool is12HourFormat -}); - - -@override $SyncDateCopyWith<$Res> get date;@override $SyncTimeCopyWith<$Res> get time;@override $SyncTimeZoneCopyWith<$Res> get timezone; - -} -/// @nodoc -class __$TimeSyncPropsCopyWithImpl<$Res> - implements _$TimeSyncPropsCopyWith<$Res> { - __$TimeSyncPropsCopyWithImpl(this._self, this._then); - - final _TimeSyncProps _self; - final $Res Function(_TimeSyncProps) _then; - -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? date = null,Object? time = null,Object? timezone = null,Object? is12HourFormat = null,}) { - return _then(_TimeSyncProps( -date: null == date ? _self.date : date // ignore: cast_nullable_to_non_nullable -as SyncDate,time: null == time ? _self.time : time // ignore: cast_nullable_to_non_nullable -as SyncTime,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable -as SyncTimeZone,is12HourFormat: null == is12HourFormat ? _self.is12HourFormat : is12HourFormat // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - -/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncDateCopyWith<$Res> get date { - - return $SyncDateCopyWith<$Res>(_self.date, (value) { - return _then(_self.copyWith(date: value)); - }); -}/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncTimeCopyWith<$Res> get time { - - return $SyncTimeCopyWith<$Res>(_self.time, (value) { - return _then(_self.copyWith(time: value)); - }); -}/// Create a copy of TimeSyncProps -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$SyncTimeZoneCopyWith<$Res> get timezone { - - return $SyncTimeZoneCopyWith<$Res>(_self.timezone, (value) { - return _then(_self.copyWith(timezone: value)); +@JsonSerializable() +class _$TimeSyncPropsImpl implements _TimeSyncProps { + const _$TimeSyncPropsImpl({ + required this.date, + required this.time, + required this.timezone, + this.is12HourFormat = false, }); -} -} + factory _$TimeSyncPropsImpl.fromJson(Map json) => + _$$TimeSyncPropsImplFromJson(json); + + @override + final SyncDate date; + @override + final SyncTime time; + @override + final SyncTimeZone timezone; + @override + @JsonKey() + final bool is12HourFormat; + + @override + String toString() { + return 'TimeSyncProps(date: $date, time: $time, timezone: $timezone, is12HourFormat: $is12HourFormat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$TimeSyncPropsImpl && + (identical(other.date, date) || other.date == date) && + (identical(other.time, time) || other.time == time) && + (identical(other.timezone, timezone) || + other.timezone == timezone) && + (identical(other.is12HourFormat, is12HourFormat) || + other.is12HourFormat == is12HourFormat)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, date, time, timezone, is12HourFormat); + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$TimeSyncPropsImplCopyWith<_$TimeSyncPropsImpl> get copyWith => + __$$TimeSyncPropsImplCopyWithImpl<_$TimeSyncPropsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$TimeSyncPropsImplToJson(this); + } +} + +abstract class _TimeSyncProps implements TimeSyncProps { + const factory _TimeSyncProps({ + required final SyncDate date, + required final SyncTime time, + required final SyncTimeZone timezone, + final bool is12HourFormat, + }) = _$TimeSyncPropsImpl; + + factory _TimeSyncProps.fromJson(Map json) = + _$TimeSyncPropsImpl.fromJson; + + @override + SyncDate get date; + @override + SyncTime get time; + @override + SyncTimeZone get timezone; + @override + bool get is12HourFormat; + + /// Create a copy of TimeSyncProps + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$TimeSyncPropsImplCopyWith<_$TimeSyncPropsImpl> get copyWith => + throw _privateConstructorUsedError; +} + +SyncDate _$SyncDateFromJson(Map json) { + return _SyncDate.fromJson(json); +} /// @nodoc mixin _$SyncDate { - - int get year; int get month; int get day; -/// Create a copy of SyncDate -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$SyncDateCopyWith get copyWith => _$SyncDateCopyWithImpl(this as SyncDate, _$identity); + int get year => throw _privateConstructorUsedError; + int get month => throw _privateConstructorUsedError; + int get day => throw _privateConstructorUsedError; /// Serializes this SyncDate to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is SyncDate&&(identical(other.year, year) || other.year == year)&&(identical(other.month, month) || other.month == month)&&(identical(other.day, day) || other.day == day)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,year,month,day); - -@override -String toString() { - return 'SyncDate(year: $year, month: $month, day: $day)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of SyncDate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SyncDateCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $SyncDateCopyWith<$Res> { - factory $SyncDateCopyWith(SyncDate value, $Res Function(SyncDate) _then) = _$SyncDateCopyWithImpl; -@useResult -$Res call({ - int year, int month, int day -}); - - - - +abstract class $SyncDateCopyWith<$Res> { + factory $SyncDateCopyWith(SyncDate value, $Res Function(SyncDate) then) = + _$SyncDateCopyWithImpl<$Res, SyncDate>; + @useResult + $Res call({int year, int month, int day}); } + /// @nodoc -class _$SyncDateCopyWithImpl<$Res> +class _$SyncDateCopyWithImpl<$Res, $Val extends SyncDate> implements $SyncDateCopyWith<$Res> { - _$SyncDateCopyWithImpl(this._self, this._then); - - final SyncDate _self; - final $Res Function(SyncDate) _then; - -/// Create a copy of SyncDate -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? year = null,Object? month = null,Object? day = null,}) { - return _then(SyncDate( -year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable -as int,month: null == month ? _self.month : month // ignore: cast_nullable_to_non_nullable -as int,day: null == day ? _self.day : day // ignore: cast_nullable_to_non_nullable -as int, - )); -} - -} - - -/// Adds pattern-matching-related methods to [SyncDate]. -extension SyncDatePatterns on SyncDate { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _SyncDate value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _SyncDate() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _SyncDate value) $default,){ -final _that = this; -switch (_that) { -case _SyncDate(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SyncDate value)? $default,){ -final _that = this; -switch (_that) { -case _SyncDate() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int year, int month, int day)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _SyncDate() when $default != null: -return $default(_that.year,_that.month,_that.day);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int year, int month, int day) $default,) {final _that = this; -switch (_that) { -case _SyncDate(): -return $default(_that.year,_that.month,_that.day);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int year, int month, int day)? $default,) {final _that = this; -switch (_that) { -case _SyncDate() when $default != null: -return $default(_that.year,_that.month,_that.day);case _: - return null; - -} -} - + _$SyncDateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SyncDate + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? year = null, Object? month = null, Object? day = null}) { + return _then( + _value.copyWith( + year: null == year + ? _value.year + : year // ignore: cast_nullable_to_non_nullable + as int, + month: null == month + ? _value.month + : month // ignore: cast_nullable_to_non_nullable + as int, + day: null == day + ? _value.day + : day // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _SyncDate implements SyncDate { - const _SyncDate({required this.year, required this.month, required this.day}); - factory _SyncDate.fromJson(Map json) => _$SyncDateFromJson(json); - -@override final int year; -@override final int month; -@override final int day; - -/// Create a copy of SyncDate -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$SyncDateCopyWith<_SyncDate> get copyWith => __$SyncDateCopyWithImpl<_SyncDate>(this, _$identity); - -@override -Map toJson() { - return _$SyncDateToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _SyncDate&&(identical(other.year, year) || other.year == year)&&(identical(other.month, month) || other.month == month)&&(identical(other.day, day) || other.day == day)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,year,month,day); - -@override -String toString() { - return 'SyncDate(year: $year, month: $month, day: $day)'; -} - - +abstract class _$$SyncDateImplCopyWith<$Res> + implements $SyncDateCopyWith<$Res> { + factory _$$SyncDateImplCopyWith( + _$SyncDateImpl value, + $Res Function(_$SyncDateImpl) then, + ) = __$$SyncDateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int year, int month, int day}); } /// @nodoc -abstract mixin class _$SyncDateCopyWith<$Res> implements $SyncDateCopyWith<$Res> { - factory _$SyncDateCopyWith(_SyncDate value, $Res Function(_SyncDate) _then) = __$SyncDateCopyWithImpl; -@override @useResult -$Res call({ - int year, int month, int day -}); - - - - -} -/// @nodoc -class __$SyncDateCopyWithImpl<$Res> - implements _$SyncDateCopyWith<$Res> { - __$SyncDateCopyWithImpl(this._self, this._then); - - final _SyncDate _self; - final $Res Function(_SyncDate) _then; - -/// Create a copy of SyncDate -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? year = null,Object? month = null,Object? day = null,}) { - return _then(_SyncDate( -year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable -as int,month: null == month ? _self.month : month // ignore: cast_nullable_to_non_nullable -as int,day: null == day ? _self.day : day // ignore: cast_nullable_to_non_nullable -as int, - )); +class __$$SyncDateImplCopyWithImpl<$Res> + extends _$SyncDateCopyWithImpl<$Res, _$SyncDateImpl> + implements _$$SyncDateImplCopyWith<$Res> { + __$$SyncDateImplCopyWithImpl( + _$SyncDateImpl _value, + $Res Function(_$SyncDateImpl) _then, + ) : super(_value, _then); + + /// Create a copy of SyncDate + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? year = null, Object? month = null, Object? day = null}) { + return _then( + _$SyncDateImpl( + year: null == year + ? _value.year + : year // ignore: cast_nullable_to_non_nullable + as int, + month: null == month + ? _value.month + : month // ignore: cast_nullable_to_non_nullable + as int, + day: null == day + ? _value.day + : day // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$SyncDateImpl implements _SyncDate { + const _$SyncDateImpl({ + required this.year, + required this.month, + required this.day, + }); + factory _$SyncDateImpl.fromJson(Map json) => + _$$SyncDateImplFromJson(json); + + @override + final int year; + @override + final int month; + @override + final int day; + + @override + String toString() { + return 'SyncDate(year: $year, month: $month, day: $day)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SyncDateImpl && + (identical(other.year, year) || other.year == year) && + (identical(other.month, month) || other.month == month) && + (identical(other.day, day) || other.day == day)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, year, month, day); + + /// Create a copy of SyncDate + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SyncDateImplCopyWith<_$SyncDateImpl> get copyWith => + __$$SyncDateImplCopyWithImpl<_$SyncDateImpl>(this, _$identity); + + @override + Map toJson() { + return _$$SyncDateImplToJson(this); + } +} + +abstract class _SyncDate implements SyncDate { + const factory _SyncDate({ + required final int year, + required final int month, + required final int day, + }) = _$SyncDateImpl; + + factory _SyncDate.fromJson(Map json) = + _$SyncDateImpl.fromJson; + + @override + int get year; + @override + int get month; + @override + int get day; + + /// Create a copy of SyncDate + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SyncDateImplCopyWith<_$SyncDateImpl> get copyWith => + throw _privateConstructorUsedError; +} + +SyncTime _$SyncTimeFromJson(Map json) { + return _SyncTime.fromJson(json); } - /// @nodoc mixin _$SyncTime { - - int get hour; int get minute; int get second; int get millisecond; -/// Create a copy of SyncTime -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$SyncTimeCopyWith get copyWith => _$SyncTimeCopyWithImpl(this as SyncTime, _$identity); + int get hour => throw _privateConstructorUsedError; + int get minute => throw _privateConstructorUsedError; + int get second => throw _privateConstructorUsedError; + int get millisecond => throw _privateConstructorUsedError; /// Serializes this SyncTime to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is SyncTime&&(identical(other.hour, hour) || other.hour == hour)&&(identical(other.minute, minute) || other.minute == minute)&&(identical(other.second, second) || other.second == second)&&(identical(other.millisecond, millisecond) || other.millisecond == millisecond)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,hour,minute,second,millisecond); - -@override -String toString() { - return 'SyncTime(hour: $hour, minute: $minute, second: $second, millisecond: $millisecond)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of SyncTime + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SyncTimeCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $SyncTimeCopyWith<$Res> { - factory $SyncTimeCopyWith(SyncTime value, $Res Function(SyncTime) _then) = _$SyncTimeCopyWithImpl; -@useResult -$Res call({ - int hour, int minute, int second, int millisecond -}); - - - - +abstract class $SyncTimeCopyWith<$Res> { + factory $SyncTimeCopyWith(SyncTime value, $Res Function(SyncTime) then) = + _$SyncTimeCopyWithImpl<$Res, SyncTime>; + @useResult + $Res call({int hour, int minute, int second, int millisecond}); } + /// @nodoc -class _$SyncTimeCopyWithImpl<$Res> +class _$SyncTimeCopyWithImpl<$Res, $Val extends SyncTime> implements $SyncTimeCopyWith<$Res> { - _$SyncTimeCopyWithImpl(this._self, this._then); - - final SyncTime _self; - final $Res Function(SyncTime) _then; - -/// Create a copy of SyncTime -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? hour = null,Object? minute = null,Object? second = null,Object? millisecond = null,}) { - return _then(SyncTime( -hour: null == hour ? _self.hour : hour // ignore: cast_nullable_to_non_nullable -as int,minute: null == minute ? _self.minute : minute // ignore: cast_nullable_to_non_nullable -as int,second: null == second ? _self.second : second // ignore: cast_nullable_to_non_nullable -as int,millisecond: null == millisecond ? _self.millisecond : millisecond // ignore: cast_nullable_to_non_nullable -as int, - )); -} - -} - - -/// Adds pattern-matching-related methods to [SyncTime]. -extension SyncTimePatterns on SyncTime { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _SyncTime value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _SyncTime() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _SyncTime value) $default,){ -final _that = this; -switch (_that) { -case _SyncTime(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SyncTime value)? $default,){ -final _that = this; -switch (_that) { -case _SyncTime() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int hour, int minute, int second, int millisecond)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _SyncTime() when $default != null: -return $default(_that.hour,_that.minute,_that.second,_that.millisecond);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int hour, int minute, int second, int millisecond) $default,) {final _that = this; -switch (_that) { -case _SyncTime(): -return $default(_that.hour,_that.minute,_that.second,_that.millisecond);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int hour, int minute, int second, int millisecond)? $default,) {final _that = this; -switch (_that) { -case _SyncTime() when $default != null: -return $default(_that.hour,_that.minute,_that.second,_that.millisecond);case _: - return null; - -} -} - + _$SyncTimeCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SyncTime + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hour = null, + Object? minute = null, + Object? second = null, + Object? millisecond = null, + }) { + return _then( + _value.copyWith( + hour: null == hour + ? _value.hour + : hour // ignore: cast_nullable_to_non_nullable + as int, + minute: null == minute + ? _value.minute + : minute // ignore: cast_nullable_to_non_nullable + as int, + second: null == second + ? _value.second + : second // ignore: cast_nullable_to_non_nullable + as int, + millisecond: null == millisecond + ? _value.millisecond + : millisecond // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _SyncTime implements SyncTime { - const _SyncTime({required this.hour, required this.minute, this.second = 0, this.millisecond = 0}); - factory _SyncTime.fromJson(Map json) => _$SyncTimeFromJson(json); - -@override final int hour; -@override final int minute; -@override@JsonKey() final int second; -@override@JsonKey() final int millisecond; - -/// Create a copy of SyncTime -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$SyncTimeCopyWith<_SyncTime> get copyWith => __$SyncTimeCopyWithImpl<_SyncTime>(this, _$identity); - -@override -Map toJson() { - return _$SyncTimeToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _SyncTime&&(identical(other.hour, hour) || other.hour == hour)&&(identical(other.minute, minute) || other.minute == minute)&&(identical(other.second, second) || other.second == second)&&(identical(other.millisecond, millisecond) || other.millisecond == millisecond)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,hour,minute,second,millisecond); - -@override -String toString() { - return 'SyncTime(hour: $hour, minute: $minute, second: $second, millisecond: $millisecond)'; -} - - +abstract class _$$SyncTimeImplCopyWith<$Res> + implements $SyncTimeCopyWith<$Res> { + factory _$$SyncTimeImplCopyWith( + _$SyncTimeImpl value, + $Res Function(_$SyncTimeImpl) then, + ) = __$$SyncTimeImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int hour, int minute, int second, int millisecond}); } /// @nodoc -abstract mixin class _$SyncTimeCopyWith<$Res> implements $SyncTimeCopyWith<$Res> { - factory _$SyncTimeCopyWith(_SyncTime value, $Res Function(_SyncTime) _then) = __$SyncTimeCopyWithImpl; -@override @useResult -$Res call({ - int hour, int minute, int second, int millisecond -}); - - - - -} -/// @nodoc -class __$SyncTimeCopyWithImpl<$Res> - implements _$SyncTimeCopyWith<$Res> { - __$SyncTimeCopyWithImpl(this._self, this._then); - - final _SyncTime _self; - final $Res Function(_SyncTime) _then; - -/// Create a copy of SyncTime -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? hour = null,Object? minute = null,Object? second = null,Object? millisecond = null,}) { - return _then(_SyncTime( -hour: null == hour ? _self.hour : hour // ignore: cast_nullable_to_non_nullable -as int,minute: null == minute ? _self.minute : minute // ignore: cast_nullable_to_non_nullable -as int,second: null == second ? _self.second : second // ignore: cast_nullable_to_non_nullable -as int,millisecond: null == millisecond ? _self.millisecond : millisecond // ignore: cast_nullable_to_non_nullable -as int, - )); +class __$$SyncTimeImplCopyWithImpl<$Res> + extends _$SyncTimeCopyWithImpl<$Res, _$SyncTimeImpl> + implements _$$SyncTimeImplCopyWith<$Res> { + __$$SyncTimeImplCopyWithImpl( + _$SyncTimeImpl _value, + $Res Function(_$SyncTimeImpl) _then, + ) : super(_value, _then); + + /// Create a copy of SyncTime + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? hour = null, + Object? minute = null, + Object? second = null, + Object? millisecond = null, + }) { + return _then( + _$SyncTimeImpl( + hour: null == hour + ? _value.hour + : hour // ignore: cast_nullable_to_non_nullable + as int, + minute: null == minute + ? _value.minute + : minute // ignore: cast_nullable_to_non_nullable + as int, + second: null == second + ? _value.second + : second // ignore: cast_nullable_to_non_nullable + as int, + millisecond: null == millisecond + ? _value.millisecond + : millisecond // ignore: cast_nullable_to_non_nullable + as int, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$SyncTimeImpl implements _SyncTime { + const _$SyncTimeImpl({ + required this.hour, + required this.minute, + this.second = 0, + this.millisecond = 0, + }); + factory _$SyncTimeImpl.fromJson(Map json) => + _$$SyncTimeImplFromJson(json); + + @override + final int hour; + @override + final int minute; + @override + @JsonKey() + final int second; + @override + @JsonKey() + final int millisecond; + + @override + String toString() { + return 'SyncTime(hour: $hour, minute: $minute, second: $second, millisecond: $millisecond)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SyncTimeImpl && + (identical(other.hour, hour) || other.hour == hour) && + (identical(other.minute, minute) || other.minute == minute) && + (identical(other.second, second) || other.second == second) && + (identical(other.millisecond, millisecond) || + other.millisecond == millisecond)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, hour, minute, second, millisecond); + + /// Create a copy of SyncTime + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SyncTimeImplCopyWith<_$SyncTimeImpl> get copyWith => + __$$SyncTimeImplCopyWithImpl<_$SyncTimeImpl>(this, _$identity); + + @override + Map toJson() { + return _$$SyncTimeImplToJson(this); + } +} + +abstract class _SyncTime implements SyncTime { + const factory _SyncTime({ + required final int hour, + required final int minute, + final int second, + final int millisecond, + }) = _$SyncTimeImpl; + + factory _SyncTime.fromJson(Map json) = + _$SyncTimeImpl.fromJson; + + @override + int get hour; + @override + int get minute; + @override + int get second; + @override + int get millisecond; + + /// Create a copy of SyncTime + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SyncTimeImplCopyWith<_$SyncTimeImpl> get copyWith => + throw _privateConstructorUsedError; +} + +SyncTimeZone _$SyncTimeZoneFromJson(Map json) { + return _SyncTimeZone.fromJson(json); } - /// @nodoc mixin _$SyncTimeZone { - - int get offset; int get dstOffset; String get id; -/// Create a copy of SyncTimeZone -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$SyncTimeZoneCopyWith get copyWith => _$SyncTimeZoneCopyWithImpl(this as SyncTimeZone, _$identity); + int get offset => throw _privateConstructorUsedError; + int get dstOffset => throw _privateConstructorUsedError; + String get id => throw _privateConstructorUsedError; /// Serializes this SyncTimeZone to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is SyncTimeZone&&(identical(other.offset, offset) || other.offset == offset)&&(identical(other.dstOffset, dstOffset) || other.dstOffset == dstOffset)&&(identical(other.id, id) || other.id == id)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,offset,dstOffset,id); - -@override -String toString() { - return 'SyncTimeZone(offset: $offset, dstOffset: $dstOffset, id: $id)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of SyncTimeZone + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SyncTimeZoneCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $SyncTimeZoneCopyWith<$Res> { - factory $SyncTimeZoneCopyWith(SyncTimeZone value, $Res Function(SyncTimeZone) _then) = _$SyncTimeZoneCopyWithImpl; -@useResult -$Res call({ - int offset, int dstOffset, String id -}); - - - - +abstract class $SyncTimeZoneCopyWith<$Res> { + factory $SyncTimeZoneCopyWith( + SyncTimeZone value, + $Res Function(SyncTimeZone) then, + ) = _$SyncTimeZoneCopyWithImpl<$Res, SyncTimeZone>; + @useResult + $Res call({int offset, int dstOffset, String id}); } + /// @nodoc -class _$SyncTimeZoneCopyWithImpl<$Res> +class _$SyncTimeZoneCopyWithImpl<$Res, $Val extends SyncTimeZone> implements $SyncTimeZoneCopyWith<$Res> { - _$SyncTimeZoneCopyWithImpl(this._self, this._then); - - final SyncTimeZone _self; - final $Res Function(SyncTimeZone) _then; - -/// Create a copy of SyncTimeZone -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? offset = null,Object? dstOffset = null,Object? id = null,}) { - return _then(SyncTimeZone( -offset: null == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable -as int,dstOffset: null == dstOffset ? _self.dstOffset : dstOffset // ignore: cast_nullable_to_non_nullable -as int,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String, - )); -} - -} - - -/// Adds pattern-matching-related methods to [SyncTimeZone]. -extension SyncTimeZonePatterns on SyncTimeZone { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _SyncTimeZone value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _SyncTimeZone() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _SyncTimeZone value) $default,){ -final _that = this; -switch (_that) { -case _SyncTimeZone(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _SyncTimeZone value)? $default,){ -final _that = this; -switch (_that) { -case _SyncTimeZone() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( int offset, int dstOffset, String id)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _SyncTimeZone() when $default != null: -return $default(_that.offset,_that.dstOffset,_that.id);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( int offset, int dstOffset, String id) $default,) {final _that = this; -switch (_that) { -case _SyncTimeZone(): -return $default(_that.offset,_that.dstOffset,_that.id);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int offset, int dstOffset, String id)? $default,) {final _that = this; -switch (_that) { -case _SyncTimeZone() when $default != null: -return $default(_that.offset,_that.dstOffset,_that.id);case _: - return null; - -} -} - + _$SyncTimeZoneCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of SyncTimeZone + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? offset = null, + Object? dstOffset = null, + Object? id = null, + }) { + return _then( + _value.copyWith( + offset: null == offset + ? _value.offset + : offset // ignore: cast_nullable_to_non_nullable + as int, + dstOffset: null == dstOffset + ? _value.dstOffset + : dstOffset // ignore: cast_nullable_to_non_nullable + as int, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _SyncTimeZone implements SyncTimeZone { - const _SyncTimeZone({required this.offset, this.dstOffset = 0, required this.id}); - factory _SyncTimeZone.fromJson(Map json) => _$SyncTimeZoneFromJson(json); - -@override final int offset; -@override@JsonKey() final int dstOffset; -@override final String id; - -/// Create a copy of SyncTimeZone -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$SyncTimeZoneCopyWith<_SyncTimeZone> get copyWith => __$SyncTimeZoneCopyWithImpl<_SyncTimeZone>(this, _$identity); - -@override -Map toJson() { - return _$SyncTimeZoneToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _SyncTimeZone&&(identical(other.offset, offset) || other.offset == offset)&&(identical(other.dstOffset, dstOffset) || other.dstOffset == dstOffset)&&(identical(other.id, id) || other.id == id)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,offset,dstOffset,id); - -@override -String toString() { - return 'SyncTimeZone(offset: $offset, dstOffset: $dstOffset, id: $id)'; -} - - +abstract class _$$SyncTimeZoneImplCopyWith<$Res> + implements $SyncTimeZoneCopyWith<$Res> { + factory _$$SyncTimeZoneImplCopyWith( + _$SyncTimeZoneImpl value, + $Res Function(_$SyncTimeZoneImpl) then, + ) = __$$SyncTimeZoneImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({int offset, int dstOffset, String id}); } /// @nodoc -abstract mixin class _$SyncTimeZoneCopyWith<$Res> implements $SyncTimeZoneCopyWith<$Res> { - factory _$SyncTimeZoneCopyWith(_SyncTimeZone value, $Res Function(_SyncTimeZone) _then) = __$SyncTimeZoneCopyWithImpl; -@override @useResult -$Res call({ - int offset, int dstOffset, String id -}); - - - - -} -/// @nodoc -class __$SyncTimeZoneCopyWithImpl<$Res> - implements _$SyncTimeZoneCopyWith<$Res> { - __$SyncTimeZoneCopyWithImpl(this._self, this._then); - - final _SyncTimeZone _self; - final $Res Function(_SyncTimeZone) _then; - -/// Create a copy of SyncTimeZone -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? offset = null,Object? dstOffset = null,Object? id = null,}) { - return _then(_SyncTimeZone( -offset: null == offset ? _self.offset : offset // ignore: cast_nullable_to_non_nullable -as int,dstOffset: null == dstOffset ? _self.dstOffset : dstOffset // ignore: cast_nullable_to_non_nullable -as int,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String, - )); +class __$$SyncTimeZoneImplCopyWithImpl<$Res> + extends _$SyncTimeZoneCopyWithImpl<$Res, _$SyncTimeZoneImpl> + implements _$$SyncTimeZoneImplCopyWith<$Res> { + __$$SyncTimeZoneImplCopyWithImpl( + _$SyncTimeZoneImpl _value, + $Res Function(_$SyncTimeZoneImpl) _then, + ) : super(_value, _then); + + /// Create a copy of SyncTimeZone + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? offset = null, + Object? dstOffset = null, + Object? id = null, + }) { + return _then( + _$SyncTimeZoneImpl( + offset: null == offset + ? _value.offset + : offset // ignore: cast_nullable_to_non_nullable + as int, + dstOffset: null == dstOffset + ? _value.dstOffset + : dstOffset // ignore: cast_nullable_to_non_nullable + as int, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$SyncTimeZoneImpl implements _SyncTimeZone { + const _$SyncTimeZoneImpl({ + required this.offset, + this.dstOffset = 0, + required this.id, + }); + factory _$SyncTimeZoneImpl.fromJson(Map json) => + _$$SyncTimeZoneImplFromJson(json); + + @override + final int offset; + @override + @JsonKey() + final int dstOffset; + @override + final String id; + + @override + String toString() { + return 'SyncTimeZone(offset: $offset, dstOffset: $dstOffset, id: $id)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$SyncTimeZoneImpl && + (identical(other.offset, offset) || other.offset == offset) && + (identical(other.dstOffset, dstOffset) || + other.dstOffset == dstOffset) && + (identical(other.id, id) || other.id == id)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, offset, dstOffset, id); + + /// Create a copy of SyncTimeZone + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$SyncTimeZoneImplCopyWith<_$SyncTimeZoneImpl> get copyWith => + __$$SyncTimeZoneImplCopyWithImpl<_$SyncTimeZoneImpl>(this, _$identity); + + @override + Map toJson() { + return _$$SyncTimeZoneImplToJson(this); + } +} + +abstract class _SyncTimeZone implements SyncTimeZone { + const factory _SyncTimeZone({ + required final int offset, + final int dstOffset, + required final String id, + }) = _$SyncTimeZoneImpl; + + factory _SyncTimeZone.fromJson(Map json) = + _$SyncTimeZoneImpl.fromJson; + + @override + int get offset; + @override + int get dstOffset; + @override + String get id; + + /// Create a copy of SyncTimeZone + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SyncTimeZoneImplCopyWith<_$SyncTimeZoneImpl> get copyWith => + throw _privateConstructorUsedError; } - -// dart format on diff --git a/lib/src/core/models/sync_models.g.dart b/lib/src/core/models/sync_models.g.dart index bb4015a8..09f2d910 100644 --- a/lib/src/core/models/sync_models.g.dart +++ b/lib/src/core/models/sync_models.g.dart @@ -6,15 +6,15 @@ part of 'sync_models.dart'; // JsonSerializableGenerator // ************************************************************************** -_TimeSyncProps _$TimeSyncPropsFromJson(Map json) => - _TimeSyncProps( +_$TimeSyncPropsImpl _$$TimeSyncPropsImplFromJson(Map json) => + _$TimeSyncPropsImpl( date: SyncDate.fromJson(json['date'] as Map), time: SyncTime.fromJson(json['time'] as Map), timezone: SyncTimeZone.fromJson(json['timezone'] as Map), is12HourFormat: json['is12HourFormat'] as bool? ?? false, ); -Map _$TimeSyncPropsToJson(_TimeSyncProps instance) => +Map _$$TimeSyncPropsImplToJson(_$TimeSyncPropsImpl instance) => { 'date': instance.date, 'time': instance.time, @@ -22,40 +22,44 @@ Map _$TimeSyncPropsToJson(_TimeSyncProps instance) => 'is12HourFormat': instance.is12HourFormat, }; -_SyncDate _$SyncDateFromJson(Map json) => _SyncDate( - year: (json['year'] as num).toInt(), - month: (json['month'] as num).toInt(), - day: (json['day'] as num).toInt(), -); - -Map _$SyncDateToJson(_SyncDate instance) => { - 'year': instance.year, - 'month': instance.month, - 'day': instance.day, -}; - -_SyncTime _$SyncTimeFromJson(Map json) => _SyncTime( - hour: (json['hour'] as num).toInt(), - minute: (json['minute'] as num).toInt(), - second: (json['second'] as num?)?.toInt() ?? 0, - millisecond: (json['millisecond'] as num?)?.toInt() ?? 0, -); - -Map _$SyncTimeToJson(_SyncTime instance) => { - 'hour': instance.hour, - 'minute': instance.minute, - 'second': instance.second, - 'millisecond': instance.millisecond, -}; - -_SyncTimeZone _$SyncTimeZoneFromJson(Map json) => - _SyncTimeZone( +_$SyncDateImpl _$$SyncDateImplFromJson(Map json) => + _$SyncDateImpl( + year: (json['year'] as num).toInt(), + month: (json['month'] as num).toInt(), + day: (json['day'] as num).toInt(), + ); + +Map _$$SyncDateImplToJson(_$SyncDateImpl instance) => + { + 'year': instance.year, + 'month': instance.month, + 'day': instance.day, + }; + +_$SyncTimeImpl _$$SyncTimeImplFromJson(Map json) => + _$SyncTimeImpl( + hour: (json['hour'] as num).toInt(), + minute: (json['minute'] as num).toInt(), + second: (json['second'] as num?)?.toInt() ?? 0, + millisecond: (json['millisecond'] as num?)?.toInt() ?? 0, + ); + +Map _$$SyncTimeImplToJson(_$SyncTimeImpl instance) => + { + 'hour': instance.hour, + 'minute': instance.minute, + 'second': instance.second, + 'millisecond': instance.millisecond, + }; + +_$SyncTimeZoneImpl _$$SyncTimeZoneImplFromJson(Map json) => + _$SyncTimeZoneImpl( offset: (json['offset'] as num).toInt(), dstOffset: (json['dstOffset'] as num?)?.toInt() ?? 0, id: json['id'] as String, ); -Map _$SyncTimeZoneToJson(_SyncTimeZone instance) => +Map _$$SyncTimeZoneImplToJson(_$SyncTimeZoneImpl instance) => { 'offset': instance.offset, 'dstOffset': instance.dstOffset, diff --git a/lib/src/core/services/ble_gatt_driver.dart b/lib/src/core/services/ble_gatt_driver.dart index a809e529..058bb49e 100644 --- a/lib/src/core/services/ble_gatt_driver.dart +++ b/lib/src/core/services/ble_gatt_driver.dart @@ -497,19 +497,24 @@ class BleGattDriver { // Android otherwise leaves the link at the balanced connection interval, // which makes an active wearable session easier for another companion app // to preempt. Keep the negotiated link responsive while OronBox owns it. + // + // NOTE: `requestConnectionPriority` was added in universal_ble 2.x. + // We are pinned to 1.2.0 for the ohos port, so this Android-only + // optimisation is skipped — ohos does not enter this branch anyway. if (defaultTargetPlatform == TargetPlatform.android) { - try { - await UniversalBle.requestConnectionPriority( - effectiveDeviceId, - BleConnectionPriority.highPerformance, - ); - _log.info('[$effectiveDeviceId] Android BLE priority set to high'); - } catch (e) { - _log.warning( - '[$effectiveDeviceId] Android BLE priority request failed (ignored)', - e, - ); - } + // TODO(ohos-port): re-enable when universal_ble >=2.0.0 is available. + // try { + // await UniversalBle.requestConnectionPriority( + // effectiveDeviceId, + // BleConnectionPriority.highPerformance, + // ); + // _log.info('[$effectiveDeviceId] Android BLE priority set to high'); + // } catch (e) { + // _log.warning( + // '[$effectiveDeviceId] Android BLE priority request failed (ignored)', + // e, + // ); + // } } if (attemptPair && !kIsWeb) { diff --git a/lib/src/core/services/ohos_ble_channel.dart b/lib/src/core/services/ohos_ble_channel.dart new file mode 100644 index 00000000..eafce0eb --- /dev/null +++ b/lib/src/core/services/ohos_ble_channel.dart @@ -0,0 +1,299 @@ +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:universal_ble/universal_ble.dart'; + +/// 鸿蒙 BLE 的 UniversalBlePlatform 实现。 +/// +/// OronBox 依赖 universal_ble 插件做蓝牙,但该插件没有鸿蒙原生实现。 +/// 本类继承 UniversalBlePlatform,通过 MethodChannel "oronbox/ble" 和 +/// EventChannel "oronbox/ble_events" 与鸿蒙端 OhosBleBridge 通信, +/// 复用 UniversalBlePlatform 内置的 stream 管理(updateScanResult / +/// updateConnection / updateCharacteristicValue),使 ble_gatt_driver.dart +/// 等上层代码零改动即可在鸿蒙上工作。 +class OhosUniversalBlePlatform extends UniversalBlePlatform { + OhosUniversalBlePlatform._(); + + static final OhosUniversalBlePlatform _instance = + OhosUniversalBlePlatform._(); + static OhosUniversalBlePlatform get instance => _instance; + + static const MethodChannel _methodChannel = MethodChannel('oronbox/ble'); + static const EventChannel _eventChannel = EventChannel('oronbox/ble_events'); + + // 保持订阅引用,防止被 GC 回收导致事件流中断。 + // ignore: unused_field + StreamSubscription? _eventSubscription; + bool _listening = false; + + /// 启动事件监听(首次使用时调用)。 + void _ensureListening() { + if (_listening) return; + _listening = true; + _eventSubscription = _eventChannel.receiveBroadcastStream().listen( + _onEvent, + onError: (Object e) { + // ignore: avoid_print + print('[OhosBlePlatform] event stream error: $e'); + }, + ); + } + + void _onEvent(dynamic event) { + if (event is! Map) return; + final type = event['type'] as String?; + switch (type) { + case 'scanResult': + final deviceId = event['deviceId'] as String? ?? ''; + final name = event['name'] as String? ?? ''; + final rssi = event['rssi'] as int?; + if (deviceId.isEmpty) return; + updateScanResult( + BleDevice( + deviceId: deviceId, + name: name, + rssi: rssi, + ), + ); + break; + case 'connectionState': + final deviceId = event['deviceId'] as String? ?? ''; + final connected = event['connected'] as bool? ?? false; + if (deviceId.isEmpty) return; + updateConnection(deviceId, connected); + break; + case 'characteristicChanged': + final deviceId = event['deviceId'] as String? ?? ''; + final charUuid = event['charUuid'] as String? ?? ''; + final value = event['value'] as Uint8List?; + if (deviceId.isEmpty || charUuid.isEmpty || value == null) return; + updateCharacteristicValue(deviceId, charUuid, value, null); + break; + case 'mtuChanged': + // MTU 变化暂不对外暴露,requestMtu 的返回值已够用。 + break; + } + } + + // --------------------------------------------------------------------------- + // UniversalBlePlatform 抽象方法实现 + // --------------------------------------------------------------------------- + + @override + Future getBluetoothAvailabilityState() async { + final ok = await _methodChannel.invokeMethod('isAvailable'); + return (ok ?? false) + ? AvailabilityState.poweredOn + : AvailabilityState.poweredOff; + } + + @override + Future enableBluetooth() async { + throw UnsupportedError('Not supported on ohos'); + } + + @override + Future disableBluetooth() async { + throw UnsupportedError('Not supported on ohos'); + } + + @override + Future requestPermissions({bool withAndroidFineLocation = false}) async { + await _methodChannel.invokeMethod('requestPermissions'); + } + + @override + Future startScan({ + ScanFilter? scanFilter, + PlatformConfig? platformConfig, + }) async { + _ensureListening(); + await _methodChannel.invokeMethod('startScan', { + 'services': scanFilter?.withServices ?? const [], + }); + } + + @override + Future stopScan() async { + await _methodChannel.invokeMethod('stopScan'); + } + + @override + Future isScanning() async { + // 鸿蒙端未单独跟踪扫描状态,简化处理。 + return false; + } + + @override + Future connect( + String deviceId, { + Duration? connectionTimeout, + bool autoConnect = false, + }) async { + _ensureListening(); + await _methodChannel.invokeMethod('connect', {'deviceId': deviceId}); + } + + @override + Future disconnect(String deviceId) async { + await _methodChannel.invokeMethod('disconnect', { + 'deviceId': deviceId, + }); + } + + @override + Future> discoverServices( + String deviceId, + bool withDescriptors, + ) async { + final raw = await _methodChannel.invokeMethod>( + 'discoverServices', + {'deviceId': deviceId}, + ); + final services = []; + if (raw == null) return services; + for (final svc in raw) { + if (svc is! Map) continue; + final serviceUuid = svc['uuid'] as String? ?? ''; + final characteristics = []; + final chars = svc['characteristics'] as List? ?? []; + for (final ch in chars) { + if (ch is! Map) continue; + final charUuid = ch['uuid'] as String? ?? ''; + final propStrs = ch['properties'] as List? ?? []; + final properties = []; + for (final p in propStrs) { + final mapped = _mapProperty(p as String?); + if (mapped != null) properties.add(mapped); + } + characteristics.add( + BleCharacteristic.withMetaData( + deviceId: deviceId, + serviceId: serviceUuid, + uuid: charUuid, + properties: properties, + descriptors: const [], + ), + ); + } + services.add(BleService(serviceUuid, characteristics)); + } + return services; + } + + @override + Future setNotifiable( + String deviceId, + String service, + String characteristic, + BleInputProperty bleInputProperty, + ) async { + _ensureListening(); + final enable = bleInputProperty != BleInputProperty.disabled; + await _methodChannel.invokeMethod('setNotify', { + 'deviceId': deviceId, + 'serviceUuid': service, + 'charUuid': characteristic, + 'enable': enable, + }); + } + + @override + Future readValue( + String deviceId, + String service, + String characteristic, { + Duration? timeout, + }) async { + final value = await _methodChannel.invokeMethod('read', { + 'deviceId': deviceId, + 'serviceUuid': service, + 'charUuid': characteristic, + }); + return value ?? Uint8List(0); + } + + @override + Future writeValue( + String deviceId, + String service, + String characteristic, + Uint8List value, + BleOutputProperty bleOutputProperty, + ) async { + final withResponse = bleOutputProperty == BleOutputProperty.withResponse; + await _methodChannel.invokeMethod('write', { + 'deviceId': deviceId, + 'serviceUuid': service, + 'charUuid': characteristic, + 'value': value, + 'writeType': withResponse ? 1 : 2, + }); + } + + @override + Future requestMtu(String deviceId, int expectedMtu) async { + final result = await _methodChannel.invokeMethod('requestMtu', { + 'deviceId': deviceId, + 'mtu': expectedMtu, + }); + return result ?? expectedMtu; + } + + @override + Future readRssi(String deviceId) async { + final result = await _methodChannel.invokeMethod('getRssi', { + 'deviceId': deviceId, + }); + return result ?? 0; + } + + @override + Future isPaired(String deviceId) async { + // 鸿蒙端未实现配对状态查询,返回 false(pair 会静默忽略)。 + return false; + } + + @override + Future pair(String deviceId) async { + // 鸿蒙 BLE 连接本身不强制要求系统配对,返回 true 表示"无需配对"。 + return true; + } + + @override + Future unpair(String deviceId) async { + // 鸿蒙端未实现解除配对,静默忽略。 + } + + @override + Future getConnectionState(String deviceId) async { + // 鸿蒙端连接状态通过 connectionState 事件推送,此处返回已连接需额外状态查询。 + // 简化:返回 disconnected(上层主要依赖 connectionStream)。 + return BleConnectionState.disconnected; + } + + @override + Future> getSystemDevices(List? withServices) async { + // 鸿蒙端未实现已配对设备查询,返回空列表。 + return const []; + } + + CharacteristicProperty? _mapProperty(String? prop) { + switch (prop) { + case 'read': + return CharacteristicProperty.read; + case 'write': + return CharacteristicProperty.write; + case 'writeWithoutResponse': + return CharacteristicProperty.writeWithoutResponse; + case 'notify': + return CharacteristicProperty.notify; + case 'indicate': + return CharacteristicProperty.indicate; + case 'broadcast': + return CharacteristicProperty.broadcast; + default: + return null; + } + } +} diff --git a/lib/src/core/services/ohos_file_picker.dart b/lib/src/core/services/ohos_file_picker.dart new file mode 100644 index 00000000..9cd94f17 --- /dev/null +++ b/lib/src/core/services/ohos_file_picker.dart @@ -0,0 +1,179 @@ +import 'dart:async'; + +import 'package:cross_file/cross_file.dart'; +import 'package:file_picker_platform_interface/file_picker_platform_interface.dart'; +import 'package:flutter/services.dart'; + +/// 鸿蒙端 file_picker 桥接实现。 +/// +/// OronBox 用 file_picker 选文件/选图/保存文件,鸿蒙端无原生实现。 +/// 本类继承 [FilePickerPlatform],在鸿蒙端通过自定义 channel `oronbox/file_picker` +/// 调鸿蒙的 [PhotoViewPicker](选图)或 [DocumentViewPicker](选文件/保存文件)。 +class OhosFilePickerPlatform extends FilePickerPlatform { + static const MethodChannel _method = MethodChannel('oronbox/file_picker'); + + @override + Future pickFile({ + String? dialogTitle, + String? initialDirectory, + FileType type = FileType.any, + List? allowedExtensions, + Function(FilePickerStatus)? onFileLoading, + int compressionQuality = 0, + AndroidOptions androidOptions = const AndroidOptions(), + WindowsOptions windowsOptions = const WindowsOptions(), + LinuxOptions linuxOptions = const LinuxOptions(), + WebOptions webOptions = const WebOptions(), + }) async { + final paths = await _pick( + isImage: _wantsImageOnly(type), + maxSelectNumber: 1, + suffixFilter: allowedExtensions, + ); + if (paths.isEmpty) return null; + return _OhosPlatformFile.fromPath(paths.first); + } + + @override + Future> pickFiles({ + String? dialogTitle, + String? initialDirectory, + FileType type = FileType.any, + List? allowedExtensions, + Function(FilePickerStatus)? onFileLoading, + int compressionQuality = 0, + AndroidOptions androidOptions = const AndroidOptions(), + WindowsOptions windowsOptions = const WindowsOptions(), + LinuxOptions linuxOptions = const LinuxOptions(), + WebOptions webOptions = const WebOptions(), + }) async { + final paths = await _pick( + isImage: _wantsImageOnly(type), + maxSelectNumber: allowedExtensions == null ? 0 : 0, // 0 = 不限数量 + suffixFilter: allowedExtensions, + ); + return paths.map(_OhosPlatformFile.fromPath).toList(growable: false); + } + + @override + Future> pickFileAndDirectoryPaths({ + String? dialogTitle, + String? initialDirectory, + FileType type = FileType.any, + List? allowedExtensions, + }) async { + return _pick( + isImage: false, + maxSelectNumber: 0, + suffixFilter: allowedExtensions, + ); + } + + @override + Future getDirectoryPath({ + String? dialogTitle, + String? initialDirectory, + AndroidOptions androidOptions = const AndroidOptions(), + WindowsOptions windowsOptions = const WindowsOptions(), + LinuxOptions linuxOptions = const LinuxOptions(), + WebOptions webOptions = const WebOptions(), + }) async { + // 鸿蒙 DocumentViewPicker 没有「选目录」语义,平台不支持,返回 null 让 UI 提示。 + return null; + } + + @override + Future saveFile({ + required String fileName, + required Uint8List bytes, + required String mimeType, + String? dialogTitle, + String? initialDirectory, + Function(FilePickerStatus)? onFileSaving, + WindowsOptions windowsOptions = const WindowsOptions(), + LinuxOptions linuxOptions = const LinuxOptions(), + WebOptions webOptions = const WebOptions(), + }) async { + try { + final savedUri = await _method.invokeMethod('saveFile', { + 'fileName': fileName, + 'bytes': bytes, + 'mimeType': mimeType, + }); + return savedUri == null ? null : Uri.parse(savedUri); + } on PlatformException { + return null; + } + } + + // --------------------------------------------------------------------------- + Future> _pick({ + required bool isImage, + required int maxSelectNumber, + List? suffixFilter, + }) async { + try { + final result = await _method.invokeMethod>('pick', { + 'isImage': isImage, + 'maxSelectNumber': maxSelectNumber, + 'suffixFilter': suffixFilter, + }); + if (result == null) return const []; + return result.cast(); + } on PlatformException { + return const []; + } + } + + /// 判断是否「只要图片」。FileType.image / media / video / any。 + bool _wantsImageOnly(FileType type) { + return type == FileType.image || type == FileType.media; + } +} + +/// PlatformFile 简易实现:通过文件路径构造 XFile、读取 size/bytes。 +base class _OhosPlatformFile extends PlatformFile { + _OhosPlatformFile._(this._path); + + factory _OhosPlatformFile.fromPath(String path) { + return _OhosPlatformFile._(path); + } + + final String _path; + + @override + String get name { + final path = _path; + final i = path.lastIndexOf('/'); + if (i < 0) return path; + final j = path.lastIndexOf('\\'); + if (j > i) return path.substring(j + 1); + return path.substring(i + 1); + } + + @override + Uri get uri => Uri.file(_path); + + @override + XFile get xFile => XFile(_path, name: name); + + @override + Future length() async => 0; // 长度由调用方按需懒加载 + + @override + Future readAsBytes() async { + // 通过 channel 读文件字节(鸿蒙端用 fileRead 读)。 + try { + final data = await OhosFilePickerPlatform._method.invokeMethod( + 'readFile', + {'path': _path}, + ); + return data ?? Uint8List(0); + } catch (_) { + return Uint8List(0); + } + } + + @override + Stream readAsByteStream() => const Stream.empty(); +} diff --git a/lib/src/data/astrobox/models/astrobox_models.freezed.dart b/lib/src/data/astrobox/models/astrobox_models.freezed.dart index 9101a560..04382f2d 100644 --- a/lib/src/data/astrobox/models/astrobox_models.freezed.dart +++ b/lib/src/data/astrobox/models/astrobox_models.freezed.dart @@ -1,6 +1,6 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file -// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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, unnecessary_question_mark part of 'astrobox_models.dart'; @@ -9,2291 +9,2217 @@ part of 'astrobox_models.dart'; // FreezedGenerator // ************************************************************************** -// GENERATED CODE - DO NOT MODIFY BY HAND -// dart format off T _$identity(T value) => value; -/// @nodoc -mixin _$AstroBoxIndexItem { - - String get id; String get name;@JsonKey(name: 'restype') AstroBoxResourceType get type; String get repoOwner; String get repoName; String get repoCommitHash; String get icon; String get cover; List get tags;@JsonKey(name: 'device_vendors') List get deviceVendors; List get devices;@JsonKey(name: 'paid_type') AstroBoxPaidType get paidType; -/// Create a copy of AstroBoxIndexItem -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxIndexItemCopyWith get copyWith => _$AstroBoxIndexItemCopyWithImpl(this as AstroBoxIndexItem, _$identity); +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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); - /// Serializes this AstroBoxIndexItem to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxIndexItem&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.type, type) || other.type == type)&&(identical(other.repoOwner, repoOwner) || other.repoOwner == repoOwner)&&(identical(other.repoName, repoName) || other.repoName == repoName)&&(identical(other.repoCommitHash, repoCommitHash) || other.repoCommitHash == repoCommitHash)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.cover, cover) || other.cover == cover)&&const DeepCollectionEquality().equals(other.tags, tags)&&const DeepCollectionEquality().equals(other.deviceVendors, deviceVendors)&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.paidType, paidType) || other.paidType == paidType)); +AstroBoxIndexItem _$AstroBoxIndexItemFromJson(Map json) { + return _AstroBoxIndexItem.fromJson(json); } -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,type,repoOwner,repoName,repoCommitHash,icon,cover,const DeepCollectionEquality().hash(tags),const DeepCollectionEquality().hash(deviceVendors),const DeepCollectionEquality().hash(devices),paidType); - -@override -String toString() { - return 'AstroBoxIndexItem(id: $id, name: $name, type: $type, repoOwner: $repoOwner, repoName: $repoName, repoCommitHash: $repoCommitHash, icon: $icon, cover: $cover, tags: $tags, deviceVendors: $deviceVendors, devices: $devices, paidType: $paidType)'; -} +/// @nodoc +mixin _$AstroBoxIndexItem { + String get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'restype') + AstroBoxResourceType get type => throw _privateConstructorUsedError; + String get repoOwner => throw _privateConstructorUsedError; + String get repoName => throw _privateConstructorUsedError; + String get repoCommitHash => throw _privateConstructorUsedError; + String get icon => throw _privateConstructorUsedError; + String get cover => throw _privateConstructorUsedError; + List get tags => throw _privateConstructorUsedError; + @JsonKey(name: 'device_vendors') + List get deviceVendors => throw _privateConstructorUsedError; + List get devices => throw _privateConstructorUsedError; + @JsonKey(name: 'paid_type') + AstroBoxPaidType get paidType => throw _privateConstructorUsedError; + /// Serializes this AstroBoxIndexItem to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxIndexItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxIndexItemCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxIndexItemCopyWith<$Res> { - factory $AstroBoxIndexItemCopyWith(AstroBoxIndexItem value, $Res Function(AstroBoxIndexItem) _then) = _$AstroBoxIndexItemCopyWithImpl; -@useResult -$Res call({ - String id, String name,@JsonKey(name: 'restype') AstroBoxResourceType type, String repoOwner, String repoName, String repoCommitHash, String icon, String cover, List tags,@JsonKey(name: 'device_vendors') List deviceVendors, List devices,@JsonKey(name: 'paid_type') AstroBoxPaidType paidType -}); - - - - +abstract class $AstroBoxIndexItemCopyWith<$Res> { + factory $AstroBoxIndexItemCopyWith( + AstroBoxIndexItem value, + $Res Function(AstroBoxIndexItem) then, + ) = _$AstroBoxIndexItemCopyWithImpl<$Res, AstroBoxIndexItem>; + @useResult + $Res call({ + String id, + String name, + @JsonKey(name: 'restype') AstroBoxResourceType type, + String repoOwner, + String repoName, + String repoCommitHash, + String icon, + String cover, + List tags, + @JsonKey(name: 'device_vendors') List deviceVendors, + List devices, + @JsonKey(name: 'paid_type') AstroBoxPaidType paidType, + }); } + /// @nodoc -class _$AstroBoxIndexItemCopyWithImpl<$Res> +class _$AstroBoxIndexItemCopyWithImpl<$Res, $Val extends AstroBoxIndexItem> implements $AstroBoxIndexItemCopyWith<$Res> { - _$AstroBoxIndexItemCopyWithImpl(this._self, this._then); - - final AstroBoxIndexItem _self; - final $Res Function(AstroBoxIndexItem) _then; - -/// Create a copy of AstroBoxIndexItem -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? type = null,Object? repoOwner = null,Object? repoName = null,Object? repoCommitHash = null,Object? icon = null,Object? cover = null,Object? tags = null,Object? deviceVendors = null,Object? devices = null,Object? paidType = null,}) { - return _then(AstroBoxIndexItem( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as AstroBoxResourceType,repoOwner: null == repoOwner ? _self.repoOwner : repoOwner // ignore: cast_nullable_to_non_nullable -as String,repoName: null == repoName ? _self.repoName : repoName // ignore: cast_nullable_to_non_nullable -as String,repoCommitHash: null == repoCommitHash ? _self.repoCommitHash : repoCommitHash // ignore: cast_nullable_to_non_nullable -as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String,cover: null == cover ? _self.cover : cover // ignore: cast_nullable_to_non_nullable -as String,tags: null == tags ? _self.tags : tags // ignore: cast_nullable_to_non_nullable -as List,deviceVendors: null == deviceVendors ? _self.deviceVendors : deviceVendors // ignore: cast_nullable_to_non_nullable -as List,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable -as List,paidType: null == paidType ? _self.paidType : paidType // ignore: cast_nullable_to_non_nullable -as AstroBoxPaidType, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxIndexItem]. -extension AstroBoxIndexItemPatterns on AstroBoxIndexItem { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxIndexItem value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxIndexItem() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxIndexItem value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxIndexItem(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxIndexItem value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxIndexItem() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String name, @JsonKey(name: 'restype') AstroBoxResourceType type, String repoOwner, String repoName, String repoCommitHash, String icon, String cover, List tags, @JsonKey(name: 'device_vendors') List deviceVendors, List devices, @JsonKey(name: 'paid_type') AstroBoxPaidType paidType)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxIndexItem() when $default != null: -return $default(_that.id,_that.name,_that.type,_that.repoOwner,_that.repoName,_that.repoCommitHash,_that.icon,_that.cover,_that.tags,_that.deviceVendors,_that.devices,_that.paidType);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String id, String name, @JsonKey(name: 'restype') AstroBoxResourceType type, String repoOwner, String repoName, String repoCommitHash, String icon, String cover, List tags, @JsonKey(name: 'device_vendors') List deviceVendors, List devices, @JsonKey(name: 'paid_type') AstroBoxPaidType paidType) $default,) {final _that = this; -switch (_that) { -case _AstroBoxIndexItem(): -return $default(_that.id,_that.name,_that.type,_that.repoOwner,_that.repoName,_that.repoCommitHash,_that.icon,_that.cover,_that.tags,_that.deviceVendors,_that.devices,_that.paidType);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String name, @JsonKey(name: 'restype') AstroBoxResourceType type, String repoOwner, String repoName, String repoCommitHash, String icon, String cover, List tags, @JsonKey(name: 'device_vendors') List deviceVendors, List devices, @JsonKey(name: 'paid_type') AstroBoxPaidType paidType)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxIndexItem() when $default != null: -return $default(_that.id,_that.name,_that.type,_that.repoOwner,_that.repoName,_that.repoCommitHash,_that.icon,_that.cover,_that.tags,_that.deviceVendors,_that.devices,_that.paidType);case _: - return null; - -} -} - + _$AstroBoxIndexItemCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxIndexItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? type = null, + Object? repoOwner = null, + Object? repoName = null, + Object? repoCommitHash = null, + Object? icon = null, + Object? cover = null, + Object? tags = null, + Object? deviceVendors = null, + Object? devices = null, + Object? paidType = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as AstroBoxResourceType, + repoOwner: null == repoOwner + ? _value.repoOwner + : repoOwner // ignore: cast_nullable_to_non_nullable + as String, + repoName: null == repoName + ? _value.repoName + : repoName // ignore: cast_nullable_to_non_nullable + as String, + repoCommitHash: null == repoCommitHash + ? _value.repoCommitHash + : repoCommitHash // ignore: cast_nullable_to_non_nullable + as String, + icon: null == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String, + cover: null == cover + ? _value.cover + : cover // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value.tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + deviceVendors: null == deviceVendors + ? _value.deviceVendors + : deviceVendors // ignore: cast_nullable_to_non_nullable + as List, + devices: null == devices + ? _value.devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + paidType: null == paidType + ? _value.paidType + : paidType // ignore: cast_nullable_to_non_nullable + as AstroBoxPaidType, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxIndexItem implements AstroBoxIndexItem { - const _AstroBoxIndexItem({required this.id, required this.name, @JsonKey(name: 'restype') required this.type, required this.repoOwner, required this.repoName, required this.repoCommitHash, required this.icon, required this.cover, List tags = const [], @JsonKey(name: 'device_vendors') List deviceVendors = const [], List devices = const [], @JsonKey(name: 'paid_type') required this.paidType}): _tags = tags,_deviceVendors = deviceVendors,_devices = devices; - factory _AstroBoxIndexItem.fromJson(Map json) => _$AstroBoxIndexItemFromJson(json); - -@override final String id; -@override final String name; -@override@JsonKey(name: 'restype') final AstroBoxResourceType type; -@override final String repoOwner; -@override final String repoName; -@override final String repoCommitHash; -@override final String icon; -@override final String cover; - final List _tags; -@override@JsonKey() List get tags { - if (_tags is EqualUnmodifiableListView) return _tags; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_tags); -} - - final List _deviceVendors; -@override@JsonKey(name: 'device_vendors') List get deviceVendors { - if (_deviceVendors is EqualUnmodifiableListView) return _deviceVendors; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_deviceVendors); -} - - final List _devices; -@override@JsonKey() List get devices { - if (_devices is EqualUnmodifiableListView) return _devices; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_devices); -} - -@override@JsonKey(name: 'paid_type') final AstroBoxPaidType paidType; - -/// Create a copy of AstroBoxIndexItem -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxIndexItemCopyWith<_AstroBoxIndexItem> get copyWith => __$AstroBoxIndexItemCopyWithImpl<_AstroBoxIndexItem>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxIndexItemToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxIndexItem&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.type, type) || other.type == type)&&(identical(other.repoOwner, repoOwner) || other.repoOwner == repoOwner)&&(identical(other.repoName, repoName) || other.repoName == repoName)&&(identical(other.repoCommitHash, repoCommitHash) || other.repoCommitHash == repoCommitHash)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.cover, cover) || other.cover == cover)&&const DeepCollectionEquality().equals(other._tags, _tags)&&const DeepCollectionEquality().equals(other._deviceVendors, _deviceVendors)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.paidType, paidType) || other.paidType == paidType)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,type,repoOwner,repoName,repoCommitHash,icon,cover,const DeepCollectionEquality().hash(_tags),const DeepCollectionEquality().hash(_deviceVendors),const DeepCollectionEquality().hash(_devices),paidType); - -@override -String toString() { - return 'AstroBoxIndexItem(id: $id, name: $name, type: $type, repoOwner: $repoOwner, repoName: $repoName, repoCommitHash: $repoCommitHash, icon: $icon, cover: $cover, tags: $tags, deviceVendors: $deviceVendors, devices: $devices, paidType: $paidType)'; -} - - +abstract class _$$AstroBoxIndexItemImplCopyWith<$Res> + implements $AstroBoxIndexItemCopyWith<$Res> { + factory _$$AstroBoxIndexItemImplCopyWith( + _$AstroBoxIndexItemImpl value, + $Res Function(_$AstroBoxIndexItemImpl) then, + ) = __$$AstroBoxIndexItemImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + String name, + @JsonKey(name: 'restype') AstroBoxResourceType type, + String repoOwner, + String repoName, + String repoCommitHash, + String icon, + String cover, + List tags, + @JsonKey(name: 'device_vendors') List deviceVendors, + List devices, + @JsonKey(name: 'paid_type') AstroBoxPaidType paidType, + }); } /// @nodoc -abstract mixin class _$AstroBoxIndexItemCopyWith<$Res> implements $AstroBoxIndexItemCopyWith<$Res> { - factory _$AstroBoxIndexItemCopyWith(_AstroBoxIndexItem value, $Res Function(_AstroBoxIndexItem) _then) = __$AstroBoxIndexItemCopyWithImpl; -@override @useResult -$Res call({ - String id, String name,@JsonKey(name: 'restype') AstroBoxResourceType type, String repoOwner, String repoName, String repoCommitHash, String icon, String cover, List tags,@JsonKey(name: 'device_vendors') List deviceVendors, List devices,@JsonKey(name: 'paid_type') AstroBoxPaidType paidType -}); - - - - -} -/// @nodoc -class __$AstroBoxIndexItemCopyWithImpl<$Res> - implements _$AstroBoxIndexItemCopyWith<$Res> { - __$AstroBoxIndexItemCopyWithImpl(this._self, this._then); - - final _AstroBoxIndexItem _self; - final $Res Function(_AstroBoxIndexItem) _then; - -/// Create a copy of AstroBoxIndexItem -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? type = null,Object? repoOwner = null,Object? repoName = null,Object? repoCommitHash = null,Object? icon = null,Object? cover = null,Object? tags = null,Object? deviceVendors = null,Object? devices = null,Object? paidType = null,}) { - return _then(_AstroBoxIndexItem( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable -as AstroBoxResourceType,repoOwner: null == repoOwner ? _self.repoOwner : repoOwner // ignore: cast_nullable_to_non_nullable -as String,repoName: null == repoName ? _self.repoName : repoName // ignore: cast_nullable_to_non_nullable -as String,repoCommitHash: null == repoCommitHash ? _self.repoCommitHash : repoCommitHash // ignore: cast_nullable_to_non_nullable -as String,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String,cover: null == cover ? _self.cover : cover // ignore: cast_nullable_to_non_nullable -as String,tags: null == tags ? _self._tags : tags // ignore: cast_nullable_to_non_nullable -as List,deviceVendors: null == deviceVendors ? _self._deviceVendors : deviceVendors // ignore: cast_nullable_to_non_nullable -as List,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable -as List,paidType: null == paidType ? _self.paidType : paidType // ignore: cast_nullable_to_non_nullable -as AstroBoxPaidType, - )); +class __$$AstroBoxIndexItemImplCopyWithImpl<$Res> + extends _$AstroBoxIndexItemCopyWithImpl<$Res, _$AstroBoxIndexItemImpl> + implements _$$AstroBoxIndexItemImplCopyWith<$Res> { + __$$AstroBoxIndexItemImplCopyWithImpl( + _$AstroBoxIndexItemImpl _value, + $Res Function(_$AstroBoxIndexItemImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxIndexItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? type = null, + Object? repoOwner = null, + Object? repoName = null, + Object? repoCommitHash = null, + Object? icon = null, + Object? cover = null, + Object? tags = null, + Object? deviceVendors = null, + Object? devices = null, + Object? paidType = null, + }) { + return _then( + _$AstroBoxIndexItemImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + type: null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as AstroBoxResourceType, + repoOwner: null == repoOwner + ? _value.repoOwner + : repoOwner // ignore: cast_nullable_to_non_nullable + as String, + repoName: null == repoName + ? _value.repoName + : repoName // ignore: cast_nullable_to_non_nullable + as String, + repoCommitHash: null == repoCommitHash + ? _value.repoCommitHash + : repoCommitHash // ignore: cast_nullable_to_non_nullable + as String, + icon: null == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String, + cover: null == cover + ? _value.cover + : cover // ignore: cast_nullable_to_non_nullable + as String, + tags: null == tags + ? _value._tags + : tags // ignore: cast_nullable_to_non_nullable + as List, + deviceVendors: null == deviceVendors + ? _value._deviceVendors + : deviceVendors // ignore: cast_nullable_to_non_nullable + as List, + devices: null == devices + ? _value._devices + : devices // ignore: cast_nullable_to_non_nullable + as List, + paidType: null == paidType + ? _value.paidType + : paidType // ignore: cast_nullable_to_non_nullable + as AstroBoxPaidType, + ), + ); + } } - +/// @nodoc +@JsonSerializable() +class _$AstroBoxIndexItemImpl implements _AstroBoxIndexItem { + const _$AstroBoxIndexItemImpl({ + required this.id, + required this.name, + @JsonKey(name: 'restype') required this.type, + required this.repoOwner, + required this.repoName, + required this.repoCommitHash, + required this.icon, + required this.cover, + final List tags = const [], + @JsonKey(name: 'device_vendors') + final List deviceVendors = const [], + final List devices = const [], + @JsonKey(name: 'paid_type') required this.paidType, + }) : _tags = tags, + _deviceVendors = deviceVendors, + _devices = devices; + + factory _$AstroBoxIndexItemImpl.fromJson(Map json) => + _$$AstroBoxIndexItemImplFromJson(json); + + @override + final String id; + @override + final String name; + @override + @JsonKey(name: 'restype') + final AstroBoxResourceType type; + @override + final String repoOwner; + @override + final String repoName; + @override + final String repoCommitHash; + @override + final String icon; + @override + final String cover; + final List _tags; + @override + @JsonKey() + List get tags { + if (_tags is EqualUnmodifiableListView) return _tags; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_tags); + } + + final List _deviceVendors; + @override + @JsonKey(name: 'device_vendors') + List get deviceVendors { + if (_deviceVendors is EqualUnmodifiableListView) return _deviceVendors; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_deviceVendors); + } + + final List _devices; + @override + @JsonKey() + List get devices { + if (_devices is EqualUnmodifiableListView) return _devices; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_devices); + } + + @override + @JsonKey(name: 'paid_type') + final AstroBoxPaidType paidType; + + @override + String toString() { + return 'AstroBoxIndexItem(id: $id, name: $name, type: $type, repoOwner: $repoOwner, repoName: $repoName, repoCommitHash: $repoCommitHash, icon: $icon, cover: $cover, tags: $tags, deviceVendors: $deviceVendors, devices: $devices, paidType: $paidType)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxIndexItemImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.type, type) || other.type == type) && + (identical(other.repoOwner, repoOwner) || + other.repoOwner == repoOwner) && + (identical(other.repoName, repoName) || + other.repoName == repoName) && + (identical(other.repoCommitHash, repoCommitHash) || + other.repoCommitHash == repoCommitHash) && + (identical(other.icon, icon) || other.icon == icon) && + (identical(other.cover, cover) || other.cover == cover) && + const DeepCollectionEquality().equals(other._tags, _tags) && + const DeepCollectionEquality().equals( + other._deviceVendors, + _deviceVendors, + ) && + const DeepCollectionEquality().equals(other._devices, _devices) && + (identical(other.paidType, paidType) || + other.paidType == paidType)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + name, + type, + repoOwner, + repoName, + repoCommitHash, + icon, + cover, + const DeepCollectionEquality().hash(_tags), + const DeepCollectionEquality().hash(_deviceVendors), + const DeepCollectionEquality().hash(_devices), + paidType, + ); + + /// Create a copy of AstroBoxIndexItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxIndexItemImplCopyWith<_$AstroBoxIndexItemImpl> get copyWith => + __$$AstroBoxIndexItemImplCopyWithImpl<_$AstroBoxIndexItemImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxIndexItemImplToJson(this); + } +} + +abstract class _AstroBoxIndexItem implements AstroBoxIndexItem { + const factory _AstroBoxIndexItem({ + required final String id, + required final String name, + @JsonKey(name: 'restype') required final AstroBoxResourceType type, + required final String repoOwner, + required final String repoName, + required final String repoCommitHash, + required final String icon, + required final String cover, + final List tags, + @JsonKey(name: 'device_vendors') final List deviceVendors, + final List devices, + @JsonKey(name: 'paid_type') required final AstroBoxPaidType paidType, + }) = _$AstroBoxIndexItemImpl; + + factory _AstroBoxIndexItem.fromJson(Map json) = + _$AstroBoxIndexItemImpl.fromJson; + + @override + String get id; + @override + String get name; + @override + @JsonKey(name: 'restype') + AstroBoxResourceType get type; + @override + String get repoOwner; + @override + String get repoName; + @override + String get repoCommitHash; + @override + String get icon; + @override + String get cover; + @override + List get tags; + @override + @JsonKey(name: 'device_vendors') + List get deviceVendors; + @override + List get devices; + @override + @JsonKey(name: 'paid_type') + AstroBoxPaidType get paidType; + + /// Create a copy of AstroBoxIndexItem + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxIndexItemImplCopyWith<_$AstroBoxIndexItemImpl> get copyWith => + throw _privateConstructorUsedError; +} + +AstroBoxManifest _$AstroBoxManifestFromJson(Map json) { + return _AstroBoxManifest.fromJson(json); } - /// @nodoc mixin _$AstroBoxManifest { - - AstroBoxManifestItem get item; List get links; Map get downloads; Map get ext; -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxManifestCopyWith get copyWith => _$AstroBoxManifestCopyWithImpl(this as AstroBoxManifest, _$identity); + AstroBoxManifestItem get item => throw _privateConstructorUsedError; + List get links => throw _privateConstructorUsedError; + Map get downloads => + throw _privateConstructorUsedError; + Map get ext => throw _privateConstructorUsedError; /// Serializes this AstroBoxManifest to a JSON map. - Map toJson(); - + Map toJson() => throw _privateConstructorUsedError; -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxManifest&&(identical(other.item, item) || other.item == item)&&const DeepCollectionEquality().equals(other.links, links)&&const DeepCollectionEquality().equals(other.downloads, downloads)&&const DeepCollectionEquality().equals(other.ext, ext)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,item,const DeepCollectionEquality().hash(links),const DeepCollectionEquality().hash(downloads),const DeepCollectionEquality().hash(ext)); - -@override -String toString() { - return 'AstroBoxManifest(item: $item, links: $links, downloads: $downloads, ext: $ext)'; + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxManifestCopyWith get copyWith => + throw _privateConstructorUsedError; } +/// @nodoc +abstract class $AstroBoxManifestCopyWith<$Res> { + factory $AstroBoxManifestCopyWith( + AstroBoxManifest value, + $Res Function(AstroBoxManifest) then, + ) = _$AstroBoxManifestCopyWithImpl<$Res, AstroBoxManifest>; + @useResult + $Res call({ + AstroBoxManifestItem item, + List links, + Map downloads, + Map ext, + }); + $AstroBoxManifestItemCopyWith<$Res> get item; } /// @nodoc -abstract mixin class $AstroBoxManifestCopyWith<$Res> { - factory $AstroBoxManifestCopyWith(AstroBoxManifest value, $Res Function(AstroBoxManifest) _then) = _$AstroBoxManifestCopyWithImpl; -@useResult -$Res call({ - AstroBoxManifestItem item, List links, Map downloads, Map ext -}); - - -$AstroBoxManifestItemCopyWith<$Res> get item; - +class _$AstroBoxManifestCopyWithImpl<$Res, $Val extends AstroBoxManifest> + implements $AstroBoxManifestCopyWith<$Res> { + _$AstroBoxManifestCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? item = null, + Object? links = null, + Object? downloads = null, + Object? ext = null, + }) { + return _then( + _value.copyWith( + item: null == item + ? _value.item + : item // ignore: cast_nullable_to_non_nullable + as AstroBoxManifestItem, + links: null == links + ? _value.links + : links // ignore: cast_nullable_to_non_nullable + as List, + downloads: null == downloads + ? _value.downloads + : downloads // ignore: cast_nullable_to_non_nullable + as Map, + ext: null == ext + ? _value.ext + : ext // ignore: cast_nullable_to_non_nullable + as Map, + ) + as $Val, + ); + } + + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $AstroBoxManifestItemCopyWith<$Res> get item { + return $AstroBoxManifestItemCopyWith<$Res>(_value.item, (value) { + return _then(_value.copyWith(item: value) as $Val); + }); + } } + /// @nodoc -class _$AstroBoxManifestCopyWithImpl<$Res> +abstract class _$$AstroBoxManifestImplCopyWith<$Res> implements $AstroBoxManifestCopyWith<$Res> { - _$AstroBoxManifestCopyWithImpl(this._self, this._then); - - final AstroBoxManifest _self; - final $Res Function(AstroBoxManifest) _then; - -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? item = null,Object? links = null,Object? downloads = null,Object? ext = null,}) { - return _then(AstroBoxManifest( -item: null == item ? _self.item : item // ignore: cast_nullable_to_non_nullable -as AstroBoxManifestItem,links: null == links ? _self.links : links // ignore: cast_nullable_to_non_nullable -as List,downloads: null == downloads ? _self.downloads : downloads // ignore: cast_nullable_to_non_nullable -as Map,ext: null == ext ? _self.ext : ext // ignore: cast_nullable_to_non_nullable -as Map, - )); -} -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$AstroBoxManifestItemCopyWith<$Res> get item { - - return $AstroBoxManifestItemCopyWith<$Res>(_self.item, (value) { - return _then(_self.copyWith(item: value)); + factory _$$AstroBoxManifestImplCopyWith( + _$AstroBoxManifestImpl value, + $Res Function(_$AstroBoxManifestImpl) then, + ) = __$$AstroBoxManifestImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + AstroBoxManifestItem item, + List links, + Map downloads, + Map ext, }); -} -} - - -/// Adds pattern-matching-related methods to [AstroBoxManifest]. -extension AstroBoxManifestPatterns on AstroBoxManifest { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxManifest value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxManifest() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxManifest value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifest(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxManifest value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifest() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( AstroBoxManifestItem item, List links, Map downloads, Map ext)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxManifest() when $default != null: -return $default(_that.item,_that.links,_that.downloads,_that.ext);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( AstroBoxManifestItem item, List links, Map downloads, Map ext) $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifest(): -return $default(_that.item,_that.links,_that.downloads,_that.ext);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( AstroBoxManifestItem item, List links, Map downloads, Map ext)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifest() when $default != null: -return $default(_that.item,_that.links,_that.downloads,_that.ext);case _: - return null; - -} -} + @override + $AstroBoxManifestItemCopyWith<$Res> get item; } /// @nodoc -@JsonSerializable() - -class _AstroBoxManifest implements AstroBoxManifest { - const _AstroBoxManifest({required this.item, List links = const [], Map downloads = const {}, Map ext = const {}}): _links = links,_downloads = downloads,_ext = ext; - factory _AstroBoxManifest.fromJson(Map json) => _$AstroBoxManifestFromJson(json); - -@override final AstroBoxManifestItem item; - final List _links; -@override@JsonKey() List get links { - if (_links is EqualUnmodifiableListView) return _links; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_links); -} - - final Map _downloads; -@override@JsonKey() Map get downloads { - if (_downloads is EqualUnmodifiableMapView) return _downloads; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_downloads); -} - - final Map _ext; -@override@JsonKey() Map get ext { - if (_ext is EqualUnmodifiableMapView) return _ext; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_ext); +class __$$AstroBoxManifestImplCopyWithImpl<$Res> + extends _$AstroBoxManifestCopyWithImpl<$Res, _$AstroBoxManifestImpl> + implements _$$AstroBoxManifestImplCopyWith<$Res> { + __$$AstroBoxManifestImplCopyWithImpl( + _$AstroBoxManifestImpl _value, + $Res Function(_$AstroBoxManifestImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? item = null, + Object? links = null, + Object? downloads = null, + Object? ext = null, + }) { + return _then( + _$AstroBoxManifestImpl( + item: null == item + ? _value.item + : item // ignore: cast_nullable_to_non_nullable + as AstroBoxManifestItem, + links: null == links + ? _value._links + : links // ignore: cast_nullable_to_non_nullable + as List, + downloads: null == downloads + ? _value._downloads + : downloads // ignore: cast_nullable_to_non_nullable + as Map, + ext: null == ext + ? _value._ext + : ext // ignore: cast_nullable_to_non_nullable + as Map, + ), + ); + } } - -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxManifestCopyWith<_AstroBoxManifest> get copyWith => __$AstroBoxManifestCopyWithImpl<_AstroBoxManifest>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxManifestToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxManifest&&(identical(other.item, item) || other.item == item)&&const DeepCollectionEquality().equals(other._links, _links)&&const DeepCollectionEquality().equals(other._downloads, _downloads)&&const DeepCollectionEquality().equals(other._ext, _ext)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,item,const DeepCollectionEquality().hash(_links),const DeepCollectionEquality().hash(_downloads),const DeepCollectionEquality().hash(_ext)); - -@override -String toString() { - return 'AstroBoxManifest(item: $item, links: $links, downloads: $downloads, ext: $ext)'; -} - - -} - -/// @nodoc -abstract mixin class _$AstroBoxManifestCopyWith<$Res> implements $AstroBoxManifestCopyWith<$Res> { - factory _$AstroBoxManifestCopyWith(_AstroBoxManifest value, $Res Function(_AstroBoxManifest) _then) = __$AstroBoxManifestCopyWithImpl; -@override @useResult -$Res call({ - AstroBoxManifestItem item, List links, Map downloads, Map ext -}); - - -@override $AstroBoxManifestItemCopyWith<$Res> get item; - -} /// @nodoc -class __$AstroBoxManifestCopyWithImpl<$Res> - implements _$AstroBoxManifestCopyWith<$Res> { - __$AstroBoxManifestCopyWithImpl(this._self, this._then); - - final _AstroBoxManifest _self; - final $Res Function(_AstroBoxManifest) _then; - -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? item = null,Object? links = null,Object? downloads = null,Object? ext = null,}) { - return _then(_AstroBoxManifest( -item: null == item ? _self.item : item // ignore: cast_nullable_to_non_nullable -as AstroBoxManifestItem,links: null == links ? _self._links : links // ignore: cast_nullable_to_non_nullable -as List,downloads: null == downloads ? _self._downloads : downloads // ignore: cast_nullable_to_non_nullable -as Map,ext: null == ext ? _self._ext : ext // ignore: cast_nullable_to_non_nullable -as Map, - )); -} - -/// Create a copy of AstroBoxManifest -/// with the given fields replaced by the non-null parameter values. -@override -@pragma('vm:prefer-inline') -$AstroBoxManifestItemCopyWith<$Res> get item { - - return $AstroBoxManifestItemCopyWith<$Res>(_self.item, (value) { - return _then(_self.copyWith(item: value)); - }); -} +@JsonSerializable() +class _$AstroBoxManifestImpl implements _AstroBoxManifest { + const _$AstroBoxManifestImpl({ + required this.item, + final List links = const [], + final Map downloads = const {}, + final Map ext = const {}, + }) : _links = links, + _downloads = downloads, + _ext = ext; + + factory _$AstroBoxManifestImpl.fromJson(Map json) => + _$$AstroBoxManifestImplFromJson(json); + + @override + final AstroBoxManifestItem item; + final List _links; + @override + @JsonKey() + List get links { + if (_links is EqualUnmodifiableListView) return _links; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_links); + } + + final Map _downloads; + @override + @JsonKey() + Map get downloads { + if (_downloads is EqualUnmodifiableMapView) return _downloads; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_downloads); + } + + final Map _ext; + @override + @JsonKey() + Map get ext { + if (_ext is EqualUnmodifiableMapView) return _ext; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_ext); + } + + @override + String toString() { + return 'AstroBoxManifest(item: $item, links: $links, downloads: $downloads, ext: $ext)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxManifestImpl && + (identical(other.item, item) || other.item == item) && + const DeepCollectionEquality().equals(other._links, _links) && + const DeepCollectionEquality().equals( + other._downloads, + _downloads, + ) && + const DeepCollectionEquality().equals(other._ext, _ext)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + item, + const DeepCollectionEquality().hash(_links), + const DeepCollectionEquality().hash(_downloads), + const DeepCollectionEquality().hash(_ext), + ); + + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxManifestImplCopyWith<_$AstroBoxManifestImpl> get copyWith => + __$$AstroBoxManifestImplCopyWithImpl<_$AstroBoxManifestImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxManifestImplToJson(this); + } +} + +abstract class _AstroBoxManifest implements AstroBoxManifest { + const factory _AstroBoxManifest({ + required final AstroBoxManifestItem item, + final List links, + final Map downloads, + final Map ext, + }) = _$AstroBoxManifestImpl; + + factory _AstroBoxManifest.fromJson(Map json) = + _$AstroBoxManifestImpl.fromJson; + + @override + AstroBoxManifestItem get item; + @override + List get links; + @override + Map get downloads; + @override + Map get ext; + + /// Create a copy of AstroBoxManifest + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxManifestImplCopyWith<_$AstroBoxManifestImpl> get copyWith => + throw _privateConstructorUsedError; +} + +AstroBoxManifestItem _$AstroBoxManifestItemFromJson(Map json) { + return _AstroBoxManifestItem.fromJson(json); } - /// @nodoc mixin _$AstroBoxManifestItem { - - String get id; AstroBoxResourceType get restype; String get name; String get description; String? get descriptionHtml; String? get descriptionBaseUrl; List get preview; String get icon; String get cover; AstroBoxPaidType? get paidType; List get author; -/// Create a copy of AstroBoxManifestItem -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxManifestItemCopyWith get copyWith => _$AstroBoxManifestItemCopyWithImpl(this as AstroBoxManifestItem, _$identity); + String get id => throw _privateConstructorUsedError; + AstroBoxResourceType get restype => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + String? get descriptionHtml => throw _privateConstructorUsedError; + String? get descriptionBaseUrl => throw _privateConstructorUsedError; + List get preview => throw _privateConstructorUsedError; + String get icon => throw _privateConstructorUsedError; + String get cover => throw _privateConstructorUsedError; + AstroBoxPaidType? get paidType => throw _privateConstructorUsedError; + List get author => throw _privateConstructorUsedError; /// Serializes this AstroBoxManifestItem to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxManifestItem&&(identical(other.id, id) || other.id == id)&&(identical(other.restype, restype) || other.restype == restype)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.descriptionHtml, descriptionHtml) || other.descriptionHtml == descriptionHtml)&&(identical(other.descriptionBaseUrl, descriptionBaseUrl) || other.descriptionBaseUrl == descriptionBaseUrl)&&const DeepCollectionEquality().equals(other.preview, preview)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.cover, cover) || other.cover == cover)&&(identical(other.paidType, paidType) || other.paidType == paidType)&&const DeepCollectionEquality().equals(other.author, author)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,restype,name,description,descriptionHtml,descriptionBaseUrl,const DeepCollectionEquality().hash(preview),icon,cover,paidType,const DeepCollectionEquality().hash(author)); - -@override -String toString() { - return 'AstroBoxManifestItem(id: $id, restype: $restype, name: $name, description: $description, descriptionHtml: $descriptionHtml, descriptionBaseUrl: $descriptionBaseUrl, preview: $preview, icon: $icon, cover: $cover, paidType: $paidType, author: $author)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxManifestItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxManifestItemCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxManifestItemCopyWith<$Res> { - factory $AstroBoxManifestItemCopyWith(AstroBoxManifestItem value, $Res Function(AstroBoxManifestItem) _then) = _$AstroBoxManifestItemCopyWithImpl; -@useResult -$Res call({ - String id, AstroBoxResourceType restype, String name, String description, String? descriptionHtml, String? descriptionBaseUrl, List preview, String icon, String cover, AstroBoxPaidType? paidType, List author -}); - - - - +abstract class $AstroBoxManifestItemCopyWith<$Res> { + factory $AstroBoxManifestItemCopyWith( + AstroBoxManifestItem value, + $Res Function(AstroBoxManifestItem) then, + ) = _$AstroBoxManifestItemCopyWithImpl<$Res, AstroBoxManifestItem>; + @useResult + $Res call({ + String id, + AstroBoxResourceType restype, + String name, + String description, + String? descriptionHtml, + String? descriptionBaseUrl, + List preview, + String icon, + String cover, + AstroBoxPaidType? paidType, + List author, + }); } + /// @nodoc -class _$AstroBoxManifestItemCopyWithImpl<$Res> +class _$AstroBoxManifestItemCopyWithImpl< + $Res, + $Val extends AstroBoxManifestItem +> implements $AstroBoxManifestItemCopyWith<$Res> { - _$AstroBoxManifestItemCopyWithImpl(this._self, this._then); - - final AstroBoxManifestItem _self; - final $Res Function(AstroBoxManifestItem) _then; - -/// Create a copy of AstroBoxManifestItem -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? restype = null,Object? name = null,Object? description = null,Object? descriptionHtml = freezed,Object? descriptionBaseUrl = freezed,Object? preview = null,Object? icon = null,Object? cover = null,Object? paidType = freezed,Object? author = null,}) { - return _then(AstroBoxManifestItem( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,restype: null == restype ? _self.restype : restype // ignore: cast_nullable_to_non_nullable -as AstroBoxResourceType,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String,descriptionHtml: freezed == descriptionHtml ? _self.descriptionHtml : descriptionHtml // ignore: cast_nullable_to_non_nullable -as String?,descriptionBaseUrl: freezed == descriptionBaseUrl ? _self.descriptionBaseUrl : descriptionBaseUrl // ignore: cast_nullable_to_non_nullable -as String?,preview: null == preview ? _self.preview : preview // ignore: cast_nullable_to_non_nullable -as List,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String,cover: null == cover ? _self.cover : cover // ignore: cast_nullable_to_non_nullable -as String,paidType: freezed == paidType ? _self.paidType : paidType // ignore: cast_nullable_to_non_nullable -as AstroBoxPaidType?,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable -as List, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxManifestItem]. -extension AstroBoxManifestItemPatterns on AstroBoxManifestItem { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxManifestItem value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxManifestItem() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxManifestItem value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestItem(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxManifestItem value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestItem() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, AstroBoxResourceType restype, String name, String description, String? descriptionHtml, String? descriptionBaseUrl, List preview, String icon, String cover, AstroBoxPaidType? paidType, List author)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxManifestItem() when $default != null: -return $default(_that.id,_that.restype,_that.name,_that.description,_that.descriptionHtml,_that.descriptionBaseUrl,_that.preview,_that.icon,_that.cover,_that.paidType,_that.author);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String id, AstroBoxResourceType restype, String name, String description, String? descriptionHtml, String? descriptionBaseUrl, List preview, String icon, String cover, AstroBoxPaidType? paidType, List author) $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestItem(): -return $default(_that.id,_that.restype,_that.name,_that.description,_that.descriptionHtml,_that.descriptionBaseUrl,_that.preview,_that.icon,_that.cover,_that.paidType,_that.author);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, AstroBoxResourceType restype, String name, String description, String? descriptionHtml, String? descriptionBaseUrl, List preview, String icon, String cover, AstroBoxPaidType? paidType, List author)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestItem() when $default != null: -return $default(_that.id,_that.restype,_that.name,_that.description,_that.descriptionHtml,_that.descriptionBaseUrl,_that.preview,_that.icon,_that.cover,_that.paidType,_that.author);case _: - return null; - -} -} - + _$AstroBoxManifestItemCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxManifestItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? restype = null, + Object? name = null, + Object? description = null, + Object? descriptionHtml = freezed, + Object? descriptionBaseUrl = freezed, + Object? preview = null, + Object? icon = null, + Object? cover = null, + Object? paidType = freezed, + Object? author = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + restype: null == restype + ? _value.restype + : restype // ignore: cast_nullable_to_non_nullable + as AstroBoxResourceType, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + descriptionHtml: freezed == descriptionHtml + ? _value.descriptionHtml + : descriptionHtml // ignore: cast_nullable_to_non_nullable + as String?, + descriptionBaseUrl: freezed == descriptionBaseUrl + ? _value.descriptionBaseUrl + : descriptionBaseUrl // ignore: cast_nullable_to_non_nullable + as String?, + preview: null == preview + ? _value.preview + : preview // ignore: cast_nullable_to_non_nullable + as List, + icon: null == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String, + cover: null == cover + ? _value.cover + : cover // ignore: cast_nullable_to_non_nullable + as String, + paidType: freezed == paidType + ? _value.paidType + : paidType // ignore: cast_nullable_to_non_nullable + as AstroBoxPaidType?, + author: null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxManifestItem implements AstroBoxManifestItem { - const _AstroBoxManifestItem({required this.id, required this.restype, required this.name, required this.description, this.descriptionHtml, this.descriptionBaseUrl, List preview = const [], required this.icon, required this.cover, this.paidType, List author = const []}): _preview = preview,_author = author; - factory _AstroBoxManifestItem.fromJson(Map json) => _$AstroBoxManifestItemFromJson(json); - -@override final String id; -@override final AstroBoxResourceType restype; -@override final String name; -@override final String description; -@override final String? descriptionHtml; -@override final String? descriptionBaseUrl; - final List _preview; -@override@JsonKey() List get preview { - if (_preview is EqualUnmodifiableListView) return _preview; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_preview); -} - -@override final String icon; -@override final String cover; -@override final AstroBoxPaidType? paidType; - final List _author; -@override@JsonKey() List get author { - if (_author is EqualUnmodifiableListView) return _author; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_author); -} - - -/// Create a copy of AstroBoxManifestItem -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxManifestItemCopyWith<_AstroBoxManifestItem> get copyWith => __$AstroBoxManifestItemCopyWithImpl<_AstroBoxManifestItem>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxManifestItemToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxManifestItem&&(identical(other.id, id) || other.id == id)&&(identical(other.restype, restype) || other.restype == restype)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.descriptionHtml, descriptionHtml) || other.descriptionHtml == descriptionHtml)&&(identical(other.descriptionBaseUrl, descriptionBaseUrl) || other.descriptionBaseUrl == descriptionBaseUrl)&&const DeepCollectionEquality().equals(other._preview, _preview)&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.cover, cover) || other.cover == cover)&&(identical(other.paidType, paidType) || other.paidType == paidType)&&const DeepCollectionEquality().equals(other._author, _author)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,restype,name,description,descriptionHtml,descriptionBaseUrl,const DeepCollectionEquality().hash(_preview),icon,cover,paidType,const DeepCollectionEquality().hash(_author)); - -@override -String toString() { - return 'AstroBoxManifestItem(id: $id, restype: $restype, name: $name, description: $description, descriptionHtml: $descriptionHtml, descriptionBaseUrl: $descriptionBaseUrl, preview: $preview, icon: $icon, cover: $cover, paidType: $paidType, author: $author)'; -} - - +abstract class _$$AstroBoxManifestItemImplCopyWith<$Res> + implements $AstroBoxManifestItemCopyWith<$Res> { + factory _$$AstroBoxManifestItemImplCopyWith( + _$AstroBoxManifestItemImpl value, + $Res Function(_$AstroBoxManifestItemImpl) then, + ) = __$$AstroBoxManifestItemImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + AstroBoxResourceType restype, + String name, + String description, + String? descriptionHtml, + String? descriptionBaseUrl, + List preview, + String icon, + String cover, + AstroBoxPaidType? paidType, + List author, + }); } /// @nodoc -abstract mixin class _$AstroBoxManifestItemCopyWith<$Res> implements $AstroBoxManifestItemCopyWith<$Res> { - factory _$AstroBoxManifestItemCopyWith(_AstroBoxManifestItem value, $Res Function(_AstroBoxManifestItem) _then) = __$AstroBoxManifestItemCopyWithImpl; -@override @useResult -$Res call({ - String id, AstroBoxResourceType restype, String name, String description, String? descriptionHtml, String? descriptionBaseUrl, List preview, String icon, String cover, AstroBoxPaidType? paidType, List author -}); - - - - -} -/// @nodoc -class __$AstroBoxManifestItemCopyWithImpl<$Res> - implements _$AstroBoxManifestItemCopyWith<$Res> { - __$AstroBoxManifestItemCopyWithImpl(this._self, this._then); - - final _AstroBoxManifestItem _self; - final $Res Function(_AstroBoxManifestItem) _then; - -/// Create a copy of AstroBoxManifestItem -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? restype = null,Object? name = null,Object? description = null,Object? descriptionHtml = freezed,Object? descriptionBaseUrl = freezed,Object? preview = null,Object? icon = null,Object? cover = null,Object? paidType = freezed,Object? author = null,}) { - return _then(_AstroBoxManifestItem( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,restype: null == restype ? _self.restype : restype // ignore: cast_nullable_to_non_nullable -as AstroBoxResourceType,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String,descriptionHtml: freezed == descriptionHtml ? _self.descriptionHtml : descriptionHtml // ignore: cast_nullable_to_non_nullable -as String?,descriptionBaseUrl: freezed == descriptionBaseUrl ? _self.descriptionBaseUrl : descriptionBaseUrl // ignore: cast_nullable_to_non_nullable -as String?,preview: null == preview ? _self._preview : preview // ignore: cast_nullable_to_non_nullable -as List,icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String,cover: null == cover ? _self.cover : cover // ignore: cast_nullable_to_non_nullable -as String,paidType: freezed == paidType ? _self.paidType : paidType // ignore: cast_nullable_to_non_nullable -as AstroBoxPaidType?,author: null == author ? _self._author : author // ignore: cast_nullable_to_non_nullable -as List, - )); +class __$$AstroBoxManifestItemImplCopyWithImpl<$Res> + extends _$AstroBoxManifestItemCopyWithImpl<$Res, _$AstroBoxManifestItemImpl> + implements _$$AstroBoxManifestItemImplCopyWith<$Res> { + __$$AstroBoxManifestItemImplCopyWithImpl( + _$AstroBoxManifestItemImpl _value, + $Res Function(_$AstroBoxManifestItemImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxManifestItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? restype = null, + Object? name = null, + Object? description = null, + Object? descriptionHtml = freezed, + Object? descriptionBaseUrl = freezed, + Object? preview = null, + Object? icon = null, + Object? cover = null, + Object? paidType = freezed, + Object? author = null, + }) { + return _then( + _$AstroBoxManifestItemImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + restype: null == restype + ? _value.restype + : restype // ignore: cast_nullable_to_non_nullable + as AstroBoxResourceType, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + descriptionHtml: freezed == descriptionHtml + ? _value.descriptionHtml + : descriptionHtml // ignore: cast_nullable_to_non_nullable + as String?, + descriptionBaseUrl: freezed == descriptionBaseUrl + ? _value.descriptionBaseUrl + : descriptionBaseUrl // ignore: cast_nullable_to_non_nullable + as String?, + preview: null == preview + ? _value._preview + : preview // ignore: cast_nullable_to_non_nullable + as List, + icon: null == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String, + cover: null == cover + ? _value.cover + : cover // ignore: cast_nullable_to_non_nullable + as String, + paidType: freezed == paidType + ? _value.paidType + : paidType // ignore: cast_nullable_to_non_nullable + as AstroBoxPaidType?, + author: null == author + ? _value._author + : author // ignore: cast_nullable_to_non_nullable + as List, + ), + ); + } } - +/// @nodoc +@JsonSerializable() +class _$AstroBoxManifestItemImpl implements _AstroBoxManifestItem { + const _$AstroBoxManifestItemImpl({ + required this.id, + required this.restype, + required this.name, + required this.description, + this.descriptionHtml, + this.descriptionBaseUrl, + final List preview = const [], + required this.icon, + required this.cover, + this.paidType, + final List author = const [], + }) : _preview = preview, + _author = author; + + factory _$AstroBoxManifestItemImpl.fromJson(Map json) => + _$$AstroBoxManifestItemImplFromJson(json); + + @override + final String id; + @override + final AstroBoxResourceType restype; + @override + final String name; + @override + final String description; + @override + final String? descriptionHtml; + @override + final String? descriptionBaseUrl; + final List _preview; + @override + @JsonKey() + List get preview { + if (_preview is EqualUnmodifiableListView) return _preview; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_preview); + } + + @override + final String icon; + @override + final String cover; + @override + final AstroBoxPaidType? paidType; + final List _author; + @override + @JsonKey() + List get author { + if (_author is EqualUnmodifiableListView) return _author; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_author); + } + + @override + String toString() { + return 'AstroBoxManifestItem(id: $id, restype: $restype, name: $name, description: $description, descriptionHtml: $descriptionHtml, descriptionBaseUrl: $descriptionBaseUrl, preview: $preview, icon: $icon, cover: $cover, paidType: $paidType, author: $author)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxManifestItemImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.restype, restype) || other.restype == restype) && + (identical(other.name, name) || other.name == name) && + (identical(other.description, description) || + other.description == description) && + (identical(other.descriptionHtml, descriptionHtml) || + other.descriptionHtml == descriptionHtml) && + (identical(other.descriptionBaseUrl, descriptionBaseUrl) || + other.descriptionBaseUrl == descriptionBaseUrl) && + const DeepCollectionEquality().equals(other._preview, _preview) && + (identical(other.icon, icon) || other.icon == icon) && + (identical(other.cover, cover) || other.cover == cover) && + (identical(other.paidType, paidType) || + other.paidType == paidType) && + const DeepCollectionEquality().equals(other._author, _author)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + id, + restype, + name, + description, + descriptionHtml, + descriptionBaseUrl, + const DeepCollectionEquality().hash(_preview), + icon, + cover, + paidType, + const DeepCollectionEquality().hash(_author), + ); + + /// Create a copy of AstroBoxManifestItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxManifestItemImplCopyWith<_$AstroBoxManifestItemImpl> + get copyWith => + __$$AstroBoxManifestItemImplCopyWithImpl<_$AstroBoxManifestItemImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxManifestItemImplToJson(this); + } +} + +abstract class _AstroBoxManifestItem implements AstroBoxManifestItem { + const factory _AstroBoxManifestItem({ + required final String id, + required final AstroBoxResourceType restype, + required final String name, + required final String description, + final String? descriptionHtml, + final String? descriptionBaseUrl, + final List preview, + required final String icon, + required final String cover, + final AstroBoxPaidType? paidType, + final List author, + }) = _$AstroBoxManifestItemImpl; + + factory _AstroBoxManifestItem.fromJson(Map json) = + _$AstroBoxManifestItemImpl.fromJson; + + @override + String get id; + @override + AstroBoxResourceType get restype; + @override + String get name; + @override + String get description; + @override + String? get descriptionHtml; + @override + String? get descriptionBaseUrl; + @override + List get preview; + @override + String get icon; + @override + String get cover; + @override + AstroBoxPaidType? get paidType; + @override + List get author; + + /// Create a copy of AstroBoxManifestItem + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxManifestItemImplCopyWith<_$AstroBoxManifestItemImpl> + get copyWith => throw _privateConstructorUsedError; +} + +AstroBoxManifestAuthor _$AstroBoxManifestAuthorFromJson( + Map json, +) { + return _AstroBoxManifestAuthor.fromJson(json); } - /// @nodoc mixin _$AstroBoxManifestAuthor { - - String get name;@JsonKey(name: 'bindABAccount') bool get bindAbAccount; -/// Create a copy of AstroBoxManifestAuthor -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxManifestAuthorCopyWith get copyWith => _$AstroBoxManifestAuthorCopyWithImpl(this as AstroBoxManifestAuthor, _$identity); + String get name => throw _privateConstructorUsedError; + @JsonKey(name: 'bindABAccount') + bool get bindAbAccount => throw _privateConstructorUsedError; /// Serializes this AstroBoxManifestAuthor to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxManifestAuthor&&(identical(other.name, name) || other.name == name)&&(identical(other.bindAbAccount, bindAbAccount) || other.bindAbAccount == bindAbAccount)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,bindAbAccount); - -@override -String toString() { - return 'AstroBoxManifestAuthor(name: $name, bindAbAccount: $bindAbAccount)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxManifestAuthor + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxManifestAuthorCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxManifestAuthorCopyWith<$Res> { - factory $AstroBoxManifestAuthorCopyWith(AstroBoxManifestAuthor value, $Res Function(AstroBoxManifestAuthor) _then) = _$AstroBoxManifestAuthorCopyWithImpl; -@useResult -$Res call({ - String name,@JsonKey(name: 'bindABAccount') bool bindAbAccount -}); - - - - +abstract class $AstroBoxManifestAuthorCopyWith<$Res> { + factory $AstroBoxManifestAuthorCopyWith( + AstroBoxManifestAuthor value, + $Res Function(AstroBoxManifestAuthor) then, + ) = _$AstroBoxManifestAuthorCopyWithImpl<$Res, AstroBoxManifestAuthor>; + @useResult + $Res call({String name, @JsonKey(name: 'bindABAccount') bool bindAbAccount}); } + /// @nodoc -class _$AstroBoxManifestAuthorCopyWithImpl<$Res> +class _$AstroBoxManifestAuthorCopyWithImpl< + $Res, + $Val extends AstroBoxManifestAuthor +> implements $AstroBoxManifestAuthorCopyWith<$Res> { - _$AstroBoxManifestAuthorCopyWithImpl(this._self, this._then); - - final AstroBoxManifestAuthor _self; - final $Res Function(AstroBoxManifestAuthor) _then; - -/// Create a copy of AstroBoxManifestAuthor -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? name = null,Object? bindAbAccount = null,}) { - return _then(AstroBoxManifestAuthor( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,bindAbAccount: null == bindAbAccount ? _self.bindAbAccount : bindAbAccount // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxManifestAuthor]. -extension AstroBoxManifestAuthorPatterns on AstroBoxManifestAuthor { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxManifestAuthor value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxManifestAuthor value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxManifestAuthor value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String name, @JsonKey(name: 'bindABAccount') bool bindAbAccount)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor() when $default != null: -return $default(_that.name,_that.bindAbAccount);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String name, @JsonKey(name: 'bindABAccount') bool bindAbAccount) $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor(): -return $default(_that.name,_that.bindAbAccount);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String name, @JsonKey(name: 'bindABAccount') bool bindAbAccount)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestAuthor() when $default != null: -return $default(_that.name,_that.bindAbAccount);case _: - return null; - -} -} - + _$AstroBoxManifestAuthorCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxManifestAuthor + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? name = null, Object? bindAbAccount = null}) { + return _then( + _value.copyWith( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + bindAbAccount: null == bindAbAccount + ? _value.bindAbAccount + : bindAbAccount // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxManifestAuthor implements AstroBoxManifestAuthor { - const _AstroBoxManifestAuthor({required this.name, @JsonKey(name: 'bindABAccount') this.bindAbAccount = false}); - factory _AstroBoxManifestAuthor.fromJson(Map json) => _$AstroBoxManifestAuthorFromJson(json); - -@override final String name; -@override@JsonKey(name: 'bindABAccount') final bool bindAbAccount; - -/// Create a copy of AstroBoxManifestAuthor -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxManifestAuthorCopyWith<_AstroBoxManifestAuthor> get copyWith => __$AstroBoxManifestAuthorCopyWithImpl<_AstroBoxManifestAuthor>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxManifestAuthorToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxManifestAuthor&&(identical(other.name, name) || other.name == name)&&(identical(other.bindAbAccount, bindAbAccount) || other.bindAbAccount == bindAbAccount)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,name,bindAbAccount); - -@override -String toString() { - return 'AstroBoxManifestAuthor(name: $name, bindAbAccount: $bindAbAccount)'; -} - - +abstract class _$$AstroBoxManifestAuthorImplCopyWith<$Res> + implements $AstroBoxManifestAuthorCopyWith<$Res> { + factory _$$AstroBoxManifestAuthorImplCopyWith( + _$AstroBoxManifestAuthorImpl value, + $Res Function(_$AstroBoxManifestAuthorImpl) then, + ) = __$$AstroBoxManifestAuthorImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String name, @JsonKey(name: 'bindABAccount') bool bindAbAccount}); } /// @nodoc -abstract mixin class _$AstroBoxManifestAuthorCopyWith<$Res> implements $AstroBoxManifestAuthorCopyWith<$Res> { - factory _$AstroBoxManifestAuthorCopyWith(_AstroBoxManifestAuthor value, $Res Function(_AstroBoxManifestAuthor) _then) = __$AstroBoxManifestAuthorCopyWithImpl; -@override @useResult -$Res call({ - String name,@JsonKey(name: 'bindABAccount') bool bindAbAccount -}); - - - - -} -/// @nodoc -class __$AstroBoxManifestAuthorCopyWithImpl<$Res> - implements _$AstroBoxManifestAuthorCopyWith<$Res> { - __$AstroBoxManifestAuthorCopyWithImpl(this._self, this._then); - - final _AstroBoxManifestAuthor _self; - final $Res Function(_AstroBoxManifestAuthor) _then; - -/// Create a copy of AstroBoxManifestAuthor -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? bindAbAccount = null,}) { - return _then(_AstroBoxManifestAuthor( -name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,bindAbAccount: null == bindAbAccount ? _self.bindAbAccount : bindAbAccount // ignore: cast_nullable_to_non_nullable -as bool, - )); +class __$$AstroBoxManifestAuthorImplCopyWithImpl<$Res> + extends + _$AstroBoxManifestAuthorCopyWithImpl<$Res, _$AstroBoxManifestAuthorImpl> + implements _$$AstroBoxManifestAuthorImplCopyWith<$Res> { + __$$AstroBoxManifestAuthorImplCopyWithImpl( + _$AstroBoxManifestAuthorImpl _value, + $Res Function(_$AstroBoxManifestAuthorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxManifestAuthor + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? name = null, Object? bindAbAccount = null}) { + return _then( + _$AstroBoxManifestAuthorImpl( + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + bindAbAccount: null == bindAbAccount + ? _value.bindAbAccount + : bindAbAccount // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$AstroBoxManifestAuthorImpl implements _AstroBoxManifestAuthor { + const _$AstroBoxManifestAuthorImpl({ + required this.name, + @JsonKey(name: 'bindABAccount') this.bindAbAccount = false, + }); + factory _$AstroBoxManifestAuthorImpl.fromJson(Map json) => + _$$AstroBoxManifestAuthorImplFromJson(json); + + @override + final String name; + @override + @JsonKey(name: 'bindABAccount') + final bool bindAbAccount; + + @override + String toString() { + return 'AstroBoxManifestAuthor(name: $name, bindAbAccount: $bindAbAccount)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxManifestAuthorImpl && + (identical(other.name, name) || other.name == name) && + (identical(other.bindAbAccount, bindAbAccount) || + other.bindAbAccount == bindAbAccount)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, name, bindAbAccount); + + /// Create a copy of AstroBoxManifestAuthor + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxManifestAuthorImplCopyWith<_$AstroBoxManifestAuthorImpl> + get copyWith => + __$$AstroBoxManifestAuthorImplCopyWithImpl<_$AstroBoxManifestAuthorImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxManifestAuthorImplToJson(this); + } +} + +abstract class _AstroBoxManifestAuthor implements AstroBoxManifestAuthor { + const factory _AstroBoxManifestAuthor({ + required final String name, + @JsonKey(name: 'bindABAccount') final bool bindAbAccount, + }) = _$AstroBoxManifestAuthorImpl; + + factory _AstroBoxManifestAuthor.fromJson(Map json) = + _$AstroBoxManifestAuthorImpl.fromJson; + + @override + String get name; + @override + @JsonKey(name: 'bindABAccount') + bool get bindAbAccount; + + /// Create a copy of AstroBoxManifestAuthor + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxManifestAuthorImplCopyWith<_$AstroBoxManifestAuthorImpl> + get copyWith => throw _privateConstructorUsedError; +} + +AstroBoxManifestLink _$AstroBoxManifestLinkFromJson(Map json) { + return _AstroBoxManifestLink.fromJson(json); } - /// @nodoc mixin _$AstroBoxManifestLink { - - String? get icon; String get title; String get url; -/// Create a copy of AstroBoxManifestLink -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxManifestLinkCopyWith get copyWith => _$AstroBoxManifestLinkCopyWithImpl(this as AstroBoxManifestLink, _$identity); + String? get icon => throw _privateConstructorUsedError; + String get title => throw _privateConstructorUsedError; + String get url => throw _privateConstructorUsedError; /// Serializes this AstroBoxManifestLink to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxManifestLink&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.title, title) || other.title == title)&&(identical(other.url, url) || other.url == url)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,icon,title,url); - -@override -String toString() { - return 'AstroBoxManifestLink(icon: $icon, title: $title, url: $url)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxManifestLink + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxManifestLinkCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxManifestLinkCopyWith<$Res> { - factory $AstroBoxManifestLinkCopyWith(AstroBoxManifestLink value, $Res Function(AstroBoxManifestLink) _then) = _$AstroBoxManifestLinkCopyWithImpl; -@useResult -$Res call({ - String? icon, String title, String url -}); - - - - +abstract class $AstroBoxManifestLinkCopyWith<$Res> { + factory $AstroBoxManifestLinkCopyWith( + AstroBoxManifestLink value, + $Res Function(AstroBoxManifestLink) then, + ) = _$AstroBoxManifestLinkCopyWithImpl<$Res, AstroBoxManifestLink>; + @useResult + $Res call({String? icon, String title, String url}); } + /// @nodoc -class _$AstroBoxManifestLinkCopyWithImpl<$Res> +class _$AstroBoxManifestLinkCopyWithImpl< + $Res, + $Val extends AstroBoxManifestLink +> implements $AstroBoxManifestLinkCopyWith<$Res> { - _$AstroBoxManifestLinkCopyWithImpl(this._self, this._then); - - final AstroBoxManifestLink _self; - final $Res Function(AstroBoxManifestLink) _then; - -/// Create a copy of AstroBoxManifestLink -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? icon = freezed,Object? title = null,Object? url = null,}) { - return _then(AstroBoxManifestLink( -icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String?,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable -as String, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxManifestLink]. -extension AstroBoxManifestLinkPatterns on AstroBoxManifestLink { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxManifestLink value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxManifestLink() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxManifestLink value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestLink(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxManifestLink value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestLink() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String? icon, String title, String url)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxManifestLink() when $default != null: -return $default(_that.icon,_that.title,_that.url);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String? icon, String title, String url) $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestLink(): -return $default(_that.icon,_that.title,_that.url);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String? icon, String title, String url)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestLink() when $default != null: -return $default(_that.icon,_that.title,_that.url);case _: - return null; - -} -} - + _$AstroBoxManifestLinkCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxManifestLink + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? icon = freezed, + Object? title = null, + Object? url = null, + }) { + return _then( + _value.copyWith( + icon: freezed == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String?, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxManifestLink implements AstroBoxManifestLink { - const _AstroBoxManifestLink({this.icon, required this.title, required this.url}); - factory _AstroBoxManifestLink.fromJson(Map json) => _$AstroBoxManifestLinkFromJson(json); - -@override final String? icon; -@override final String title; -@override final String url; - -/// Create a copy of AstroBoxManifestLink -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxManifestLinkCopyWith<_AstroBoxManifestLink> get copyWith => __$AstroBoxManifestLinkCopyWithImpl<_AstroBoxManifestLink>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxManifestLinkToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxManifestLink&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.title, title) || other.title == title)&&(identical(other.url, url) || other.url == url)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,icon,title,url); - -@override -String toString() { - return 'AstroBoxManifestLink(icon: $icon, title: $title, url: $url)'; -} - - +abstract class _$$AstroBoxManifestLinkImplCopyWith<$Res> + implements $AstroBoxManifestLinkCopyWith<$Res> { + factory _$$AstroBoxManifestLinkImplCopyWith( + _$AstroBoxManifestLinkImpl value, + $Res Function(_$AstroBoxManifestLinkImpl) then, + ) = __$$AstroBoxManifestLinkImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String? icon, String title, String url}); } /// @nodoc -abstract mixin class _$AstroBoxManifestLinkCopyWith<$Res> implements $AstroBoxManifestLinkCopyWith<$Res> { - factory _$AstroBoxManifestLinkCopyWith(_AstroBoxManifestLink value, $Res Function(_AstroBoxManifestLink) _then) = __$AstroBoxManifestLinkCopyWithImpl; -@override @useResult -$Res call({ - String? icon, String title, String url -}); - - - - -} -/// @nodoc -class __$AstroBoxManifestLinkCopyWithImpl<$Res> - implements _$AstroBoxManifestLinkCopyWith<$Res> { - __$AstroBoxManifestLinkCopyWithImpl(this._self, this._then); - - final _AstroBoxManifestLink _self; - final $Res Function(_AstroBoxManifestLink) _then; - -/// Create a copy of AstroBoxManifestLink -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? icon = freezed,Object? title = null,Object? url = null,}) { - return _then(_AstroBoxManifestLink( -icon: freezed == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable -as String?,title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable -as String,url: null == url ? _self.url : url // ignore: cast_nullable_to_non_nullable -as String, - )); +class __$$AstroBoxManifestLinkImplCopyWithImpl<$Res> + extends _$AstroBoxManifestLinkCopyWithImpl<$Res, _$AstroBoxManifestLinkImpl> + implements _$$AstroBoxManifestLinkImplCopyWith<$Res> { + __$$AstroBoxManifestLinkImplCopyWithImpl( + _$AstroBoxManifestLinkImpl _value, + $Res Function(_$AstroBoxManifestLinkImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxManifestLink + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? icon = freezed, + Object? title = null, + Object? url = null, + }) { + return _then( + _$AstroBoxManifestLinkImpl( + icon: freezed == icon + ? _value.icon + : icon // ignore: cast_nullable_to_non_nullable + as String?, + title: null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + url: null == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$AstroBoxManifestLinkImpl implements _AstroBoxManifestLink { + const _$AstroBoxManifestLinkImpl({ + this.icon, + required this.title, + required this.url, + }); + factory _$AstroBoxManifestLinkImpl.fromJson(Map json) => + _$$AstroBoxManifestLinkImplFromJson(json); + + @override + final String? icon; + @override + final String title; + @override + final String url; + + @override + String toString() { + return 'AstroBoxManifestLink(icon: $icon, title: $title, url: $url)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxManifestLinkImpl && + (identical(other.icon, icon) || other.icon == icon) && + (identical(other.title, title) || other.title == title) && + (identical(other.url, url) || other.url == url)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, icon, title, url); + + /// Create a copy of AstroBoxManifestLink + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxManifestLinkImplCopyWith<_$AstroBoxManifestLinkImpl> + get copyWith => + __$$AstroBoxManifestLinkImplCopyWithImpl<_$AstroBoxManifestLinkImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxManifestLinkImplToJson(this); + } +} + +abstract class _AstroBoxManifestLink implements AstroBoxManifestLink { + const factory _AstroBoxManifestLink({ + final String? icon, + required final String title, + required final String url, + }) = _$AstroBoxManifestLinkImpl; + + factory _AstroBoxManifestLink.fromJson(Map json) = + _$AstroBoxManifestLinkImpl.fromJson; + + @override + String? get icon; + @override + String get title; + @override + String get url; + + /// Create a copy of AstroBoxManifestLink + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxManifestLinkImplCopyWith<_$AstroBoxManifestLinkImpl> + get copyWith => throw _privateConstructorUsedError; +} + +AstroBoxManifestDownload _$AstroBoxManifestDownloadFromJson( + Map json, +) { + return _AstroBoxManifestDownload.fromJson(json); } - /// @nodoc mixin _$AstroBoxManifestDownload { - - String get version;@JsonKey(name: 'file_name') String get fileName;@JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? get versionCode; String? get url; String? get sha256; String? get displayName; -/// Create a copy of AstroBoxManifestDownload -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxManifestDownloadCopyWith get copyWith => _$AstroBoxManifestDownloadCopyWithImpl(this as AstroBoxManifestDownload, _$identity); + String get version => throw _privateConstructorUsedError; + @JsonKey(name: 'file_name') + String get fileName => throw _privateConstructorUsedError; + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + int? get versionCode => throw _privateConstructorUsedError; + String? get url => throw _privateConstructorUsedError; + String? get sha256 => throw _privateConstructorUsedError; + String? get displayName => throw _privateConstructorUsedError; /// Serializes this AstroBoxManifestDownload to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxManifestDownload&&(identical(other.version, version) || other.version == version)&&(identical(other.fileName, fileName) || other.fileName == fileName)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.url, url) || other.url == url)&&(identical(other.sha256, sha256) || other.sha256 == sha256)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,version,fileName,versionCode,url,sha256,displayName); - -@override -String toString() { - return 'AstroBoxManifestDownload(version: $version, fileName: $fileName, versionCode: $versionCode, url: $url, sha256: $sha256, displayName: $displayName)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxManifestDownload + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxManifestDownloadCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxManifestDownloadCopyWith<$Res> { - factory $AstroBoxManifestDownloadCopyWith(AstroBoxManifestDownload value, $Res Function(AstroBoxManifestDownload) _then) = _$AstroBoxManifestDownloadCopyWithImpl; -@useResult -$Res call({ - String version,@JsonKey(name: 'file_name') String fileName,@JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? versionCode, String? url, String? sha256, String? displayName -}); - - - - +abstract class $AstroBoxManifestDownloadCopyWith<$Res> { + factory $AstroBoxManifestDownloadCopyWith( + AstroBoxManifestDownload value, + $Res Function(AstroBoxManifestDownload) then, + ) = _$AstroBoxManifestDownloadCopyWithImpl<$Res, AstroBoxManifestDownload>; + @useResult + $Res call({ + String version, + @JsonKey(name: 'file_name') String fileName, + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + int? versionCode, + String? url, + String? sha256, + String? displayName, + }); } + /// @nodoc -class _$AstroBoxManifestDownloadCopyWithImpl<$Res> +class _$AstroBoxManifestDownloadCopyWithImpl< + $Res, + $Val extends AstroBoxManifestDownload +> implements $AstroBoxManifestDownloadCopyWith<$Res> { - _$AstroBoxManifestDownloadCopyWithImpl(this._self, this._then); - - final AstroBoxManifestDownload _self; - final $Res Function(AstroBoxManifestDownload) _then; - -/// Create a copy of AstroBoxManifestDownload -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? version = null,Object? fileName = null,Object? versionCode = freezed,Object? url = freezed,Object? sha256 = freezed,Object? displayName = freezed,}) { - return _then(AstroBoxManifestDownload( -version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable -as String,fileName: null == fileName ? _self.fileName : fileName // ignore: cast_nullable_to_non_nullable -as String,versionCode: freezed == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable -as String?,sha256: freezed == sha256 ? _self.sha256 : sha256 // ignore: cast_nullable_to_non_nullable -as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxManifestDownload]. -extension AstroBoxManifestDownloadPatterns on AstroBoxManifestDownload { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxManifestDownload value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxManifestDownload() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxManifestDownload value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestDownload(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxManifestDownload value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxManifestDownload() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String version, @JsonKey(name: 'file_name') String fileName, @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? versionCode, String? url, String? sha256, String? displayName)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxManifestDownload() when $default != null: -return $default(_that.version,_that.fileName,_that.versionCode,_that.url,_that.sha256,_that.displayName);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String version, @JsonKey(name: 'file_name') String fileName, @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? versionCode, String? url, String? sha256, String? displayName) $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestDownload(): -return $default(_that.version,_that.fileName,_that.versionCode,_that.url,_that.sha256,_that.displayName);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String version, @JsonKey(name: 'file_name') String fileName, @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? versionCode, String? url, String? sha256, String? displayName)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxManifestDownload() when $default != null: -return $default(_that.version,_that.fileName,_that.versionCode,_that.url,_that.sha256,_that.displayName);case _: - return null; - -} -} - + _$AstroBoxManifestDownloadCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxManifestDownload + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? version = null, + Object? fileName = null, + Object? versionCode = freezed, + Object? url = freezed, + Object? sha256 = freezed, + Object? displayName = freezed, + }) { + return _then( + _value.copyWith( + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + fileName: null == fileName + ? _value.fileName + : fileName // ignore: cast_nullable_to_non_nullable + as String, + versionCode: freezed == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int?, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + sha256: freezed == sha256 + ? _value.sha256 + : sha256 // ignore: cast_nullable_to_non_nullable + as String?, + displayName: freezed == displayName + ? _value.displayName + : displayName // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxManifestDownload implements AstroBoxManifestDownload { - const _AstroBoxManifestDownload({required this.version, @JsonKey(name: 'file_name') required this.fileName, @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) this.versionCode, this.url, this.sha256, this.displayName}); - factory _AstroBoxManifestDownload.fromJson(Map json) => _$AstroBoxManifestDownloadFromJson(json); - -@override final String version; -@override@JsonKey(name: 'file_name') final String fileName; -@override@JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) final int? versionCode; -@override final String? url; -@override final String? sha256; -@override final String? displayName; - -/// Create a copy of AstroBoxManifestDownload -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxManifestDownloadCopyWith<_AstroBoxManifestDownload> get copyWith => __$AstroBoxManifestDownloadCopyWithImpl<_AstroBoxManifestDownload>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxManifestDownloadToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxManifestDownload&&(identical(other.version, version) || other.version == version)&&(identical(other.fileName, fileName) || other.fileName == fileName)&&(identical(other.versionCode, versionCode) || other.versionCode == versionCode)&&(identical(other.url, url) || other.url == url)&&(identical(other.sha256, sha256) || other.sha256 == sha256)&&(identical(other.displayName, displayName) || other.displayName == displayName)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,version,fileName,versionCode,url,sha256,displayName); - -@override -String toString() { - return 'AstroBoxManifestDownload(version: $version, fileName: $fileName, versionCode: $versionCode, url: $url, sha256: $sha256, displayName: $displayName)'; -} - - +abstract class _$$AstroBoxManifestDownloadImplCopyWith<$Res> + implements $AstroBoxManifestDownloadCopyWith<$Res> { + factory _$$AstroBoxManifestDownloadImplCopyWith( + _$AstroBoxManifestDownloadImpl value, + $Res Function(_$AstroBoxManifestDownloadImpl) then, + ) = __$$AstroBoxManifestDownloadImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String version, + @JsonKey(name: 'file_name') String fileName, + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + int? versionCode, + String? url, + String? sha256, + String? displayName, + }); } /// @nodoc -abstract mixin class _$AstroBoxManifestDownloadCopyWith<$Res> implements $AstroBoxManifestDownloadCopyWith<$Res> { - factory _$AstroBoxManifestDownloadCopyWith(_AstroBoxManifestDownload value, $Res Function(_AstroBoxManifestDownload) _then) = __$AstroBoxManifestDownloadCopyWithImpl; -@override @useResult -$Res call({ - String version,@JsonKey(name: 'file_name') String fileName,@JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) int? versionCode, String? url, String? sha256, String? displayName -}); - - - - -} -/// @nodoc -class __$AstroBoxManifestDownloadCopyWithImpl<$Res> - implements _$AstroBoxManifestDownloadCopyWith<$Res> { - __$AstroBoxManifestDownloadCopyWithImpl(this._self, this._then); - - final _AstroBoxManifestDownload _self; - final $Res Function(_AstroBoxManifestDownload) _then; - -/// Create a copy of AstroBoxManifestDownload -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? version = null,Object? fileName = null,Object? versionCode = freezed,Object? url = freezed,Object? sha256 = freezed,Object? displayName = freezed,}) { - return _then(_AstroBoxManifestDownload( -version: null == version ? _self.version : version // ignore: cast_nullable_to_non_nullable -as String,fileName: null == fileName ? _self.fileName : fileName // ignore: cast_nullable_to_non_nullable -as String,versionCode: freezed == versionCode ? _self.versionCode : versionCode // ignore: cast_nullable_to_non_nullable -as int?,url: freezed == url ? _self.url : url // ignore: cast_nullable_to_non_nullable -as String?,sha256: freezed == sha256 ? _self.sha256 : sha256 // ignore: cast_nullable_to_non_nullable -as String?,displayName: freezed == displayName ? _self.displayName : displayName // ignore: cast_nullable_to_non_nullable -as String?, - )); +class __$$AstroBoxManifestDownloadImplCopyWithImpl<$Res> + extends + _$AstroBoxManifestDownloadCopyWithImpl< + $Res, + _$AstroBoxManifestDownloadImpl + > + implements _$$AstroBoxManifestDownloadImplCopyWith<$Res> { + __$$AstroBoxManifestDownloadImplCopyWithImpl( + _$AstroBoxManifestDownloadImpl _value, + $Res Function(_$AstroBoxManifestDownloadImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxManifestDownload + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? version = null, + Object? fileName = null, + Object? versionCode = freezed, + Object? url = freezed, + Object? sha256 = freezed, + Object? displayName = freezed, + }) { + return _then( + _$AstroBoxManifestDownloadImpl( + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + fileName: null == fileName + ? _value.fileName + : fileName // ignore: cast_nullable_to_non_nullable + as String, + versionCode: freezed == versionCode + ? _value.versionCode + : versionCode // ignore: cast_nullable_to_non_nullable + as int?, + url: freezed == url + ? _value.url + : url // ignore: cast_nullable_to_non_nullable + as String?, + sha256: freezed == sha256 + ? _value.sha256 + : sha256 // ignore: cast_nullable_to_non_nullable + as String?, + displayName: freezed == displayName + ? _value.displayName + : displayName // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$AstroBoxManifestDownloadImpl implements _AstroBoxManifestDownload { + const _$AstroBoxManifestDownloadImpl({ + required this.version, + @JsonKey(name: 'file_name') required this.fileName, + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + this.versionCode, + this.url, + this.sha256, + this.displayName, + }); + factory _$AstroBoxManifestDownloadImpl.fromJson(Map json) => + _$$AstroBoxManifestDownloadImplFromJson(json); + + @override + final String version; + @override + @JsonKey(name: 'file_name') + final String fileName; + @override + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + final int? versionCode; + @override + final String? url; + @override + final String? sha256; + @override + final String? displayName; + + @override + String toString() { + return 'AstroBoxManifestDownload(version: $version, fileName: $fileName, versionCode: $versionCode, url: $url, sha256: $sha256, displayName: $displayName)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxManifestDownloadImpl && + (identical(other.version, version) || other.version == version) && + (identical(other.fileName, fileName) || + other.fileName == fileName) && + (identical(other.versionCode, versionCode) || + other.versionCode == versionCode) && + (identical(other.url, url) || other.url == url) && + (identical(other.sha256, sha256) || other.sha256 == sha256) && + (identical(other.displayName, displayName) || + other.displayName == displayName)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, + version, + fileName, + versionCode, + url, + sha256, + displayName, + ); + + /// Create a copy of AstroBoxManifestDownload + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxManifestDownloadImplCopyWith<_$AstroBoxManifestDownloadImpl> + get copyWith => + __$$AstroBoxManifestDownloadImplCopyWithImpl< + _$AstroBoxManifestDownloadImpl + >(this, _$identity); + + @override + Map toJson() { + return _$$AstroBoxManifestDownloadImplToJson(this); + } +} + +abstract class _AstroBoxManifestDownload implements AstroBoxManifestDownload { + const factory _AstroBoxManifestDownload({ + required final String version, + @JsonKey(name: 'file_name') required final String fileName, + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + final int? versionCode, + final String? url, + final String? sha256, + final String? displayName, + }) = _$AstroBoxManifestDownloadImpl; + + factory _AstroBoxManifestDownload.fromJson(Map json) = + _$AstroBoxManifestDownloadImpl.fromJson; + + @override + String get version; + @override + @JsonKey(name: 'file_name') + String get fileName; + @override + @JsonKey(name: 'version_code', fromJson: _versionCodeFromJson) + int? get versionCode; + @override + String? get url; + @override + String? get sha256; + @override + String? get displayName; + + /// Create a copy of AstroBoxManifestDownload + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxManifestDownloadImplCopyWith<_$AstroBoxManifestDownloadImpl> + get copyWith => throw _privateConstructorUsedError; +} + +AstroBoxDeviceMap _$AstroBoxDeviceMapFromJson(Map json) { + return _AstroBoxDeviceMap.fromJson(json); } - /// @nodoc mixin _$AstroBoxDeviceMap { - - Map get xiaomi; -/// Create a copy of AstroBoxDeviceMap -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxDeviceMapCopyWith get copyWith => _$AstroBoxDeviceMapCopyWithImpl(this as AstroBoxDeviceMap, _$identity); + Map get xiaomi => throw _privateConstructorUsedError; /// Serializes this AstroBoxDeviceMap to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxDeviceMap&&const DeepCollectionEquality().equals(other.xiaomi, xiaomi)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(xiaomi)); + Map toJson() => throw _privateConstructorUsedError; -@override -String toString() { - return 'AstroBoxDeviceMap(xiaomi: $xiaomi)'; + /// Create a copy of AstroBoxDeviceMap + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxDeviceMapCopyWith get copyWith => + throw _privateConstructorUsedError; } - +/// @nodoc +abstract class $AstroBoxDeviceMapCopyWith<$Res> { + factory $AstroBoxDeviceMapCopyWith( + AstroBoxDeviceMap value, + $Res Function(AstroBoxDeviceMap) then, + ) = _$AstroBoxDeviceMapCopyWithImpl<$Res, AstroBoxDeviceMap>; + @useResult + $Res call({Map xiaomi}); } /// @nodoc -abstract mixin class $AstroBoxDeviceMapCopyWith<$Res> { - factory $AstroBoxDeviceMapCopyWith(AstroBoxDeviceMap value, $Res Function(AstroBoxDeviceMap) _then) = _$AstroBoxDeviceMapCopyWithImpl; -@useResult -$Res call({ - Map xiaomi -}); - - - - +class _$AstroBoxDeviceMapCopyWithImpl<$Res, $Val extends AstroBoxDeviceMap> + implements $AstroBoxDeviceMapCopyWith<$Res> { + _$AstroBoxDeviceMapCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxDeviceMap + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? xiaomi = null}) { + return _then( + _value.copyWith( + xiaomi: null == xiaomi + ? _value.xiaomi + : xiaomi // ignore: cast_nullable_to_non_nullable + as Map, + ) + as $Val, + ); + } } + /// @nodoc -class _$AstroBoxDeviceMapCopyWithImpl<$Res> +abstract class _$$AstroBoxDeviceMapImplCopyWith<$Res> implements $AstroBoxDeviceMapCopyWith<$Res> { - _$AstroBoxDeviceMapCopyWithImpl(this._self, this._then); - - final AstroBoxDeviceMap _self; - final $Res Function(AstroBoxDeviceMap) _then; - -/// Create a copy of AstroBoxDeviceMap -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? xiaomi = null,}) { - return _then(AstroBoxDeviceMap( -xiaomi: null == xiaomi ? _self.xiaomi : xiaomi // ignore: cast_nullable_to_non_nullable -as Map, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxDeviceMap]. -extension AstroBoxDeviceMapPatterns on AstroBoxDeviceMap { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxDeviceMap value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxDeviceMap() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxDeviceMap value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxDeviceMap(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxDeviceMap value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxDeviceMap() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( Map xiaomi)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxDeviceMap() when $default != null: -return $default(_that.xiaomi);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( Map xiaomi) $default,) {final _that = this; -switch (_that) { -case _AstroBoxDeviceMap(): -return $default(_that.xiaomi);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( Map xiaomi)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxDeviceMap() when $default != null: -return $default(_that.xiaomi);case _: - return null; - -} + factory _$$AstroBoxDeviceMapImplCopyWith( + _$AstroBoxDeviceMapImpl value, + $Res Function(_$AstroBoxDeviceMapImpl) then, + ) = __$$AstroBoxDeviceMapImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({Map xiaomi}); } +/// @nodoc +class __$$AstroBoxDeviceMapImplCopyWithImpl<$Res> + extends _$AstroBoxDeviceMapCopyWithImpl<$Res, _$AstroBoxDeviceMapImpl> + implements _$$AstroBoxDeviceMapImplCopyWith<$Res> { + __$$AstroBoxDeviceMapImplCopyWithImpl( + _$AstroBoxDeviceMapImpl _value, + $Res Function(_$AstroBoxDeviceMapImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxDeviceMap + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? xiaomi = null}) { + return _then( + _$AstroBoxDeviceMapImpl( + xiaomi: null == xiaomi + ? _value._xiaomi + : xiaomi // ignore: cast_nullable_to_non_nullable + as Map, + ), + ); + } } /// @nodoc @JsonSerializable() - -class _AstroBoxDeviceMap implements AstroBoxDeviceMap { - const _AstroBoxDeviceMap({ Map xiaomi = const {}}): _xiaomi = xiaomi; - factory _AstroBoxDeviceMap.fromJson(Map json) => _$AstroBoxDeviceMapFromJson(json); - - final Map _xiaomi; -@override@JsonKey() Map get xiaomi { - if (_xiaomi is EqualUnmodifiableMapView) return _xiaomi; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_xiaomi); -} - - -/// Create a copy of AstroBoxDeviceMap -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxDeviceMapCopyWith<_AstroBoxDeviceMap> get copyWith => __$AstroBoxDeviceMapCopyWithImpl<_AstroBoxDeviceMap>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxDeviceMapToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxDeviceMap&&const DeepCollectionEquality().equals(other._xiaomi, _xiaomi)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_xiaomi)); - -@override -String toString() { - return 'AstroBoxDeviceMap(xiaomi: $xiaomi)'; -} - - +class _$AstroBoxDeviceMapImpl implements _AstroBoxDeviceMap { + const _$AstroBoxDeviceMapImpl({ + final Map xiaomi = const {}, + }) : _xiaomi = xiaomi; + + factory _$AstroBoxDeviceMapImpl.fromJson(Map json) => + _$$AstroBoxDeviceMapImplFromJson(json); + + final Map _xiaomi; + @override + @JsonKey() + Map get xiaomi { + if (_xiaomi is EqualUnmodifiableMapView) return _xiaomi; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_xiaomi); + } + + @override + String toString() { + return 'AstroBoxDeviceMap(xiaomi: $xiaomi)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxDeviceMapImpl && + const DeepCollectionEquality().equals(other._xiaomi, _xiaomi)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(_xiaomi)); + + /// Create a copy of AstroBoxDeviceMap + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxDeviceMapImplCopyWith<_$AstroBoxDeviceMapImpl> get copyWith => + __$$AstroBoxDeviceMapImplCopyWithImpl<_$AstroBoxDeviceMapImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxDeviceMapImplToJson(this); + } +} + +abstract class _AstroBoxDeviceMap implements AstroBoxDeviceMap { + const factory _AstroBoxDeviceMap({final Map xiaomi}) = + _$AstroBoxDeviceMapImpl; + + factory _AstroBoxDeviceMap.fromJson(Map json) = + _$AstroBoxDeviceMapImpl.fromJson; + + @override + Map get xiaomi; + + /// Create a copy of AstroBoxDeviceMap + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxDeviceMapImplCopyWith<_$AstroBoxDeviceMapImpl> get copyWith => + throw _privateConstructorUsedError; +} + +AstroBoxDevice _$AstroBoxDeviceFromJson(Map json) { + return _AstroBoxDevice.fromJson(json); } -/// @nodoc -abstract mixin class _$AstroBoxDeviceMapCopyWith<$Res> implements $AstroBoxDeviceMapCopyWith<$Res> { - factory _$AstroBoxDeviceMapCopyWith(_AstroBoxDeviceMap value, $Res Function(_AstroBoxDeviceMap) _then) = __$AstroBoxDeviceMapCopyWithImpl; -@override @useResult -$Res call({ - Map xiaomi -}); - - - - -} -/// @nodoc -class __$AstroBoxDeviceMapCopyWithImpl<$Res> - implements _$AstroBoxDeviceMapCopyWith<$Res> { - __$AstroBoxDeviceMapCopyWithImpl(this._self, this._then); - - final _AstroBoxDeviceMap _self; - final $Res Function(_AstroBoxDeviceMap) _then; - -/// Create a copy of AstroBoxDeviceMap -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? xiaomi = null,}) { - return _then(_AstroBoxDeviceMap( -xiaomi: null == xiaomi ? _self._xiaomi : xiaomi // ignore: cast_nullable_to_non_nullable -as Map, - )); -} - - -} - - /// @nodoc mixin _$AstroBoxDevice { - - String get id; String get name; String get description; AstroBoxDeviceChip get chip; bool get fetch; -/// Create a copy of AstroBoxDevice -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$AstroBoxDeviceCopyWith get copyWith => _$AstroBoxDeviceCopyWithImpl(this as AstroBoxDevice, _$identity); + String get id => throw _privateConstructorUsedError; + String get name => throw _privateConstructorUsedError; + String get description => throw _privateConstructorUsedError; + AstroBoxDeviceChip get chip => throw _privateConstructorUsedError; + bool get fetch => throw _privateConstructorUsedError; /// Serializes this AstroBoxDevice to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is AstroBoxDevice&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.chip, chip) || other.chip == chip)&&(identical(other.fetch, fetch) || other.fetch == fetch)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,description,chip,fetch); - -@override -String toString() { - return 'AstroBoxDevice(id: $id, name: $name, description: $description, chip: $chip, fetch: $fetch)'; -} - + Map toJson() => throw _privateConstructorUsedError; + /// Create a copy of AstroBoxDevice + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $AstroBoxDeviceCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract mixin class $AstroBoxDeviceCopyWith<$Res> { - factory $AstroBoxDeviceCopyWith(AstroBoxDevice value, $Res Function(AstroBoxDevice) _then) = _$AstroBoxDeviceCopyWithImpl; -@useResult -$Res call({ - String id, String name, String description, AstroBoxDeviceChip chip, bool fetch -}); - - - - +abstract class $AstroBoxDeviceCopyWith<$Res> { + factory $AstroBoxDeviceCopyWith( + AstroBoxDevice value, + $Res Function(AstroBoxDevice) then, + ) = _$AstroBoxDeviceCopyWithImpl<$Res, AstroBoxDevice>; + @useResult + $Res call({ + String id, + String name, + String description, + AstroBoxDeviceChip chip, + bool fetch, + }); } + /// @nodoc -class _$AstroBoxDeviceCopyWithImpl<$Res> +class _$AstroBoxDeviceCopyWithImpl<$Res, $Val extends AstroBoxDevice> implements $AstroBoxDeviceCopyWith<$Res> { - _$AstroBoxDeviceCopyWithImpl(this._self, this._then); - - final AstroBoxDevice _self; - final $Res Function(AstroBoxDevice) _then; - -/// Create a copy of AstroBoxDevice -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? description = null,Object? chip = null,Object? fetch = null,}) { - return _then(AstroBoxDevice( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String,chip: null == chip ? _self.chip : chip // ignore: cast_nullable_to_non_nullable -as AstroBoxDeviceChip,fetch: null == fetch ? _self.fetch : fetch // ignore: cast_nullable_to_non_nullable -as bool, - )); -} - -} - - -/// Adds pattern-matching-related methods to [AstroBoxDevice]. -extension AstroBoxDevicePatterns on AstroBoxDevice { -/// A variant of `map` that fallback to returning `orElse`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeMap(TResult Function( _AstroBoxDevice value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _AstroBoxDevice() when $default != null: -return $default(_that);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// Callbacks receives the raw object, upcasted. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case final Subclass2 value: -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult map(TResult Function( _AstroBoxDevice value) $default,){ -final _that = this; -switch (_that) { -case _AstroBoxDevice(): -return $default(_that);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `map` that fallback to returning `null`. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case final Subclass value: -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? mapOrNull(TResult? Function( _AstroBoxDevice value)? $default,){ -final _that = this; -switch (_that) { -case _AstroBoxDevice() when $default != null: -return $default(_that);case _: - return null; - -} -} -/// A variant of `when` that fallback to an `orElse` callback. -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return orElse(); -/// } -/// ``` - -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String name, String description, AstroBoxDeviceChip chip, bool fetch)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _AstroBoxDevice() when $default != null: -return $default(_that.id,_that.name,_that.description,_that.chip,_that.fetch);case _: - return orElse(); - -} -} -/// A `switch`-like method, using callbacks. -/// -/// As opposed to `map`, this offers destructuring. -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case Subclass2(:final field2): -/// return ...; -/// } -/// ``` - -@optionalTypeArgs TResult when(TResult Function( String id, String name, String description, AstroBoxDeviceChip chip, bool fetch) $default,) {final _that = this; -switch (_that) { -case _AstroBoxDevice(): -return $default(_that.id,_that.name,_that.description,_that.chip,_that.fetch);case _: - throw StateError('Unexpected subclass'); - -} -} -/// A variant of `when` that fallback to returning `null` -/// -/// It is equivalent to doing: -/// ```dart -/// switch (sealedClass) { -/// case Subclass(:final field): -/// return ...; -/// case _: -/// return null; -/// } -/// ``` - -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String name, String description, AstroBoxDeviceChip chip, bool fetch)? $default,) {final _that = this; -switch (_that) { -case _AstroBoxDevice() when $default != null: -return $default(_that.id,_that.name,_that.description,_that.chip,_that.fetch);case _: - return null; - -} -} - + _$AstroBoxDeviceCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of AstroBoxDevice + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? description = null, + Object? chip = null, + Object? fetch = null, + }) { + return _then( + _value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + chip: null == chip + ? _value.chip + : chip // ignore: cast_nullable_to_non_nullable + as AstroBoxDeviceChip, + fetch: null == fetch + ? _value.fetch + : fetch // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); + } } /// @nodoc -@JsonSerializable() - -class _AstroBoxDevice implements AstroBoxDevice { - const _AstroBoxDevice({required this.id, required this.name, required this.description, required this.chip, this.fetch = false}); - factory _AstroBoxDevice.fromJson(Map json) => _$AstroBoxDeviceFromJson(json); - -@override final String id; -@override final String name; -@override final String description; -@override final AstroBoxDeviceChip chip; -@override@JsonKey() final bool fetch; - -/// Create a copy of AstroBoxDevice -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$AstroBoxDeviceCopyWith<_AstroBoxDevice> get copyWith => __$AstroBoxDeviceCopyWithImpl<_AstroBoxDevice>(this, _$identity); - -@override -Map toJson() { - return _$AstroBoxDeviceToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _AstroBoxDevice&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.description, description) || other.description == description)&&(identical(other.chip, chip) || other.chip == chip)&&(identical(other.fetch, fetch) || other.fetch == fetch)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,id,name,description,chip,fetch); - -@override -String toString() { - return 'AstroBoxDevice(id: $id, name: $name, description: $description, chip: $chip, fetch: $fetch)'; -} - - +abstract class _$$AstroBoxDeviceImplCopyWith<$Res> + implements $AstroBoxDeviceCopyWith<$Res> { + factory _$$AstroBoxDeviceImplCopyWith( + _$AstroBoxDeviceImpl value, + $Res Function(_$AstroBoxDeviceImpl) then, + ) = __$$AstroBoxDeviceImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({ + String id, + String name, + String description, + AstroBoxDeviceChip chip, + bool fetch, + }); } /// @nodoc -abstract mixin class _$AstroBoxDeviceCopyWith<$Res> implements $AstroBoxDeviceCopyWith<$Res> { - factory _$AstroBoxDeviceCopyWith(_AstroBoxDevice value, $Res Function(_AstroBoxDevice) _then) = __$AstroBoxDeviceCopyWithImpl; -@override @useResult -$Res call({ - String id, String name, String description, AstroBoxDeviceChip chip, bool fetch -}); - - - - -} -/// @nodoc -class __$AstroBoxDeviceCopyWithImpl<$Res> - implements _$AstroBoxDeviceCopyWith<$Res> { - __$AstroBoxDeviceCopyWithImpl(this._self, this._then); - - final _AstroBoxDevice _self; - final $Res Function(_AstroBoxDevice) _then; - -/// Create a copy of AstroBoxDevice -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? description = null,Object? chip = null,Object? fetch = null,}) { - return _then(_AstroBoxDevice( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable -as String,chip: null == chip ? _self.chip : chip // ignore: cast_nullable_to_non_nullable -as AstroBoxDeviceChip,fetch: null == fetch ? _self.fetch : fetch // ignore: cast_nullable_to_non_nullable -as bool, - )); +class __$$AstroBoxDeviceImplCopyWithImpl<$Res> + extends _$AstroBoxDeviceCopyWithImpl<$Res, _$AstroBoxDeviceImpl> + implements _$$AstroBoxDeviceImplCopyWith<$Res> { + __$$AstroBoxDeviceImplCopyWithImpl( + _$AstroBoxDeviceImpl _value, + $Res Function(_$AstroBoxDeviceImpl) _then, + ) : super(_value, _then); + + /// Create a copy of AstroBoxDevice + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? name = null, + Object? description = null, + Object? chip = null, + Object? fetch = null, + }) { + return _then( + _$AstroBoxDeviceImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + description: null == description + ? _value.description + : description // ignore: cast_nullable_to_non_nullable + as String, + chip: null == chip + ? _value.chip + : chip // ignore: cast_nullable_to_non_nullable + as AstroBoxDeviceChip, + fetch: null == fetch + ? _value.fetch + : fetch // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); + } } +/// @nodoc +@JsonSerializable() +class _$AstroBoxDeviceImpl implements _AstroBoxDevice { + const _$AstroBoxDeviceImpl({ + required this.id, + required this.name, + required this.description, + required this.chip, + this.fetch = false, + }); + factory _$AstroBoxDeviceImpl.fromJson(Map json) => + _$$AstroBoxDeviceImplFromJson(json); + + @override + final String id; + @override + final String name; + @override + final String description; + @override + final AstroBoxDeviceChip chip; + @override + @JsonKey() + final bool fetch; + + @override + String toString() { + return 'AstroBoxDevice(id: $id, name: $name, description: $description, chip: $chip, fetch: $fetch)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AstroBoxDeviceImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.name, name) || other.name == name) && + (identical(other.description, description) || + other.description == description) && + (identical(other.chip, chip) || other.chip == chip) && + (identical(other.fetch, fetch) || other.fetch == fetch)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, id, name, description, chip, fetch); + + /// Create a copy of AstroBoxDevice + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$AstroBoxDeviceImplCopyWith<_$AstroBoxDeviceImpl> get copyWith => + __$$AstroBoxDeviceImplCopyWithImpl<_$AstroBoxDeviceImpl>( + this, + _$identity, + ); + + @override + Map toJson() { + return _$$AstroBoxDeviceImplToJson(this); + } +} + +abstract class _AstroBoxDevice implements AstroBoxDevice { + const factory _AstroBoxDevice({ + required final String id, + required final String name, + required final String description, + required final AstroBoxDeviceChip chip, + final bool fetch, + }) = _$AstroBoxDeviceImpl; + + factory _AstroBoxDevice.fromJson(Map json) = + _$AstroBoxDeviceImpl.fromJson; + + @override + String get id; + @override + String get name; + @override + String get description; + @override + AstroBoxDeviceChip get chip; + @override + bool get fetch; + + /// Create a copy of AstroBoxDevice + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$AstroBoxDeviceImplCopyWith<_$AstroBoxDeviceImpl> get copyWith => + throw _privateConstructorUsedError; } - -// dart format on diff --git a/lib/src/data/astrobox/models/astrobox_models.g.dart b/lib/src/data/astrobox/models/astrobox_models.g.dart index 18665f2e..db503c54 100644 --- a/lib/src/data/astrobox/models/astrobox_models.g.dart +++ b/lib/src/data/astrobox/models/astrobox_models.g.dart @@ -6,47 +6,47 @@ part of 'astrobox_models.dart'; // JsonSerializableGenerator // ************************************************************************** -_AstroBoxIndexItem _$AstroBoxIndexItemFromJson(Map json) => - _AstroBoxIndexItem( - id: json['id'] as String, - name: json['name'] as String, - type: $enumDecode(_$AstroBoxResourceTypeEnumMap, json['restype']), - repoOwner: json['repoOwner'] as String, - repoName: json['repoName'] as String, - repoCommitHash: json['repoCommitHash'] as String, - icon: json['icon'] as String, - cover: json['cover'] as String, - tags: - (json['tags'] as List?)?.map((e) => e as String).toList() ?? - const [], - deviceVendors: - (json['device_vendors'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - devices: - (json['devices'] as List?) - ?.map((e) => e as String) - .toList() ?? - const [], - paidType: $enumDecode(_$AstroBoxPaidTypeEnumMap, json['paid_type']), - ); +_$AstroBoxIndexItemImpl _$$AstroBoxIndexItemImplFromJson( + Map json, +) => _$AstroBoxIndexItemImpl( + id: json['id'] as String, + name: json['name'] as String, + type: $enumDecode(_$AstroBoxResourceTypeEnumMap, json['restype']), + repoOwner: json['repoOwner'] as String, + repoName: json['repoName'] as String, + repoCommitHash: json['repoCommitHash'] as String, + icon: json['icon'] as String, + cover: json['cover'] as String, + tags: + (json['tags'] as List?)?.map((e) => e as String).toList() ?? + const [], + deviceVendors: + (json['device_vendors'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + devices: + (json['devices'] as List?)?.map((e) => e as String).toList() ?? + const [], + paidType: $enumDecode(_$AstroBoxPaidTypeEnumMap, json['paid_type']), +); -Map _$AstroBoxIndexItemToJson(_AstroBoxIndexItem instance) => - { - 'id': instance.id, - 'name': instance.name, - 'restype': _$AstroBoxResourceTypeEnumMap[instance.type]!, - 'repoOwner': instance.repoOwner, - 'repoName': instance.repoName, - 'repoCommitHash': instance.repoCommitHash, - 'icon': instance.icon, - 'cover': instance.cover, - 'tags': instance.tags, - 'device_vendors': instance.deviceVendors, - 'devices': instance.devices, - 'paid_type': _$AstroBoxPaidTypeEnumMap[instance.paidType]!, - }; +Map _$$AstroBoxIndexItemImplToJson( + _$AstroBoxIndexItemImpl instance, +) => { + 'id': instance.id, + 'name': instance.name, + 'restype': _$AstroBoxResourceTypeEnumMap[instance.type]!, + 'repoOwner': instance.repoOwner, + 'repoName': instance.repoName, + 'repoCommitHash': instance.repoCommitHash, + 'icon': instance.icon, + 'cover': instance.cover, + 'tags': instance.tags, + 'device_vendors': instance.deviceVendors, + 'devices': instance.devices, + 'paid_type': _$AstroBoxPaidTypeEnumMap[instance.paidType]!, +}; const _$AstroBoxResourceTypeEnumMap = { AstroBoxResourceType.quickApp: 'quick_app', @@ -61,38 +61,38 @@ const _$AstroBoxPaidTypeEnumMap = { AstroBoxPaidType.forcePaid: 'force_paid', }; -_AstroBoxManifest _$AstroBoxManifestFromJson(Map json) => - _AstroBoxManifest( - item: AstroBoxManifestItem.fromJson(json['item'] as Map), - links: - (json['links'] as List?) - ?.map( - (e) => AstroBoxManifestLink.fromJson(e as Map), - ) - .toList() ?? - const [], - downloads: - (json['downloads'] as Map?)?.map( - (k, e) => MapEntry( - k, - AstroBoxManifestDownload.fromJson(e as Map), - ), - ) ?? - const {}, - ext: json['ext'] as Map? ?? const {}, - ); +_$AstroBoxManifestImpl _$$AstroBoxManifestImplFromJson( + Map json, +) => _$AstroBoxManifestImpl( + item: AstroBoxManifestItem.fromJson(json['item'] as Map), + links: + (json['links'] as List?) + ?.map((e) => AstroBoxManifestLink.fromJson(e as Map)) + .toList() ?? + const [], + downloads: + (json['downloads'] as Map?)?.map( + (k, e) => MapEntry( + k, + AstroBoxManifestDownload.fromJson(e as Map), + ), + ) ?? + const {}, + ext: json['ext'] as Map? ?? const {}, +); -Map _$AstroBoxManifestToJson(_AstroBoxManifest instance) => - { - 'item': instance.item, - 'links': instance.links, - 'downloads': instance.downloads, - 'ext': instance.ext, - }; +Map _$$AstroBoxManifestImplToJson( + _$AstroBoxManifestImpl instance, +) => { + 'item': instance.item, + 'links': instance.links, + 'downloads': instance.downloads, + 'ext': instance.ext, +}; -_AstroBoxManifestItem _$AstroBoxManifestItemFromJson( +_$AstroBoxManifestItemImpl _$$AstroBoxManifestItemImplFromJson( Map json, -) => _AstroBoxManifestItem( +) => _$AstroBoxManifestItemImpl( id: json['id'] as String, restype: $enumDecode(_$AstroBoxResourceTypeEnumMap, json['restype']), name: json['name'] as String, @@ -114,8 +114,8 @@ _AstroBoxManifestItem _$AstroBoxManifestItemFromJson( const [], ); -Map _$AstroBoxManifestItemToJson( - _AstroBoxManifestItem instance, +Map _$$AstroBoxManifestItemImplToJson( + _$AstroBoxManifestItemImpl instance, ) => { 'id': instance.id, 'restype': _$AstroBoxResourceTypeEnumMap[instance.restype]!, @@ -130,39 +130,39 @@ Map _$AstroBoxManifestItemToJson( 'author': instance.author, }; -_AstroBoxManifestAuthor _$AstroBoxManifestAuthorFromJson( +_$AstroBoxManifestAuthorImpl _$$AstroBoxManifestAuthorImplFromJson( Map json, -) => _AstroBoxManifestAuthor( +) => _$AstroBoxManifestAuthorImpl( name: json['name'] as String, bindAbAccount: json['bindABAccount'] as bool? ?? false, ); -Map _$AstroBoxManifestAuthorToJson( - _AstroBoxManifestAuthor instance, +Map _$$AstroBoxManifestAuthorImplToJson( + _$AstroBoxManifestAuthorImpl instance, ) => { 'name': instance.name, 'bindABAccount': instance.bindAbAccount, }; -_AstroBoxManifestLink _$AstroBoxManifestLinkFromJson( +_$AstroBoxManifestLinkImpl _$$AstroBoxManifestLinkImplFromJson( Map json, -) => _AstroBoxManifestLink( +) => _$AstroBoxManifestLinkImpl( icon: json['icon'] as String?, title: json['title'] as String, url: json['url'] as String, ); -Map _$AstroBoxManifestLinkToJson( - _AstroBoxManifestLink instance, +Map _$$AstroBoxManifestLinkImplToJson( + _$AstroBoxManifestLinkImpl instance, ) => { 'icon': instance.icon, 'title': instance.title, 'url': instance.url, }; -_AstroBoxManifestDownload _$AstroBoxManifestDownloadFromJson( +_$AstroBoxManifestDownloadImpl _$$AstroBoxManifestDownloadImplFromJson( Map json, -) => _AstroBoxManifestDownload( +) => _$AstroBoxManifestDownloadImpl( version: json['version'] as String, fileName: json['file_name'] as String, versionCode: _versionCodeFromJson(json['version_code']), @@ -171,8 +171,8 @@ _AstroBoxManifestDownload _$AstroBoxManifestDownloadFromJson( displayName: json['displayName'] as String?, ); -Map _$AstroBoxManifestDownloadToJson( - _AstroBoxManifestDownload instance, +Map _$$AstroBoxManifestDownloadImplToJson( + _$AstroBoxManifestDownloadImpl instance, ) => { 'version': instance.version, 'file_name': instance.fileName, @@ -182,21 +182,23 @@ Map _$AstroBoxManifestDownloadToJson( 'displayName': instance.displayName, }; -_AstroBoxDeviceMap _$AstroBoxDeviceMapFromJson(Map json) => - _AstroBoxDeviceMap( - xiaomi: - (json['xiaomi'] as Map?)?.map( - (k, e) => - MapEntry(k, AstroBoxDevice.fromJson(e as Map)), - ) ?? - const {}, - ); +_$AstroBoxDeviceMapImpl _$$AstroBoxDeviceMapImplFromJson( + Map json, +) => _$AstroBoxDeviceMapImpl( + xiaomi: + (json['xiaomi'] as Map?)?.map( + (k, e) => + MapEntry(k, AstroBoxDevice.fromJson(e as Map)), + ) ?? + const {}, +); -Map _$AstroBoxDeviceMapToJson(_AstroBoxDeviceMap instance) => - {'xiaomi': instance.xiaomi}; +Map _$$AstroBoxDeviceMapImplToJson( + _$AstroBoxDeviceMapImpl instance, +) => {'xiaomi': instance.xiaomi}; -_AstroBoxDevice _$AstroBoxDeviceFromJson(Map json) => - _AstroBoxDevice( +_$AstroBoxDeviceImpl _$$AstroBoxDeviceImplFromJson(Map json) => + _$AstroBoxDeviceImpl( id: json['id'] as String, name: json['name'] as String, description: json['description'] as String, @@ -204,14 +206,15 @@ _AstroBoxDevice _$AstroBoxDeviceFromJson(Map json) => fetch: json['fetch'] as bool? ?? false, ); -Map _$AstroBoxDeviceToJson(_AstroBoxDevice instance) => - { - 'id': instance.id, - 'name': instance.name, - 'description': instance.description, - 'chip': _$AstroBoxDeviceChipEnumMap[instance.chip]!, - 'fetch': instance.fetch, - }; +Map _$$AstroBoxDeviceImplToJson( + _$AstroBoxDeviceImpl instance, +) => { + 'id': instance.id, + 'name': instance.name, + 'description': instance.description, + 'chip': _$AstroBoxDeviceChipEnumMap[instance.chip]!, + 'fetch': instance.fetch, +}; const _$AstroBoxDeviceChipEnumMap = { AstroBoxDeviceChip.xring: 'xring', diff --git a/lib/src/features/accounts/services/bandbbs_auth_service.dart b/lib/src/features/accounts/services/bandbbs_auth_service.dart index 6db68925..f2db54aa 100644 --- a/lib/src/features/accounts/services/bandbbs_auth_service.dart +++ b/lib/src/features/accounts/services/bandbbs_auth_service.dart @@ -7,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:oronbox/src/core/logging/logging_service.dart'; import 'package:oronbox/src/core/errors/coded_error.dart'; +import 'package:oronbox/src/core/extensions/riverpod_mounted_ext.dart'; import 'package:oronbox/src/core/constants/oronbox_server.dart'; import 'package:oronbox/src/core/network/app_http_transport.dart'; import 'package:oronbox/src/core/network/http_observability_interceptor.dart'; diff --git a/lib/src/features/debug/pages/debug_window_app.dart b/lib/src/features/debug/pages/debug_window_app.dart index 5bb75f65..60dd55bb 100644 --- a/lib/src/features/debug/pages/debug_window_app.dart +++ b/lib/src/features/debug/pages/debug_window_app.dart @@ -16,7 +16,7 @@ import 'package:oronbox/src/core/utils/layout.dart'; import 'package:oronbox/src/features/debug/widgets/debug_console.dart'; import 'package:oronbox/src/features/debug/widgets/debug_inspectors.dart'; import 'package:oronbox/src/host/application_host_provider.dart'; -import 'package:material_ui/material_ui.dart' as material_ui; +import 'package:flutter/material.dart' as material_ui; final _desktopAccentColorProvider = FutureProvider((ref) { final source = ref.watch( diff --git a/lib/src/features/devices/pages/switch/device_switch_page.dart b/lib/src/features/devices/pages/switch/device_switch_page.dart index 8d94a892..c0f7300c 100644 --- a/lib/src/features/devices/pages/switch/device_switch_page.dart +++ b/lib/src/features/devices/pages/switch/device_switch_page.dart @@ -463,6 +463,29 @@ class _DeviceSwitchPageState extends ConsumerState { ); }, ), + // 鸿蒙端提示:手环需重新打开配对新设备。 + if (defaultTargetPlatform == TargetPlatform.ohos && + state.pairedDevices.isNotEmpty) + SliverToBoxAdapter( + child: PageContainer( + safeArea: false, + padding: const EdgeInsets.fromLTRB( + StyleConstants.pagePadding, + 4, + StyleConstants.pagePadding, + 0, + ), + child: Text( + '鸿蒙可能需要在手环上面重新打开配对新设备', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant + .withValues(alpha: 0.75), + ), + ), + ), + ), SliverToBoxAdapter( child: PageContainer( safeArea: false, diff --git a/lib/src/features/plugins/pages/plugin_window_app.dart b/lib/src/features/plugins/pages/plugin_window_app.dart index cff57738..974bf9e2 100644 --- a/lib/src/features/plugins/pages/plugin_window_app.dart +++ b/lib/src/features/plugins/pages/plugin_window_app.dart @@ -9,7 +9,7 @@ import 'package:oronbox/src/app/window/secondary_window_host.dart'; import 'package:oronbox/src/core/providers/theme_locale_providers.dart'; import 'package:oronbox/src/features/plugins/pages/plugin_detail_page.dart'; import 'package:oronbox/src/features/plugins/widgets/plugin_host_request_handler.dart'; -import 'package:material_ui/material_ui.dart' as material_ui; +import 'package:flutter/material.dart' as material_ui; final _desktopAccentColorProvider = FutureProvider((ref) { final source = ref.watch( diff --git a/lib/src/features/resources/application/creator/creator_workspace_controller.dart b/lib/src/features/resources/application/creator/creator_workspace_controller.dart index 6bcdc516..ffb5535e 100644 --- a/lib/src/features/resources/application/creator/creator_workspace_controller.dart +++ b/lib/src/features/resources/application/creator/creator_workspace_controller.dart @@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:uuid/uuid.dart'; import 'package:oronbox/src/commands/command_protocol.dart'; import 'package:oronbox/src/core/errors/coded_error.dart'; +import 'package:oronbox/src/core/extensions/riverpod_mounted_ext.dart'; import 'package:oronbox/src/core/logging/logging_service.dart'; import 'package:oronbox/src/features/resources/domain/creator_workspace.dart'; import 'package:oronbox/src/host/application_host_provider.dart'; diff --git a/lib/src/features/settings/pages/about_software_page.dart b/lib/src/features/settings/pages/about_software_page.dart index a2758338..fef208bf 100644 --- a/lib/src/features/settings/pages/about_software_page.dart +++ b/lib/src/features/settings/pages/about_software_page.dart @@ -94,11 +94,13 @@ class AboutSoftwarePage extends ConsumerWidget { ], ), ), - _Section( - icon: Icons.article_outlined, - title: l10n.changelog, - child: const _ChangelogSection(), - ), + // 鸿蒙端不显示更新日志(更新走系统应用市场,无 changelog 可拉取)。 + if (defaultTargetPlatform != TargetPlatform.ohos) + _Section( + icon: Icons.article_outlined, + title: l10n.changelog, + child: const _ChangelogSection(), + ), _Section( icon: Icons.terminal_outlined, title: l10n.settingsAboutSoftwareBuildInfo, @@ -329,6 +331,16 @@ class _UpdatePillState extends ConsumerState<_UpdatePill> { Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; final colors = Theme.of(context).colorScheme; + // 鸿蒙端不提供「检查更新」,只静态展示当前版本号。 + if (defaultTargetPlatform == TargetPlatform.ohos) { + return Text( + 'v${BuildInfoService.appVersion}', + style: Theme.of(context).textTheme.titleSmall?.copyWith( + color: colors.onSurfaceVariant, + fontWeight: FontWeight.w600, + ), + ); + } final found = _found != null; final (icon, label) = _checking ? (null, l10n.updateChecking) diff --git a/lib/src/features/settings/pages/clean_mode_page.dart b/lib/src/features/settings/pages/clean_mode_page.dart index 71b58aea..8a0b899d 100644 --- a/lib/src/features/settings/pages/clean_mode_page.dart +++ b/lib/src/features/settings/pages/clean_mode_page.dart @@ -1,4 +1,5 @@ import 'package:segmented_list/segmented_list.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -201,19 +202,21 @@ class CleanModePage extends ConsumerWidget { ), ], ), - SegmentedSection( - title: Text(l10n.cleanUpdateGroup), - tiles: [ - _switch( - l10n.cleanCheckUpdates, - ref.watch(appSettingsProvider).checkUpdateOnLaunch, - (enabled) => ref - .read(appSettingsProvider.notifier) - .setCheckUpdateOnLaunch(enabled), - icon: Icons.system_update_outlined, - ), - ], - ), + // 鸿蒙端不提供「启动时检查更新」(更新走系统应用市场)。 + if (defaultTargetPlatform != TargetPlatform.ohos) + SegmentedSection( + title: Text(l10n.cleanUpdateGroup), + tiles: [ + _switch( + l10n.cleanCheckUpdates, + ref.watch(appSettingsProvider).checkUpdateOnLaunch, + (enabled) => ref + .read(appSettingsProvider.notifier) + .setCheckUpdateOnLaunch(enabled), + icon: Icons.system_update_outlined, + ), + ], + ), ], ), ); diff --git a/lib/src/features/settings/pages/settings_page.dart b/lib/src/features/settings/pages/settings_page.dart index 76367309..02e2727b 100644 --- a/lib/src/features/settings/pages/settings_page.dart +++ b/lib/src/features/settings/pages/settings_page.dart @@ -444,21 +444,23 @@ class SettingsPage extends ConsumerWidget { title: Text(l10n.settingsQueueDontClear), description: Text(l10n.settingsQueueDontClearDesc), ), - SegmentedTile.switchTile( - onToggle: (value) async { - await ref - .read(appSettingsProvider.notifier) - .setRealtimeActivityNotification(value ?? true); - }, - initialValue: ref - .watch(appSettingsProvider) - .realtimeActivityNotification, - leading: const Icon(Icons.notifications_active_outlined), - title: Text(l10n.settingsRealtimeActivityNotification), - description: Text( - l10n.settingsRealtimeActivityNotificationDesc, + // 鸿蒙端不提供实时活动通知(实况窗是系统受控能力,第三方无法接入)。 + if (defaultTargetPlatform != TargetPlatform.ohos) + SegmentedTile.switchTile( + onToggle: (value) async { + await ref + .read(appSettingsProvider.notifier) + .setRealtimeActivityNotification(value ?? true); + }, + initialValue: ref + .watch(appSettingsProvider) + .realtimeActivityNotification, + leading: const Icon(Icons.notifications_active_outlined), + title: Text(l10n.settingsRealtimeActivityNotification), + description: Text( + l10n.settingsRealtimeActivityNotificationDesc, + ), ), - ), ], ), if (category == null || category == SettingsCategory.support) diff --git a/lib/src/features/settings/services/update_check_service.dart b/lib/src/features/settings/services/update_check_service.dart index 89b62718..8215ab50 100644 --- a/lib/src/features/settings/services/update_check_service.dart +++ b/lib/src/features/settings/services/update_check_service.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:path_provider/path_provider.dart'; @@ -45,6 +46,22 @@ int compareVersions(String a, String b) { String normalizeVersion(String version) => version.replaceFirst(RegExp(r'^v'), '').split('+').first; +/// 平台条件包裹:仅在非鸿蒙端执行启动时更新检查 + 弹窗。 +/// 鸿蒙端不应用内检查更新(依赖应用市场更新渠道),直接透传 child。 +class ConditionalUpdateCheckHandler extends StatelessWidget { + const ConditionalUpdateCheckHandler({super.key, required this.child}); + + final Widget child; + + @override + Widget build(BuildContext context) { + if (defaultTargetPlatform == TargetPlatform.ohos) { + return child; + } + return UpdateCheckHandler(child: child); + } +} + /// Startup update flow: cleans stale APKs, then (when enabled and first-run /// onboarding is done) fetches the latest release and shows a changelog /// dialog. diff --git a/ohos/.appanalyzer/appanalyzerCardConfig/appTestCardList.json b/ohos/.appanalyzer/appanalyzerCardConfig/appTestCardList.json new file mode 100644 index 00000000..8ddbb807 --- /dev/null +++ b/ohos/.appanalyzer/appanalyzerCardConfig/appTestCardList.json @@ -0,0 +1,30 @@ +[ + { + "analyzerMode":"BEFORE_RELEASE_CHECK_MODE", + "autoCompile":true, + "autoTest":true, + "cardCode":"auto_before_release_check", + "cardEnName":"Auto Release Experience Compliance Check", + "cardId":200, + "cardName":"自动上架体验规范体检", + "coldStartCount":0, + "default":true, + "projectType":"app", + "replayTask":false, + "replayTime":60, + "ruleCodeList":[ + "0132", + "0133", + "0134", + "0135", + "0601", + "0604", + "0602", + "0502", + "0512", + "0515" + ], + "singleOperateDuration":20, + "testDuration":30 + } +] \ No newline at end of file diff --git a/ohos/.appanalyzer/appanalyzerCardConfig/atomicServiceTestCardList.json b/ohos/.appanalyzer/appanalyzerCardConfig/atomicServiceTestCardList.json new file mode 100644 index 00000000..a9631bde --- /dev/null +++ b/ohos/.appanalyzer/appanalyzerCardConfig/atomicServiceTestCardList.json @@ -0,0 +1,30 @@ +[ + { + "analyzerMode":"BEFORE_RELEASE_CHECK_MODE", + "autoCompile":true, + "autoTest":true, + "cardCode":"auto_before_release_check", + "cardEnName":"Auto Release Experience Compliance Check", + "cardId":300, + "cardName":"自动上架体验规范体检", + "coldStartCount":0, + "default":true, + "projectType":"service", + "replayTask":false, + "replayTime":60, + "ruleCodeList":[ + "0132", + "0133", + "0134", + "0135", + "0601", + "0604", + "0602", + "0502", + "0512", + "0515" + ], + "singleOperateDuration":20, + "testDuration":30 + } +] \ No newline at end of file diff --git a/ohos/.appanalyzer/appanalyzerCardConfig/defaultCardVersion.txt b/ohos/.appanalyzer/appanalyzerCardConfig/defaultCardVersion.txt new file mode 100644 index 00000000..ac3ef282 --- /dev/null +++ b/ohos/.appanalyzer/appanalyzerCardConfig/defaultCardVersion.txt @@ -0,0 +1 @@ +2026051801 \ No newline at end of file diff --git a/ohos/.gitignore b/ohos/.gitignore new file mode 100644 index 00000000..e3264914 --- /dev/null +++ b/ohos/.gitignore @@ -0,0 +1,20 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +**/BuildProfile.ets +**/oh-package-lock.json5 +/package.json +/package-lock.json + +**/src/main/resources/rawfile/flutter_assets/ +**/libs/**/libapp.so +**/libs/**/libflutter.so +**/libs/**/libvmservice_snapshot.so diff --git a/ohos/AppScope/app.json5 b/ohos/AppScope/app.json5 new file mode 100644 index 00000000..16ebc98b --- /dev/null +++ b/ohos/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "org.zxor.oronbox", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/ohos/AppScope/resources/base/element/string.json b/ohos/AppScope/resources/base/element/string.json new file mode 100644 index 00000000..ebce191b --- /dev/null +++ b/ohos/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "OronBox" + } + ] +} diff --git a/ohos/AppScope/resources/base/media/app_icon.png b/ohos/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a74f582b3122ad24a77dc2e9b2ccf01352327ba3 GIT binary patch literal 24515 zcmXtg1yodR*XWs{yBlewLlLDx9F>xm?vM@vhlZg+T3S*Xk?tO8QAz0z0qJg-dw9S5 z%W}cuJZE=5dx%g~eocT&iwgh%fxH|{9RQ%5zjE4& z5&(b+kcU0j^vKwmcTY8Z+a!IkKU1V4kftk=ud^9na(+Eb6_tEHZtByyy zYN-v|<#_=oCsQEPmq}GLX7FFzxy7d+7FWMYyek$Ntw@>jGlaZ%>&`_tu069Pp0T-3 zTzd)COtxrKFsUS{;{s?9{O#MfXgSU2lVSeG_%cB8=B;(*`A~TH&L(Eu=B+OsFnw+1 z?d`vNIlP|^*ke}W$m9{rZYd`}=9p7PjOHg601r>^K0{5=5tzU!AiHPz3igNNeST!X zZ{R7QGjna%M4UU;R%^{j3Gm0MCj+Sv6G}v0{N71e0Ez*Yh+-RMMOTFIVjfT;E@i{{ zwQIO#cATHYsZT&fD3FJ8?pGSXg~6MT;r-(3a#ZL}5Dz+JsciWCUST3i2N01__=hG) zfusTW0cU!kYdk+Z+~ubNpaSurL2k>2=l{H1dq4?%l;etoWDqTp0#++QJsvQag$fTM z1(3j8vSEhBf@d%&fv0j@U2^VcDUb^`gu1&B3(J7F8sG}t;33Ur!yQwOf9Uc8S27Bo zEC@Tm2UjNI=RaZ+im%E53e!23*sOf^#~LjqK=Vmm3%GcKaAIk*%?=N5H77uLLvG$; zSM}{$xIpj_ta0jt=m!q@i)T%Y+2Q@OD*ywQb1AV|`|J-78azZ$oH{Kqh<3o2uYE*D zqPC}tzVs9z!ev%!NH_$cGqMy!0T(QYeSrF(ix>=+-zx@mU^!JkR{2w19-bHC{_R1OOdKbgW@dI$JZ%688y_wr%r z0w)WV?x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signingConfigs": [ + { + "name": "default", + "type": "HarmonyOS", + "material": { + "certpath": "C:\\Users\\Administrator\\.ohos\\config\\default_ohos_6xxtsa71tFOUf4fm8t2beJeypPvMh1e4QNji1WnmN_U=.cer", + "keyAlias": "debugKey", + "keyPassword": "0000001BF72219C99072BCC7FD9FEA3AC1F97B5DA375D9810854C362800F1BCAB4B68A1A6CA181D1E20FAA", + "profile": "C:\\Users\\Administrator\\.ohos\\config\\default_ohos_6xxtsa71tFOUf4fm8t2beJeypPvMh1e4QNji1WnmN_U=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\Administrator\\.ohos\\config\\default_ohos_6xxtsa71tFOUf4fm8t2beJeypPvMh1e4QNji1WnmN_U=.p12", + "storePassword": "0000001BECCCE253F59766F238817C0732575D1696F113CE7DC1F7B6BF147CCC6009F83A8FC8726815C866" + } + } + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "6.1.0(23)", + "runtimeOS": "HarmonyOS", + "targetSdkVersion": "6.1.0(23)" + } + ], + "buildModeSet": [ + { + "name": "debug" + }, + { + "name": "profile" + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/ohos/entry/.gitignore b/ohos/entry/.gitignore new file mode 100644 index 00000000..5254b880 --- /dev/null +++ b/ohos/entry/.gitignore @@ -0,0 +1,7 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test +GeneratedPluginRegistrant.ets \ No newline at end of file diff --git a/ohos/entry/build-profile.json5 b/ohos/entry/build-profile.json5 new file mode 100644 index 00000000..6de31ee2 --- /dev/null +++ b/ohos/entry/build-profile.json5 @@ -0,0 +1,15 @@ + +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/ohos/entry/hvigorfile.ts b/ohos/entry/hvigorfile.ts new file mode 100644 index 00000000..ff3bfe08 --- /dev/null +++ b/ohos/entry/hvigorfile.ts @@ -0,0 +1,7 @@ + +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins: [] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/ohos/entry/oh-package.json5 b/ohos/entry/oh-package.json5 new file mode 100644 index 00000000..854eec20 --- /dev/null +++ b/ohos/entry/oh-package.json5 @@ -0,0 +1,11 @@ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {}, +} + diff --git a/ohos/entry/src/main/ets/AutoFillManagerStub.d.ts b/ohos/entry/src/main/ets/AutoFillManagerStub.d.ts new file mode 100644 index 00000000..61dd7d34 --- /dev/null +++ b/ohos/entry/src/main/ets/AutoFillManagerStub.d.ts @@ -0,0 +1,50 @@ +// Stub missing autoFillManager types for SDK compatibility +// The flutter_ohos plugin expects APIs from a newer SDK version + +declare module '@kit.AbilityKit' { + namespace autoFillManager { + export enum AutoFillType { + UNSPECIFIED = 0, + NORMAL = 1, + IME = 2, + } + + export enum AutoFillTriggerType { + AUTO_REQUEST = 0, + MANUAL_REQUEST = 1, + } + + export interface ViewData { + pageNodeInfos?: PageNodeInfo[]; + pageRect?: { x: number; y: number; width: number; height: number }; + } + + export interface PageNodeInfo { + autoFillType: number; + enableAutoFill: boolean; + rect: { x: number; y: number; width: number; height: number }; + } + + export interface FillRequest { + viewData?: ViewData; + triggerType?: AutoFillTriggerType; + } + + export interface SaveRequest { + viewData?: ViewData; + } + + export type AutoFillCallback = (err: { code: number; message: string }) => void; + + export interface FillFailureResult { + errCode: number; + errMessage: string; + } + + export function requestAutoFill( + context: object, + request: FillRequest, + callback: AutoFillCallback + ): void; + } +} diff --git a/ohos/entry/src/main/ets/entryability/EntryAbility.ets b/ohos/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 00000000..1ecf4eb9 --- /dev/null +++ b/ohos/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,54 @@ + +import { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos'; +import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant'; +import { OronBoxStubPlugins } from '../plugins/StubPlugins'; +import { OhosBleBridge } from '../plugins/OhosBleBridge'; +import { OronBoxUrlLauncherStub } from '../plugins/UrlLauncherStub'; +import { OronBoxAppLinksBridge } from '../plugins/AppLinksBridge'; +import { ClassicSppBridge } from '../plugins/ClassicSppBridge'; +import { FilePickerBridge } from '../plugins/FilePickerBridge'; +import Want from '@ohos.app.ability.Want'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + +export default class EntryAbility extends FlutterAbility { + private appLinksBridge: OronBoxAppLinksBridge | null = null; + + configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + GeneratedPluginRegistrant.registerWith(flutterEngine) + // 注册 OronBox 缺失插件的鸿蒙存根(path_provider / shared_preferences)。 + // OronBox 是桌面优先应用,这些插件在鸿蒙端无原生实现,Dart 侧启动时 + // 会因 channel 无 handler 而挂起(白屏)。这里提供最小实现让启动链路走通。 + new OronBoxStubPlugins(this.context).register(flutterEngine) + // 注册鸿蒙 BLE 桥接(universal_ble 无鸿蒙实现,改用 @ohos.bluetooth.ble)。 + new OhosBleBridge(this.context).register(flutterEngine) + // 注册 url_launcher 存根(无鸿蒙实现,用 startAbility 启动系统默认应用)。 + new OronBoxUrlLauncherStub(this.context).register(flutterEngine) + // 注册 app_links 桥接(无鸿蒙实现,捕获 deep link 回调)。 + const appLinks = new OronBoxAppLinksBridge(); + this.appLinksBridge = appLinks; + appLinks.register(flutterEngine) + // 注册 classic_spp 桥接(经典蓝牙 RFCOMM/SPP,小米手环连接)。 + new ClassicSppBridge(this.context).register(flutterEngine) + // 注册 file_picker 桥接(选图/选文件/保存,鸿蒙用 photoAccessHelper/picker)。 + new FilePickerBridge(this.context).register(flutterEngine) + } + + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + super.onCreate(want, launchParam) + // 捕获启动时携带的 deep link(如 oronbox://oauth/bandbbs?code=...)。 + const uri = want?.uri; + if (uri != null && uri.length > 0) { + this.appLinksBridge?.onDeepLink(uri); + } + } + + onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void { + super.onNewWant(want, launchParams) + // 捕获运行时 deep link(浏览器授权后回调)。 + const uri = want?.uri; + if (uri != null && uri.length > 0) { + this.appLinksBridge?.onDeepLink(uri); + } + } +} diff --git a/ohos/entry/src/main/ets/pages/Index.ets b/ohos/entry/src/main/ets/pages/Index.ets new file mode 100644 index 00000000..7bb6543f --- /dev/null +++ b/ohos/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,24 @@ + +import common from '@ohos.app.ability.common'; +import { FlutterPage } from '@ohos/flutter_ohos' + +let storage = LocalStorage.getShared() +const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS' + +@Entry(storage) +@Component +struct Index { + private context = getContext(this) as common.UIAbilityContext + @LocalStorageLink('viewId') viewId: string = ""; + + build() { + Column() { + FlutterPage({ viewId: this.viewId }) + } + } + + onBackPress(): boolean { + this.context.eventHub.emit(EVENT_BACK_PRESS) + return true + } +} \ No newline at end of file diff --git a/ohos/entry/src/main/ets/plugins/AppLinksBridge.ets b/ohos/entry/src/main/ets/plugins/AppLinksBridge.ets new file mode 100644 index 00000000..42551cc5 --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/AppLinksBridge.ets @@ -0,0 +1,91 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, EventChannel, StreamHandler, EventSink, BinaryMessenger } from '@ohos/flutter_ohos'; + +/** + * OronBox 鸿蒙 app_links 桥接层。 + * + * OronBox 用 app_links 插件监听 deep link(米坛 OAuth 登录回调 oronbox://oauth/bandbbs), + * 该插件在鸿蒙端无原生实现。本文件实现: + * - MethodChannel "com.llfbandit.app_links/messages":getInitialLink / getLatestLink + * - EventChannel "com.llfbandit.app_links/events":运行时 deep link 事件流 + * + * EntryAbility 在 onCreate/onNewWant 捕获 want.uri 后调用 onDeepLink() 注入。 + */ + +const TAG = 'OronBoxAppLinksBridge'; + +const APP_LINKS_METHOD_CHANNEL = 'com.llfbandit.app_links/messages'; +const APP_LINKS_EVENT_CHANNEL = 'com.llfbandit.app_links/events'; + +export class OronBoxAppLinksBridge { + private initialLink: string | null = null; + private latestLink: string | null = null; + private eventSink: EventSink | null = null; + + register(flutterEngine: FlutterEngine): void { + const messenger: BinaryMessenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + this.registerMethodChannel(messenger); + this.registerEventChannel(messenger); + } + + /** EntryAbility 调用:注入一个 deep link(启动时或运行时)。 */ + onDeepLink(uri: string | null): void { + if (uri == null || uri.length === 0) return; + this.latestLink = uri; + if (this.initialLink == null) { + this.initialLink = uri; + } + // 推送给 Dart 端的事件流。 + const sink = this.eventSink; + if (sink != null) { + try { + sink.success(uri); + } catch (e) { + console.error(TAG + ': event push failed: ' + JSON.stringify(e)); + } + } + } + + private registerMethodChannel(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, APP_LINKS_METHOD_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + try { + switch (call.method) { + case 'getInitialLink': + result.success(this.initialLink); + break; + case 'getLatestLink': + result.success(this.latestLink); + break; + default: + result.notImplemented(); + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('app_links_error', msg, null); + } + } + }); + } + + private registerEventChannel(messenger: BinaryMessenger): void { + const channel = new EventChannel(messenger, APP_LINKS_EVENT_CHANNEL); + const handler: StreamHandler = { + onListen: (args: Object | null, events: EventSink): void => { + this.eventSink = events; + // 启动时若有初始 link,立即推送一次。 + if (this.initialLink != null) { + try { + events.success(this.initialLink); + } catch (e) { + console.error(TAG + ': initial link push failed: ' + JSON.stringify(e)); + } + } + }, + onCancel: (args: Object | null): void => { + this.eventSink = null; + } + }; + channel.setStreamHandler(handler); + } +} diff --git a/ohos/entry/src/main/ets/plugins/ClassicSppBridge.ets b/ohos/entry/src/main/ets/plugins/ClassicSppBridge.ets new file mode 100644 index 00000000..0bbf5271 --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/ClassicSppBridge.ets @@ -0,0 +1,260 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, EventChannel, StreamHandler, EventSink, BinaryMessenger } from '@ohos/flutter_ohos'; +import socket from '@ohos.bluetooth.socket'; +import connection from '@ohos.bluetooth.connection'; +import common from '@ohos.app.ability.common'; +import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; +import { BusinessError } from '@ohos.base'; + +/** + * OronBox 鸿蒙 classic_spp(经典蓝牙 RFCOMM/SPP 串口)桥接层。 + * + * OronBox 用 classic_spp 做小米手环的经典蓝牙串口通信(文件传输、大数据下发)。 + * 该 channel 在鸿蒙端无原生实现,本文件用 @ohos.bluetooth.socket + @ohos.bluetooth.connection + * 实现扫描、连接、读写。 + * + * MethodChannel "oronbox/classic_spp":requestPermissions / startScan / stopScan / + * connect / send / disconnect + * EventChannel "oronbox/classic_spp/events":{event: 'connected'|'disconnected'|'data', data?} + * EventChannel "oronbox/classic_spp/scan_events":{addr, name} + */ + +const TAG = 'OronBoxClassicSppBridge'; + +const SPP_METHOD_CHANNEL = 'oronbox/classic_spp'; +const SPP_EVENT_CHANNEL = 'oronbox/classic_spp/events'; +const SPP_SCAN_EVENT_CHANNEL = 'oronbox/classic_spp/scan_events'; + +/** 小米手环常见 SPP service UUID(SPP 标准 UUID)。 */ +const SPP_UUID = '00001101-0000-1000-8000-00805f9b34fb'; + +const SPP_PERMISSIONS: Array = [ + 'ohos.permission.ACCESS_BLUETOOTH', + 'ohos.permission.LOCATION', +]; + +interface SppEvent { + event: string; + data?: Uint8Array; +} + +interface SppScanEvent { + addr: string; + name: string; +} + +export class ClassicSppBridge { + private context: common.UIAbilityContext; + private clientSocket: number = -1; + private eventSink: EventSink | null = null; + private scanEventSink: EventSink | null = null; + private discovered: Map = new Map(); + + constructor(context: common.UIAbilityContext) { + this.context = context; + } + + register(flutterEngine: FlutterEngine): void { + const messenger: BinaryMessenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + this.registerMethodChannel(messenger); + this.registerEventChannel(messenger); + this.registerScanEventChannel(messenger); + } + + // --------------------------------------------------------------------------- + private registerMethodChannel(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, SPP_METHOD_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + this.handleMethod(call, result); + } + }); + } + + private handleMethod(call: MethodCall, result: MethodResult): void { + try { + switch (call.method) { + case 'requestPermissions': + this.requestPermissions(result); + break; + case 'startScan': + this.startScan(result); + break; + case 'stopScan': + this.stopScan(result); + break; + case 'connect': + this.connect(call, result); + break; + case 'send': + this.send(call, result); + break; + case 'disconnect': + this.disconnect(result); + break; + default: + result.notImplemented(); + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('spp_error', msg, null); + } + } + + private registerEventChannel(messenger: BinaryMessenger): void { + const channel = new EventChannel(messenger, SPP_EVENT_CHANNEL); + const handler: StreamHandler = { + onListen: (args: Object | null, events: EventSink): void => { + this.eventSink = events; + }, + onCancel: (args: Object | null): void => { + this.eventSink = null; + } + }; + channel.setStreamHandler(handler); + } + + private registerScanEventChannel(messenger: BinaryMessenger): void { + const channel = new EventChannel(messenger, SPP_SCAN_EVENT_CHANNEL); + const handler: StreamHandler = { + onListen: (args: Object | null, events: EventSink): void => { + this.scanEventSink = events; + }, + onCancel: (args: Object | null): void => { + this.scanEventSink = null; + } + }; + channel.setStreamHandler(handler); + } + + private emitEvent(ev: SppEvent): void { + if (this.eventSink != null) { + try { this.eventSink.success(ev); } catch (e) { + console.error(TAG + ': event emit failed: ' + JSON.stringify(e)); + } + } + } + + private emitScanEvent(ev: SppScanEvent): void { + if (this.scanEventSink != null) { + try { this.scanEventSink.success(ev); } catch (e) { + console.error(TAG + ': scan event emit failed: ' + JSON.stringify(e)); + } + } + } + + // --------------------------------------------------------------------------- + private async requestPermissions(result: MethodResult): Promise { + try { + const atManager = abilityAccessCtrl.createAtManager(); + const res = await atManager.requestPermissionsFromUser(this.context, SPP_PERMISSIONS); + let granted = true; + for (let i = 0; i < res.authResults.length; i++) { + if (res.authResults[i] !== 0) { granted = false; break; } + } + result.success(granted); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('permission_error', msg, null); + } + } + + private startScan(result: MethodResult): void { + try { + this.discovered.clear(); + // 注册发现回调(若已注册先 off 避免重复)。 + try { connection.off('bluetoothDeviceFind'); } catch (_) {} + connection.on('bluetoothDeviceFind', (deviceIds: Array) => { + for (const id of deviceIds) { + let name = ''; + try { name = connection.getRemoteDeviceName(id); } catch (_) {} + this.discovered.set(id, name); + const ev: SppScanEvent = { addr: id, name: name }; + this.emitScanEvent(ev); + } + }); + connection.startBluetoothDiscovery(); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('scan_error', msg, null); + } + } + + private stopScan(result: MethodResult): void { + try { + connection.stopBluetoothDiscovery(); + try { connection.off('bluetoothDeviceFind'); } catch (_) {} + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('scan_error', msg, null); + } + } + + private connect(call: MethodCall, result: MethodResult): void { + try { + const addr: string = call.argument('addr'); + // 先停止扫描。 + try { connection.stopBluetoothDiscovery(); } catch (_) {} + const options: socket.SppOptions = { + uuid: SPP_UUID, + secure: false, + type: socket.SppType.SPP_RFCOMM, + }; + socket.sppConnect(addr, options, (err: BusinessError, clientSocket: number) => { + if (err != null && (err as BusinessError).code != null && (err as BusinessError).code !== 0) { + const msg = (err as BusinessError).message ?? String(err); + result.error('connect_error', msg, null); + return; + } + this.clientSocket = clientSocket; + // 监听读取。注意:sppRead 回调给的是 ArrayBuffer,StandardMessageCodec + // 只认识 Uint8Array,必须转换后 emit,否则 Dart 端收到错误结构。 + socket.on('sppRead', clientSocket, (data: ArrayBuffer) => { + this.emitEvent({ event: 'data', data: new Uint8Array(data) }); + }); + result.success({ + channel: clientSocket, + connectionMode: 'rfcomm', + discoveryMs: 0, + connectMs: 0, + }); + }); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('connect_error', msg, null); + } + } + + private send(call: MethodCall, result: MethodResult): void { + try { + const data: Uint8Array = call.argument('data'); + if (this.clientSocket < 0) { + result.error('not_connected', 'SPP socket not connected', null); + return; + } + // sppWrite 要求 ArrayBuffer;StandardMethodCodec 解码得到 Uint8Array, + // 取其底层 buffer 传入(注意 offset/length 对齐,这里按完整拷贝处理)。 + const buf: ArrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength) as ArrayBuffer; + socket.sppWrite(this.clientSocket, buf); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('send_error', msg, null); + } + } + + private disconnect(result: MethodResult): void { + try { + if (this.clientSocket >= 0) { + try { socket.sppCloseClientSocket(this.clientSocket); } catch (_) {} + this.clientSocket = -1; + } + this.emitEvent({ event: 'disconnected' }); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('disconnect_error', msg, null); + } + } +} diff --git a/ohos/entry/src/main/ets/plugins/FilePickerBridge.ets b/ohos/entry/src/main/ets/plugins/FilePickerBridge.ets new file mode 100644 index 00000000..0fe934cc --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/FilePickerBridge.ets @@ -0,0 +1,126 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, BinaryMessenger } from '@ohos/flutter_ohos'; +import { photoAccessHelper } from '@kit.MediaLibraryKit'; +import { picker } from '@kit.CoreFileKit'; +import { fileIo as fs } from '@kit.CoreFileKit'; +import common from '@ohos.app.ability.common'; + +/** + * OronBox 鸿蒙 file_picker 桥接层。 + * + * OronBox 用 file_picker 选文件/选图/保存,鸿蒙端无原生实现。 + * 本文件用鸿蒙 photoAccessHelper(选图)和 picker(选文件/保存)实现。 + * + * MethodChannel "oronbox/file_picker" 方法: + * pick {isImage, maxSelectNumber, suffixFilter} → string[] uri 列表 + * saveFile {fileName, bytes, mimeType} → string? savedUri + * readFile {path} → Uint8List 文件内容 + */ + +const TAG = 'OronBoxFilePickerBridge'; +const FILE_PICKER_CHANNEL = 'oronbox/file_picker'; + +/** 用户选择文件/图片的临时读权限,便于后续 readFile 读取。 */ +const PICKER_POLICY = 0; + +export class FilePickerBridge { + private context: common.UIAbilityContext; + + constructor(context: common.UIAbilityContext) { + this.context = context; + } + + register(flutterEngine: FlutterEngine): void { + const messenger: BinaryMessenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + const channel = new MethodChannel(messenger, FILE_PICKER_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + this.handle(call, result); + } + }); + } + + private handle(call: MethodCall, result: MethodResult): void { + try { + switch (call.method) { + case 'pick': + this.pick(call, result); + break; + case 'saveFile': + this.saveFile(call, result); + break; + case 'readFile': + this.readFile(call, result); + break; + default: + result.notImplemented(); + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('file_picker_error', msg, null); + } + } + + private async pick(call: MethodCall, result: MethodResult): Promise { + const isImage: boolean = call.argument('isImage'); + const maxSelectNumber: number = call.argument('maxSelectNumber') ?? 0; + const suffixFilter: Array | null = call.argument('suffixFilter'); + let uris: Array = []; + + if (isImage) { + const photoPicker = new photoAccessHelper.PhotoViewPicker(); + const options: photoAccessHelper.PhotoSelectOptions = { + MIMEType: photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE, + maxSelectNumber: maxSelectNumber, + }; + const photoResult: photoAccessHelper.PhotoSelectResult = + await photoPicker.select(options); + uris = photoResult.photoUris; + } else { + const docPicker = new picker.DocumentViewPicker(this.context); + const options: picker.DocumentSelectOptions = { + maxSelectNumber: maxSelectNumber, + fileSuffixFilters: suffixFilter ?? [], + }; + uris = await docPicker.select(options); + } + result.success(uris); + } + + private async saveFile(call: MethodCall, result: MethodResult): Promise { + const fileName: string = call.argument('fileName'); + const bytes: Uint8Array = call.argument('bytes'); + const docPicker = new picker.DocumentViewPicker(this.context); + const options: picker.DocumentSaveOptions = { + newFileNames: [fileName], + }; + const savedUris: Array = await docPicker.save(options); + if (savedUris.length === 0) { + result.success(null); + return; + } + // 把内容写入用户选择的 uri。 + try { + const target = savedUris[0]; + const file = fs.openSync(target, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE | fs.OpenMode.TRUNC); + fs.writeSync(file.fd, bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer); + fs.closeSync(file); + result.success(target); + } catch (e) { + result.error('save_write_error', e instanceof Error ? e.message : String(e), null); + } + } + + private async readFile(call: MethodCall, result: MethodResult): Promise { + const path: string = call.argument('path'); + try { + const file = fs.openSync(path, fs.OpenMode.READ_ONLY); + const stat = fs.statSync(path); + const buf = new ArrayBuffer(stat.size); + fs.readSync(file.fd, buf); + fs.closeSync(file); + result.success(new Uint8Array(buf)); + } catch (e) { + result.error('read_error', e instanceof Error ? e.message : String(e), null); + } + } +} diff --git a/ohos/entry/src/main/ets/plugins/OhosBleBridge.ets b/ohos/entry/src/main/ets/plugins/OhosBleBridge.ets new file mode 100644 index 00000000..45d69277 --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/OhosBleBridge.ets @@ -0,0 +1,439 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, EventChannel, StreamHandler, EventSink, BinaryMessenger } from '@ohos/flutter_ohos'; +import ble from '@ohos.bluetooth.ble'; +import bluetoothManager from '@ohos.bluetoothManager'; +import common from '@ohos.app.ability.common'; +import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; + +/** + * OronBox 鸿蒙 BLE 桥接层。 + * + * OronBox 依赖 universal_ble 插件做蓝牙,而该插件没有鸿蒙实现。 + * 本文件用鸿蒙原生 @ohos.bluetooth.ble API 实现 BLE 能力, + * 通过 MethodChannel(Dart→鸿蒙)和 EventChannel(鸿蒙→Dart)与 Dart 侧适配层通信。 + * + * MethodChannel "oronbox/ble" 方法:isAvailable / requestPermissions / startScan / + * stopScan / connect / disconnect / discoverServices / write / read / setNotify / + * requestMtu / getRssi + * + * EventChannel "oronbox/ble_events" 事件(Map): + * {type, ...} 其中 type ∈ scanResult / connectionState / characteristicChanged / mtuChanged + */ + +const TAG = 'OronBoxBleBridge'; +const BLE_CHANNEL = 'oronbox/ble'; +const BLE_EVENT_CHANNEL = 'oronbox/ble_events'; + +/** 需要动态申请的权限。 */ +const BLE_PERMISSIONS: Array = [ + 'ohos.permission.ACCESS_BLUETOOTH', + 'ohos.permission.LOCATION', + 'ohos.permission.APPROXIMATELY_LOCATION', +]; + +/** 事件推送用的统一结构。 */ +interface BleEvent { + type: string; + deviceId?: string; + name?: string; + rssi?: number; + data?: ArrayBuffer; + connected?: boolean; + serviceUuid?: string; + charUuid?: string; + value?: ArrayBuffer; + mtu?: number; +} + +/** 服务发现返回的特征值结构。 */ +interface CharInfo { + uuid: string; + properties: Array; +} + +/** 服务发现返回的服务结构。 */ +interface ServiceInfo { + uuid: string; + isPrimary: boolean; + characteristics: Array; +} + +export class OhosBleBridge { + private context: common.UIAbilityContext; + private scanner: ble.BleScanner | null = null; + private gattClients: Map = new Map(); + private eventSink: EventSink | null = null; + + constructor(context: common.UIAbilityContext) { + this.context = context; + } + + register(flutterEngine: FlutterEngine): void { + const messenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + this.registerEventChannel(messenger); + this.registerMethodChannel(messenger); + } + + // --------------------------------------------------------------------------- + // EventChannel:鸿蒙 → Dart + // --------------------------------------------------------------------------- + private registerEventChannel(messenger: BinaryMessenger): void { + const channel = new EventChannel(messenger, BLE_EVENT_CHANNEL); + const handler: StreamHandler = { + onListen: (args: Object | null, events: EventSink): void => { + this.eventSink = events; + }, + onCancel: (args: Object | null): void => { + this.eventSink = null; + } + }; + channel.setStreamHandler(handler); + } + + private emit(event: BleEvent): void { + const sink = this.eventSink; + if (sink == null) return; + try { + sink.success(event); + } catch (e) { + console.error(TAG + ': emit failed: ' + JSON.stringify(e)); + } + } + + // --------------------------------------------------------------------------- + // MethodChannel:Dart → 鸿蒙 + // --------------------------------------------------------------------------- + private registerMethodChannel(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, BLE_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + this.handleMethod(call, result); + } + }); + } + + private handleMethod(call: MethodCall, result: MethodResult): void { + try { + switch (call.method) { + case 'isAvailable': + this.isAvailable(result); + break; + case 'requestPermissions': + this.requestPermissions(result); + break; + case 'startScan': + this.startScan(call, result); + break; + case 'stopScan': + this.stopScan(result); + break; + case 'connect': + this.connect(call, result); + break; + case 'disconnect': + this.disconnect(call, result); + break; + case 'discoverServices': + this.discoverServices(call, result); + break; + case 'write': + this.write(call, result); + break; + case 'read': + this.read(call, result); + break; + case 'setNotify': + this.setNotify(call, result); + break; + case 'requestMtu': + this.requestMtu(call, result); + break; + case 'getRssi': + this.getRssi(call, result); + break; + default: + result.notImplemented(); + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('ble_error', msg, null); + } + } + + // --------------------------------------------------------------------------- + private isAvailable(result: MethodResult): void { + const state = bluetoothManager.getState(); + // STATE_ON = 2, STATE_BLE_ON = 5 + result.success(state === 2 || state === 5); + } + + private async requestPermissions(result: MethodResult): Promise { + try { + const atManager = abilityAccessCtrl.createAtManager(); + const res = await atManager.requestPermissionsFromUser(this.context, BLE_PERMISSIONS); + let granted = true; + for (let i = 0; i < res.authResults.length; i++) { + if (res.authResults[i] !== 0) { + granted = false; + break; + } + } + result.success(granted); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('permission_error', msg, null); + } + } + + private async startScan(call: MethodCall, result: MethodResult): Promise { + try { + await this.stopScanInternal(); + const scanner = ble.createBleScanner(); + this.scanner = scanner; + scanner.on('BLEDeviceFind', (report: ble.ScanReport) => { + const results: Array = report.scanResult; + for (const r of results) { + const data: ArrayBuffer = r.data instanceof ArrayBuffer ? r.data : new ArrayBuffer(0); + this.emit({ + type: 'scanResult', + deviceId: r.deviceId, + name: r.deviceName ?? '', + rssi: r.rssi, + data: data, + }); + } + }); + const filters: Array = []; + const servicesArg: Object | null = call.argument('services'); + if (servicesArg != null) { + const services = servicesArg as Array; + for (const s of services) { + const f: ble.ScanFilter = { serviceUuid: s }; + filters.push(f); + } + } + // 鸿蒙 startScan 要求 filters 至少有一个元素(空数组会报 401)。 + // 无 service 过滤时传一个空 filter 表示匹配所有设备。 + if (filters.length === 0) { + const emptyFilter: ble.ScanFilter = {}; + filters.push(emptyFilter); + } + await scanner.startScan(filters); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('scan_error', msg, null); + } + } + + private async stopScan(result: MethodResult): Promise { + try { + await this.stopScanInternal(); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('scan_error', msg, null); + } + } + + private async stopScanInternal(): Promise { + if (this.scanner != null) { + const scanner = this.scanner; + this.scanner = null; + try { + scanner.off('BLEDeviceFind'); + await scanner.stopScan(); + } catch (e) { + console.error(TAG + ': stopScanInternal failed: ' + JSON.stringify(e)); + } + } + } + + private getOrCreateClient(deviceId: string): ble.GattClientDevice { + let client = this.gattClients.get(deviceId); + if (client == null) { + client = ble.createGattClientDevice(deviceId); + client.on('BLEConnectionStateChange', (state: ble.BLEConnectionChangeState) => { + const connected = state.state === 2; // STATE_CONNECTED + const ev: BleEvent = { type: 'connectionState', deviceId: deviceId, connected: connected }; + this.emit(ev); + }); + client.on('BLECharacteristicChange', (characteristic: ble.BLECharacteristic) => { + const ev: BleEvent = { + type: 'characteristicChanged', + deviceId: deviceId, + serviceUuid: characteristic.serviceUuid, + charUuid: characteristic.characteristicUuid, + value: characteristic.characteristicValue, + }; + this.emit(ev); + }); + client.on('BLEMtuChange', (mtu: number) => { + const ev: BleEvent = { type: 'mtuChanged', deviceId: deviceId, mtu: mtu }; + this.emit(ev); + }); + this.gattClients.set(deviceId, client); + } + return client; + } + + private connect(call: MethodCall, result: MethodResult): void { + try { + const deviceId: string = call.argument('deviceId'); + const client = this.getOrCreateClient(deviceId); + client.connect(); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('connect_error', msg, null); + } + } + + private disconnect(call: MethodCall, result: MethodResult): void { + try { + const deviceId: string = call.argument('deviceId'); + const client = this.gattClients.get(deviceId); + if (client != null) { + client.disconnect(); + } + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('disconnect_error', msg, null); + } + } + + private async discoverServices(call: MethodCall, result: MethodResult): Promise { + try { + const deviceId: string = call.argument('deviceId'); + const client = this.getOrCreateClient(deviceId); + const services: Array = await client.getServices(); + const resultList: Array = []; + for (const svc of services) { + const chars: Array = []; + for (const ch of svc.characteristics) { + const props = ch.properties; + const properties: Array = []; + if (props != null) { + if (props.read) properties.push('read'); + if (props.write) properties.push('write'); + if (props.writeNoResponse) properties.push('writeWithoutResponse'); + if (props.notify) properties.push('notify'); + if (props.indicate) properties.push('indicate'); + } + const ci: CharInfo = { uuid: ch.characteristicUuid, properties: properties }; + chars.push(ci); + } + const si: ServiceInfo = { uuid: svc.serviceUuid, isPrimary: svc.isPrimary, characteristics: chars }; + resultList.push(si); + } + result.success(resultList); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('discover_error', msg, null); + } + } + + private findCharacteristic(client: ble.GattClientDevice, serviceUuid: string, charUuid: string): Promise { + return new Promise((resolve, reject) => { + client.getServices().then((services: Array) => { + for (const svc of services) { + if (svc.serviceUuid.toUpperCase() !== serviceUuid.toUpperCase()) continue; + for (const ch of svc.characteristics) { + if (ch.characteristicUuid.toUpperCase() === charUuid.toUpperCase()) { + resolve(ch); + return; + } + } + } + resolve(null); + }).catch((e: Error) => reject(e)); + }); + } + + private async write(call: MethodCall, result: MethodResult): Promise { + try { + const deviceId: string = call.argument('deviceId'); + const serviceUuid: string = call.argument('serviceUuid'); + const charUuid: string = call.argument('charUuid'); + const value: ArrayBuffer = call.argument('value'); + const writeType: number = call.argument('writeType'); + const client = this.getOrCreateClient(deviceId); + const ch = await this.findCharacteristic(client, serviceUuid, charUuid); + if (ch == null) { + result.error('char_not_found', 'characteristic not found: ' + charUuid, null); + return; + } + const wt: ble.GattWriteType = writeType === 2 ? ble.GattWriteType.WRITE_NO_RESPONSE : ble.GattWriteType.WRITE; + ch.characteristicValue = value; + await client.writeCharacteristicValue(ch, wt); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('write_error', msg, null); + } + } + + private async read(call: MethodCall, result: MethodResult): Promise { + try { + const deviceId: string = call.argument('deviceId'); + const serviceUuid: string = call.argument('serviceUuid'); + const charUuid: string = call.argument('charUuid'); + const client = this.getOrCreateClient(deviceId); + const ch = await this.findCharacteristic(client, serviceUuid, charUuid); + if (ch == null) { + result.error('char_not_found', 'characteristic not found: ' + charUuid, null); + return; + } + const read = await client.readCharacteristicValue(ch); + result.success(read.characteristicValue); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('read_error', msg, null); + } + } + + private async setNotify(call: MethodCall, result: MethodResult): Promise { + try { + const deviceId: string = call.argument('deviceId'); + const serviceUuid: string = call.argument('serviceUuid'); + const charUuid: string = call.argument('charUuid'); + const enable: boolean = call.argument('enable'); + const client = this.getOrCreateClient(deviceId); + const ch = await this.findCharacteristic(client, serviceUuid, charUuid); + if (ch == null) { + result.error('char_not_found', 'characteristic not found: ' + charUuid, null); + return; + } + await client.setCharacteristicChangeNotification(ch, enable); + result.success(true); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('notify_error', msg, null); + } + } + + private requestMtu(call: MethodCall, result: MethodResult): void { + try { + const deviceId: string = call.argument('deviceId'); + const mtu: number = call.argument('mtu'); + const client = this.getOrCreateClient(deviceId); + client.setBLEMtuSize(mtu); + result.success(mtu); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('mtu_error', msg, null); + } + } + + private async getRssi(call: MethodCall, result: MethodResult): Promise { + try { + const deviceId: string = call.argument('deviceId'); + const client = this.getOrCreateClient(deviceId); + const rssi = await client.getRssiValue(); + result.success(rssi); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('rssi_error', msg, null); + } + } +} diff --git a/ohos/entry/src/main/ets/plugins/StubPlugins.ets b/ohos/entry/src/main/ets/plugins/StubPlugins.ets new file mode 100644 index 00000000..5f25956e --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/StubPlugins.ets @@ -0,0 +1,174 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, BinaryMessenger } from '@ohos/flutter_ohos'; +import common from '@ohos.app.ability.common'; +import fs from '@ohos.file.fs'; +import { util } from '@kit.ArkTS'; + +/** + * OronBox 鸿蒙存根插件。 + * + * OronBox 本是一个桌面优先的 Flutter 应用,依赖大量 desktop/mobile 专用插件, + * 而这些插件在鸿蒙 fork (flutter_ohos) 中没有原生实现,导致 GeneratedPluginRegistrant + * 为空、Dart 侧调用这些插件时 channel 无 handler 而永久挂起(白屏)。 + * + * 本文件在鸿蒙端实现两个最关键的启动链路插件的最小存根: + * 1. path_provider —— 返回应用沙箱目录路径 + * 2. shared_preferences —— 用 JSON 文件持久化到应用 filesDir + * + * 其余插件(window_manager / tray_manager / url_launcher 等)在真正用到时再逐个补。 + */ + +const TAG = 'OronBoxStubPlugins'; + +/** path_provider 的 channel 名(与 Dart 侧 path_provider_platform_interface 一致)。 */ +const PATH_PROVIDER_CHANNEL = 'plugins.flutter.io/path_provider'; +/** shared_preferences 的 channel 名(与 Dart 侧 method_channel_shared_preferences 一致)。 */ +const SHARED_PREFS_CHANNEL = 'plugins.flutter.io/shared_preferences'; +/** shared_preferences 持久化文件名。 */ +const SHARED_PREFS_FILE = 'oronbox_shared_prefs.json'; + +export class OronBoxStubPlugins { + private context: common.UIAbilityContext; + + constructor(context: common.UIAbilityContext) { + this.context = context; + } + + /** 注册所有存根 channel。 */ + register(flutterEngine: FlutterEngine): void { + const messenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + this.registerPathProvider(messenger); + this.registerSharedPreferences(messenger); + } + + // --------------------------------------------------------------------------- + // path_provider + // --------------------------------------------------------------------------- + private registerPathProvider(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, PATH_PROVIDER_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + try { + switch (call.method) { + case 'getTemporaryDirectory': + result.success(this.context.tempDir); + break; + case 'getApplicationSupportDirectory': + result.success(this.context.filesDir); + break; + case 'getApplicationDocumentsDirectory': + result.success(this.context.filesDir); + break; + case 'getApplicationCacheDirectory': + result.success(this.context.cacheDir); + break; + default: + result.notImplemented(); + } + } catch (e) { + result.error('path_provider_error', e instanceof Error ? e.message : String(e), null); + } + } + }); + } + + // --------------------------------------------------------------------------- + // shared_preferences + // --------------------------------------------------------------------------- + private prefsFilePath(): string { + return this.context.filesDir + '/' + SHARED_PREFS_FILE; + } + + private readPrefsMap(): Map { + const map = new Map(); + const path = this.prefsFilePath(); + try { + if (!fs.accessSync(path)) { + return map; + } + const file = fs.openSync(path, fs.OpenMode.READ_ONLY); + const stat = fs.statSync(path); + const buf = new ArrayBuffer(stat.size); + fs.readSync(file.fd, buf); + fs.closeSync(file); + const text = this.bufToString(buf); + if (text.length === 0) { + return map; + } + const obj = JSON.parse(text) as Record; + for (const key of Object.keys(obj)) { + map.set(key, obj[key]); + } + } catch (e) { + console.error(TAG + ': readPrefsMap failed: ' + JSON.stringify(e)); + } + return map; + } + + private writePrefsMap(map: Map): void { + const obj: Record = {}; + map.forEach((value, key) => { + obj[key] = value; + }); + const path = this.prefsFilePath(); + try { + const file = fs.openSync(path, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE | fs.OpenMode.TRUNC); + fs.writeSync(file.fd, JSON.stringify(obj)); + fs.closeSync(file); + } catch (e) { + console.error(TAG + ': writePrefsMap failed: ' + JSON.stringify(e)); + } + } + + private bufToString(buf: ArrayBuffer): string { + const decoder = util.TextDecoder.create('utf-8'); + return decoder.decodeToString(new Uint8Array(buf)); + } + + private registerSharedPreferences(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, SHARED_PREFS_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + try { + const map = this.readPrefsMap(); + switch (call.method) { + case 'getAll': + case 'getAllWithParameters': + const obj: Record = {}; + map.forEach((value, key) => { obj[key] = value; }); + result.success(obj); + break; + case 'setString': + case 'setBool': + case 'setInt': + case 'setDouble': + case 'setStringList': { + const key: string = call.argument('key'); + const value: Object = call.argument('value'); + map.set(key, value); + this.writePrefsMap(map); + result.success(true); + break; + } + case 'remove': { + const key: string = call.argument('key'); + map.delete(key); + this.writePrefsMap(map); + result.success(true); + break; + } + case 'clear': + case 'clearWithParameters': + map.clear(); + this.writePrefsMap(map); + result.success(true); + break; + default: + result.notImplemented(); + } + } catch (e) { + result.error('shared_preferences_error', e instanceof Error ? e.message : String(e), null); + } + } + }); + } +} diff --git a/ohos/entry/src/main/ets/plugins/UrlLauncherStub.ets b/ohos/entry/src/main/ets/plugins/UrlLauncherStub.ets new file mode 100644 index 00000000..8597f7ff --- /dev/null +++ b/ohos/entry/src/main/ets/plugins/UrlLauncherStub.ets @@ -0,0 +1,105 @@ +import { FlutterEngine, MethodChannel, MethodCall, MethodResult, BinaryMessenger } from '@ohos/flutter_ohos'; +import common from '@ohos.app.ability.common'; +import Want from '@ohos.app.ability.Want'; + +/** + * OronBox 鸿蒙 url_launcher 存根。 + * + * OronBox 用 url_launcher 插件在外部打开链接(GitHub 链接、社区资源、登录回调等), + * 该插件在鸿蒙端无原生实现。本存根通过 UIAbilityContext.startAbility() 启动系统 + * 默认浏览器处理 http/https URL,从而替代插件的真实行为。 + * + * MethodChannel "plugins.flutter.io/url_launcher" 支持的方法: + * canLaunch {url} → 检查能否处理(http/https/mailto 等返回 true) + * launch {url, ...} → 用 startAbility 启动系统默认应用打开 URL + * closeWebView → 鸿蒙无 WebView 概念,静默返回成功 + */ + +const TAG = 'OronBoxUrlLauncherStub'; +const URL_LAUNCHER_CHANNEL = 'plugins.flutter.io/url_launcher'; + +/** 简易 scheme 判断:常见的可启动外部应用处理的 scheme。 */ +function isLaunchableScheme(url: string): boolean { + if (url == null || url.length === 0) return false; + const lower = url.toLowerCase(); + return lower.startsWith('http://') || + lower.startsWith('https://') || + lower.startsWith('mailto:') || + lower.startsWith('tel:') || + lower.startsWith('sms:') || + lower.startsWith('maps:') || + lower.startsWith('geo:'); +} + +export class OronBoxUrlLauncherStub { + private context: common.UIAbilityContext; + + constructor(context: common.UIAbilityContext) { + this.context = context; + } + + register(flutterEngine: FlutterEngine): void { + const messenger: BinaryMessenger = flutterEngine.getDartExecutor().getBinaryMessenger(); + this.registerChannel(messenger); + } + + private registerChannel(messenger: BinaryMessenger): void { + const channel = new MethodChannel(messenger, URL_LAUNCHER_CHANNEL); + channel.setMethodCallHandler({ + onMethodCall: (call: MethodCall, result: MethodResult): void => { + try { + switch (call.method) { + case 'canLaunch': + this.canLaunch(call, result); + break; + case 'launch': + this.launch(call, result); + break; + case 'closeWebView': + // 鸿蒙无内嵌 WebView 概念(与 url_launcher 的 webview 模式无关), + // 直接返回成功。 + result.success(null); + break; + default: + result.notImplemented(); + } + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + result.error('url_launcher_error', msg, null); + } + } + }); + } + + private canLaunch(call: MethodCall, result: MethodResult): void { + const url: string = call.argument('url'); + const can = isLaunchableScheme(url); + result.success(can); + } + + private launch(call: MethodCall, result: MethodResult): void { + const url: string = call.argument('url'); + if (!isLaunchableScheme(url)) { + result.success(false); + return; + } + // 用 Want + action 让系统打开 URL。viewData + uri 配合可以触发系统默认浏览器/邮件/拨号。 + const want: Want = { + action: 'ohos.want.action.viewData', + uri: url, + }; + try { + this.context.startAbility(want, () => { + // 启动结果通过 callback 通知。这里直接返回 true 表示调用已下发。 + // 即使系统未找到处理器,存根也已尽力,url_launcher 自身在无处理器时 + // 也会 fallback 到默认浏览器,无需返回 false。 + }); + result.success(true); + } catch (e) { + // 启动失败(缺权限、没找到应用等),返回 false 让 Dart 端走 fallback 路径。 + const msg = e instanceof Error ? e.message : String(e); + console.error(TAG + ': startAbility failed: ' + msg); + result.success(false); + } + } +} diff --git a/ohos/entry/src/main/module.json5 b/ohos/entry/src/main/module.json5 new file mode 100644 index 00000000..61f1142f --- /dev/null +++ b/ohos/entry/src/main/module.json5 @@ -0,0 +1,58 @@ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + }, + { + "entities": [ + "entity.system.browsable" + ], + "actions": [ + "ohos.want.action.viewData" + ], + "uris": [ + { + "scheme": "oronbox" + } + ] + } + ] + } + ], + "requestPermissions": [ + { "name": "ohos.permission.ACCESS_BLUETOOTH", "reason": "$string:perm_ble", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.USE_BLUETOOTH", "reason": "$string:perm_ble", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.LOCATION", "reason": "$string:perm_loc", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.APPROXIMATELY_LOCATION", "reason": "$string:perm_loc", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.INTERNET", "reason": "$string:perm_net", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } }, + { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", "reason": "$string:perm_bg", "usedScene": { "abilities": ["EntryAbility"], "when": "always" } } + ] + } +} \ No newline at end of file diff --git a/ohos/entry/src/main/resources/base/element/color.json b/ohos/entry/src/main/resources/base/element/color.json new file mode 100644 index 00000000..3c712962 --- /dev/null +++ b/ohos/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/main/resources/base/element/string.json b/ohos/entry/src/main/resources/base/element/string.json new file mode 100644 index 00000000..9ce6beda --- /dev/null +++ b/ohos/entry/src/main/resources/base/element/string.json @@ -0,0 +1,32 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "OronBox" + }, + { + "name": "perm_ble", + "value": "需要蓝牙权限以连接手环设备" + }, + { + "name": "perm_loc", + "value": "需要位置权限以扫描蓝牙设备" + }, + { + "name": "perm_net", + "value": "需要网络权限以同步数据" + }, + { + "name": "perm_bg", + "value": "需要后台运行权限以持续同步" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/main/resources/base/media/icon.png b/ohos/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a74f582b3122ad24a77dc2e9b2ccf01352327ba3 GIT binary patch literal 24515 zcmXtg1yodR*XWs{yBlewLlLDx9F>xm?vM@vhlZg+T3S*Xk?tO8QAz0z0qJg-dw9S5 z%W}cuJZE=5dx%g~eocT&iwgh%fxH|{9RQ%5zjE4& z5&(b+kcU0j^vKwmcTY8Z+a!IkKU1V4kftk=ud^9na(+Eb6_tEHZtByyy zYN-v|<#_=oCsQEPmq}GLX7FFzxy7d+7FWMY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OR<_m1Vg1 zE2_TaUNv}`-ptfgC`3{-^R zUP1^_lZ3=E@KH*x|?SZ*3Kw0 zWC?kMl7TzDEMO_=LmdSG&~ZMh;uLxt`u)>?{~&SHm&W;~aLUoe+eS;VkI&me;N{^0 zS;Dp;Rn>M7eS?E=6h+l_toRZMJ z$qdAV%EV=dI;uInaupFe5d+_)XOs=36dF;|U=qbKin4Y0NafJ;Rg$K2X5I1K%Wut_@n; zKhMRfcdE7VR#Wz-So%;{PmpQkG3?3c`*N2UPx1%F(e`3cKtkC3k@0kh;%e&n3&n*P z9v;YNBIDaR8`=!cAeO6i5z)F;LLWF%X}aNRzpoMo&0rG|Xc^{{Z7Hpd8gCd3m+#Ya zx<4$&ZZw)UWv{xz))Z0%!zCfEM`)Qdf7vtOEJC4|H3OO+M{EjmBso{G4?_28`{CJ; zKGyjAeNZUM^%gF~q(sI|f4eJ`unceZ*YJ#|REWrW83u};&20l+Rawp1Zo$tw7|-D4 w9mFPEgIbfy1K^JzDetqQs#TZt^6d@13OJU@Bjb+ literal 0 HcmV?d00001 diff --git a/ohos/entry/src/main/resources/base/profile/main_pages.json b/ohos/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 00000000..1898d94f --- /dev/null +++ b/ohos/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/ohos/entry/src/main/resources/en_US/element/string.json b/ohos/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 00000000..3b01098b --- /dev/null +++ b/ohos/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "OronBox" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/main/resources/rawfile/buildinfo.json5 b/ohos/entry/src/main/resources/rawfile/buildinfo.json5 new file mode 100644 index 00000000..6125c99c --- /dev/null +++ b/ohos/entry/src/main/resources/rawfile/buildinfo.json5 @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "enable_impeller", + "value": "true" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/main/resources/zh_CN/element/string.json b/ohos/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 00000000..883e038b --- /dev/null +++ b/ohos/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "OronBox" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/ets/test/Ability.test.ets b/ohos/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 00000000..8abf7f2f --- /dev/null +++ b/ohos/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,35 @@ +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +export default function abilityTest() { + describe('ActsAbilityTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain',0, function () { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc' + let b = 'b' + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b) + expect(a).assertEqual(a) + }) + }) +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/ets/test/List.test.ets b/ohos/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 00000000..d766fe24 --- /dev/null +++ b/ohos/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test' + +export default function testsuite() { + abilityTest() +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets b/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 00000000..e3f6e911 --- /dev/null +++ b/ohos/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,48 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; + +export default class TestAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets b/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets new file mode 100644 index 00000000..545843d3 --- /dev/null +++ b/ohos/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -0,0 +1,36 @@ + + +import hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts new file mode 100644 index 00000000..47fc89b4 --- /dev/null +++ b/ohos/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,50 @@ + +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/module.json5 b/ohos/entry/src/ohosTest/module.json5 new file mode 100644 index 00000000..3b02a75a --- /dev/null +++ b/ohos/entry/src/ohosTest/module.json5 @@ -0,0 +1,37 @@ + +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "phone" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/ohos/entry/src/ohosTest/resources/base/element/color.json b/ohos/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 00000000..3c712962 --- /dev/null +++ b/ohos/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/resources/base/element/string.json b/ohos/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 00000000..65d8fa5a --- /dev/null +++ b/ohos/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/ohos/entry/src/ohosTest/resources/base/media/icon.png b/ohos/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1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?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y +#include +#include +#include "napi/native_api.h" + +// 占位:真实实现需 #include 对应 OpenHarmony BLE C API 或走 @ohos.bluetooth.ble 的 NAPI 封装 +namespace universal_ble { + +// 继承 pigeon 生成的 UniversalBlePlatformChannel +class UniversalBleOhosHost : public UniversalBlePlatformChannel { + public: + // ---- 以下每个方法都需实现,调用 @ohos.bluetooth.ble 对应能力 ---- + + // 蓝牙可用状态 + BleAvailabilityState GetBluetoothAvailabilityState() override { + // TODO: 调 bluetooth 状态监听,返回 on/off/turningOn... + return BleAvailabilityState::kOff; + } + + bool IsBluetoothEnabled() override { + // TODO: 返回上一项是否为 on + return false; + } + + void StartScan(const ScanFilter& filter, bool android_use_fine_location) override { + // TODO: ble.startBLEScan(...) 注册扫描回调,结果经 OnScanResult 推回 Dart + (void)filter; (void)android_use_fine_location; + } + + void StopScan() override { + // TODO: ble.stopBLEScan(...) + } + + void Connect(const std::string& device_id) override { + // TODO: GattClientDevice(device_id).connect(...) + } + + void Disconnect(const std::string& device_id) override { + // TODO: device.disconnect() + } + + ConnectionState GetConnectionState(const std::string& device_id) override { + // TODO: 查询并返回连接状态 + (void)device_id; + return ConnectionState::kDisconnected; + } + + std::vector DiscoverServices(const std::string& device_id) override { + // TODO: device.getServices() / getCharacteristics() + (void)device_id; + return {}; + } + + std::vector ReadValue(const std::string& device_id, + const std::string& characteristic_id, + const std::optional& descriptor_id) override { + // TODO: device.readCharacteristicValue(...) + (void)device_id; (void)characteristic_id; (void)descriptor_id; + return {}; + } + + void WriteValue(const std::string& device_id, + const std::string& characteristic_id, + const std::vector& value, + WriteType write_type) override { + // TODO: device.writeCharacteristicValue(..., write_type == withResponse) + (void)device_id; (void)characteristic_id; (void)value; (void)write_type; + } + + void SetNotifiable(const std::string& device_id, + const std::string& characteristic_id, + BleInputProperty property) override { + // TODO: device.setCharacteristicChangeNotification(...) 订阅 notify/indicate + (void)device_id; (void)characteristic_id; (void)property; + } + + int64_t RequestMtu(const std::string& device_id, int64_t mtu) override { + // TODO: device.setDeviceMtuSize(mtu) + (void)device_id; (void)mtu; + return 23; + } + + void Pair(const std::string& device_id) override { + // TODO: device.pair() + (void)device_id; + } + + bool IsPaired(const std::string& device_id) override { + // TODO: 查询配对状态 + (void)device_id; + return false; + } + + int64_t GetRssi(const std::string& device_id) override { + // TODO: device.getRssi() + (void)device_id; + return 0; + } + + // ---- 事件回调:C++ 侧主动调用,把事件推回 Dart ---- + void PushScanResult(const ScanResult& r) { GetCallback()->OnScanResult(r); } + void PushConnectionChanged(const std::string& device_id, ConnectionState s) { + GetCallback()->OnConnectionChanged(device_id, s); + } + void PushValueChanged(const std::string& device_id, const std::string& characteristic_id, + const std::vector& value) { + GetCallback()->OnValueChanged(device_id, characteristic_id, value); + } +}; + +} // namespace universal_ble + +// NAPI 注册入口(供 .ets 的 registerUniversalBleHost 调用) +extern "C" bool registerUniversalBleHost() { + // 把 UniversalBleOhosHost 实例设置给 pigeon 生成的通道 + // UniversalBlePlatformChannel::SetUp(/*binaryMessenger*/, std::make_unique()); + return true; +} diff --git a/ohos/universal_ble_ohos/ets/BackgroundSync.ets b/ohos/universal_ble_ohos/ets/BackgroundSync.ets new file mode 100644 index 00000000..2187cab1 --- /dev/null +++ b/ohos/universal_ble_ohos/ets/BackgroundSync.ets @@ -0,0 +1,51 @@ +// BackgroundSync.ets — 后台定时同步模板 +// 鸿蒙对后台管控严格,纯定时轮询会被系统杀掉。 +// 做法:用 backgroundTaskManager 申请长时任务(BLUETOOTH_INTERACTION)维持 BLE 连接, +// 配合代理提醒(reminderAgent)做周期唤醒。 +import { backgroundTaskManager } from '@kit.BackgroundTasksKit'; +import { reminderAgent } from '@kit.NotificationKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG = 'OronBox:BgSync'; + +// 申请长时任务(需在 module.json5 声明 KEEP_BACKGROUND_RUNNING 权限) +export function startBackgroundSync(): void { + try { + backgroundTaskManager.startRunningTask({ + abilityName: 'EntryAbility', + // 蓝牙交互类长时任务 + // @ts-ignore 具体枚举以 SDK 版本为准 + backgroundTaskType: backgroundTaskManager.BackgroundTaskType.BLUETOOTH_INTERACTION, + } as never); + hilog.info(0x0000, TAG, 'startRunningTask ok'); + } catch (e) { + hilog.error(0x0000, TAG, 'startRunningTask failed: %{public}s', JSON.stringify(e)); + } +} + +export function stopBackgroundSync(): void { + try { + backgroundTaskManager.stopRunningTask('EntryAbility'); + hilog.info(0x0000, TAG, 'stopRunningTask ok'); + } catch (e) { + hilog.error(0x0000, TAG, 'stopRunningTask failed: %{public}s', JSON.stringify(e)); + } +} + +// 注册周期提醒(每 N 分钟唤醒一次做同步) +export function schedulePeriodicSync(minutes: number): void { + try { + const reminder: reminderAgent.ReminderRequestTimer = { + reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, + triggerTimeInSeconds: minutes * 60, + title: 'OronBox 同步', + content: '正在同步可穿戴设备数据', + // slotType / notificationId 等字段按 SDK 文档补齐 + } as reminderAgent.ReminderRequestTimer; + reminderAgent.publishReminder(reminder).then((id) => { + hilog.info(0x0000, TAG, 'publishReminder id=%{public}d', id); + }); + } catch (e) { + hilog.error(0x0000, TAG, 'publishReminder failed: %{public}s', JSON.stringify(e)); + } +} diff --git a/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets b/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets new file mode 100644 index 00000000..1ec3de82 --- /dev/null +++ b/ohos/universal_ble_ohos/ets/UniversalBleOhosPlugin.ets @@ -0,0 +1,25 @@ +// UniversalBleOhosPlugin.ets — NAPI 加载器 +// 真正的 BLE 逻辑在 C++ Pigeon host(universal_ble_ohos_host.cpp)里。 +// 这里只负责把 .so 加载进来并触发注册。 +import { hilog } from '@kit.PerformanceAnalysisKit'; +import native from 'libuniversal_ble_ohos.so'; // 由 CMake 产物提供 + +export class UniversalBleOhosPlugin { + private static registered = false; + + static register(): void { + if (UniversalBleOhosPlugin.registered) { + return; + } + try { + // 调用 C++ 侧导出的注册函数(函数名需与 cpp 中 napi_module / 注册宏一致) + const ok = (native as unknown as { registerUniversalBleHost?: () => boolean }).registerUniversalBleHost?.(); + UniversalBleOhosPlugin.registered = ok !== false; + hilog.info(0x0000, 'OronBox', 'UniversalBleOhosPlugin registered=%{public}s', String(UniversalBleOhosPlugin.registered)); + } catch (e) { + hilog.error(0x0000, 'OronBox', 'UniversalBleOhosPlugin register failed: %{public}s', JSON.stringify(e)); + } + } +} + +export const universalBleOhosPlugin = new UniversalBleOhosPlugin(); diff --git a/ohos/universal_ble_ohos/ets/XiaomiLogin.ets b/ohos/universal_ble_ohos/ets/XiaomiLogin.ets new file mode 100644 index 00000000..6c7438a9 --- /dev/null +++ b/ohos/universal_ble_ohos/ets/XiaomiLogin.ets @@ -0,0 +1,51 @@ +// XiaomiLogin.ets — 小米账号 2FA 登录(ArkWeb) +// 小米 OAuth/2FA 需要 WebView。鸿蒙用 ArkWeb 内核(webview_flutter 的 ohos 适配版)。 +// 注意 cookie 持久化行为差异:登录态需自行用 @ohos.web.webview 的 CookieManager 管理。 +import { webview } from '@kit.ArkWeb'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; + +const TAG = 'OronBox:XiaomiLogin'; +const MI_AUTH_URL = 'https://account.xiaomi.com/oauth2/authorize?...'; // 按小米开放平台参数补齐 + +export class XiaomiLogin { + private controller: webview.WebviewController = new webview.WebviewController(); + + aboutToAppear(): void { + // 允许 JavaScript 与文件访问(按安全策略收紧) + webview.WebviewController.setWebDebuggingAccess(true); + } + + build(): void { + // 实际组件请在页面中使用 标签,这里仅给出控制器与回调逻辑 + this.controller.loadUrl(MI_AUTH_URL); + } + + // 监听登录完成后回调 URL,提取 token + onPageFinished(url: string): void { + hilog.info(0x0000, TAG, 'page finished: %{public}s', url); + if (url.includes('oronbox://auth-callback')) { + const token = this.extractToken(url); + hilog.info(0x0000, TAG, 'token captured'); + // TODO: 把 token 通过 MethodChannel / 全局状态交给 Dart 层 + void token; + } + } + + private extractToken(url: string): string { + const m = url.match(/[?&]token=([^&]+)/); + return m ? m[1] : ''; + } + + // 持久化 cookie(ArkWeb 与 flutter webview 的 cookie 可能不同源,需手动桥接) + persistCookies(): void { + try { + const cm = webview.CookieManager.getInstance(); + cm.getCookieSync(MI_AUTH_URL, (cookie: string) => { + hilog.info(0x0000, TAG, 'cookie: %{public}s', cookie); + }); + } catch (e) { + hilog.error(0x0000, TAG, 'getCookie failed: %{public}s', JSON.stringify(e as BusinessError)); + } + } +} diff --git a/pubspec.lock b/pubspec.lock index 2d8db418..cb4bf0a5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,64 +5,56 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "1b0e6a07425a3e460666e88bf1c949ccc7bb0116ad562ce94a1eca60fe820725" - url: "https://pub.dev" + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.flutter-io.cn" source: hosted - version: "103.0.0" + version: "85.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "61c04d0c1bfed555c681ea079519933f071a5a026578ff73c4ff0df2d3462e5e" - url: "https://pub.dev" + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.flutter-io.cn" source: hosted - version: "13.3.0" - analyzer_buffer: - dependency: transitive - description: - name: analyzer_buffer - sha256: "445b77e2054fa3e8c8a8ef1b5e9e6b23bb8028fffd34b5e60eaef315b7750674" - url: "https://pub.dev" - source: hosted - version: "0.3.3" + version: "7.7.1" android_file_picker: dependency: transitive description: name: android_file_picker - sha256: "665a5a57dfca27f91a715d300e4852a784f9f98e503dcff281bec9afb55767be" - url: "https://pub.dev" + sha256: "3384b62685e04ce7afeaf57e94bf29bc167e32240be6c6cb382a94632aec0241" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "1.0.2" app_links: dependency: "direct main" description: name: app_links - sha256: f8db46d2ea9ff6f3a37191a7fd5b7813da1253ace8c32c1b9eadace41d1188ea - url: "https://pub.dev" + sha256: "5f88447519add627fe1cbcab4fd1da3d4fed15b9baf29f28b22535c95ecee3e8" + url: "https://pub.flutter-io.cn" source: hosted - version: "7.2.1" + version: "6.4.1" app_links_linux: dependency: transitive description: name: app_links_linux sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" app_links_platform_interface: dependency: transitive description: name: app_links_platform_interface - sha256: "7546f09a6e93f4a2df2fe2bd40a5c6c64310ac461b036d82b43033be7a59f809" - url: "https://pub.dev" + sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.4" + version: "2.0.2" app_links_web: dependency: transitive description: name: app_links_web sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" archive: @@ -70,7 +62,7 @@ packages: description: name: archive sha256: ace891da0862b0e4cabbb064ee3fd87b2728b898949fdb366d83fe98342c9f19 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.0" args: @@ -78,7 +70,7 @@ packages: description: name: args sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.7.0" async: @@ -86,7 +78,7 @@ packages: description: name: async sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.13.1" bluez: @@ -94,7 +86,7 @@ packages: description: name: bluez sha256: "61a7204381925896a374301498f2f5399e59827c6498ae1e924aaa598751b545" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.8.3" boolean_selector: @@ -102,55 +94,71 @@ packages: description: name: boolean_selector sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" build: dependency: transitive description: name: build - sha256: b94f5da9ed3d081fd4ecc426c260998b5f4f4eb2f6d89b7e5472edef0b2b2a1b - url: "https://pub.dev" + sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.10" + version: "2.5.4" build_cli_annotations: dependency: transitive description: name: build_cli_annotations sha256: e563c2e01de8974566a1998410d3f6f03521788160a02503b0b1f1a46c7b3d95 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" build_config: dependency: transitive description: name: build_config - sha256: "94eaf6708fe64408c632ef2689ca3777b112f9421306ccf4f8c84d7c5c9f83f8" - url: "https://pub.dev" + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.2" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon sha256: "79e05eaf15a48d7230b053a4363b8eaac0cc234bbd0134c3229455481f55cbc6" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.5" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "90363d438bd9f84a4d5bbb83352251f57d2d9d771bc95a44e6a33fe25fa52774" - url: "https://pub.dev" + sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.4" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.16.0" + version: "9.1.2" built_collection: dependency: transitive description: name: built_collection sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: @@ -158,7 +166,7 @@ packages: description: name: built_value sha256: "31b24be6615ec7fcf70b3aa5a7469fe35826485e639a16dd7eb83ba30e4cc6a8" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "8.12.7" cached_network_image: @@ -166,7 +174,7 @@ packages: description: name: cached_network_image sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.1" cached_network_image_platform_interface: @@ -174,7 +182,7 @@ packages: description: name: cached_network_image_platform_interface sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.1" cached_network_image_web: @@ -182,7 +190,7 @@ packages: description: name: cached_network_image_web sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" characters: @@ -190,7 +198,7 @@ packages: description: name: characters sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" charset: @@ -198,7 +206,7 @@ packages: description: name: charset sha256: "27802032a581e01ac565904ece8c8962564b1070690794f0072f6865958ce8b9" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" checked_yaml: @@ -206,39 +214,39 @@ packages: description: name: checked_yaml sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.4" - cli_config: - dependency: transitive - description: - name: cli_config - sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec - url: "https://pub.dev" - source: hosted - version: "0.2.0" clock: dependency: transitive description: name: clock sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" code_assets: dependency: transitive description: name: code_assets - sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" - url: "https://pub.dev" + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.2.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.11.1" collection: dependency: transitive description: name: collection sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.19.1" convert: @@ -246,31 +254,23 @@ packages: description: name: convert sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.2" - coverage: - dependency: transitive - description: - name: coverage - sha256: "956a3de0725ca232ad353565a8290d3357592bf4250f6f298a185e2d949c5d3d" - url: "https://pub.dev" - source: hosted - version: "1.15.1" cross_file: dependency: "direct main" description: name: cross_file - sha256: "92c9c43c383bfa1c32079d3bc492d55d6d4318044b7b47edaff8971cbb555c51" - url: "https://pub.dev" + sha256: f141ea4f277af142a0356955707f6556f37b03947d39d55585981a06ca437bd6 + url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.5+4" + version: "0.3.5+5" crypto: dependency: "direct main" description: name: crypto sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.7" csslib: @@ -278,7 +278,7 @@ packages: description: name: csslib sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" csv: @@ -286,7 +286,7 @@ packages: description: name: csv sha256: "2e0a52fb729f2faacd19c9c0c954ff450bba37aa8ab999410309e2342e7013a2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "8.0.0" cupertino_icons: @@ -294,47 +294,39 @@ packages: description: name: cupertino_icons sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.9" - cupertino_ui: - dependency: transitive - description: - name: cupertino_ui - sha256: "7ed8ce4159d342eec4c65f4ea6eec57adaf9365404378541f38efc1da20a5b3d" - url: "https://pub.dev" - source: hosted - version: "1.0.0" dart_style: dependency: transitive description: name: dart_style - sha256: "3f88fc9c96c568d631356507355a2d1e983ee000c9ac008bdcb39b5bf53ce777" - url: "https://pub.dev" + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.12" + version: "3.1.1" dbus: dependency: transitive description: name: dbus sha256: a48d5da28e89bd02196e80d81ed8d7954923d00a0f4a68cc20b575038f023383 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.15" desktop_drop: dependency: "direct main" description: name: desktop_drop - sha256: "8b07a8b4db47e0768c2a3a9433eb29160478be5f80905643fc0f79a4ae188e1e" - url: "https://pub.dev" + sha256: c65d1f959ccf4bb6803f984303d03e1e0dd4c0f73a3a2eca2d1b46d48ea16999 + url: "https://pub.flutter-io.cn" source: hosted - version: "0.8.0" + version: "0.8.2" dio: dependency: "direct main" description: name: dio sha256: "0df44ebba85e503958eb75d07eedd3c86275a58c1d3eda2f2ce8f0a2c3abbb3c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "5.11.0" dio_web_adapter: @@ -342,23 +334,23 @@ packages: description: name: dio_web_adapter sha256: "0786d0b7295a373de356fc0af4f6f1d0ab2844ed31b19dfc5e7556b70e24212c" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" dynamic_color: dependency: "direct main" description: name: dynamic_color - sha256: "869b3bce0100eb519768ecd71c0111f0b5ea679f5f62e1f59c49d80067e730c5" - url: "https://pub.dev" + sha256: "4aeb76de323e8eb660bab5557d826ad7ebbf1434a598f0c6aa8a11a9696a6757" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "1.9.0" enough_convert: dependency: "direct main" description: name: enough_convert sha256: c67d85ca21aaa0648f155907362430701db41f7ec8e6501a58ad9cd9d8569d01 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0" fake_async: @@ -366,7 +358,7 @@ packages: description: name: fake_async sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" ffi: @@ -374,7 +366,7 @@ packages: description: name: ffi sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" ffi_leak_tracker: @@ -382,7 +374,7 @@ packages: description: name: ffi_leak_tracker sha256: "4093d4ef9ca06ffe2786e73bfb25e22aa92112b9bb4ec941f11e3e6b61489a97" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.2" file: @@ -390,55 +382,55 @@ packages: description: name: file sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.1" file_picker: dependency: "direct main" description: name: file_picker - sha256: afbaa8015d9efabd224f41084ed9fdeddfa65389ebd7cd3a9eb1476aca66b46d - url: "https://pub.dev" + sha256: "70e04f5ef83360433ea0099dc18154126536d85ef3cb4f63c2573725e49f608c" + url: "https://pub.flutter-io.cn" source: hosted - version: "12.0.0" + version: "12.1.1" file_picker_darwin: dependency: transitive description: name: file_picker_darwin - sha256: "5d87d156c1d63920447a662b7117d3498c67e3444a44d2cb01ed955d6efa62ef" - url: "https://pub.dev" + sha256: bdcba9c830f90ecba26020159e6bb90bce862ec58fabf1c41edb9db43e2f0eae + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "1.0.3" file_picker_linux: dependency: transitive description: name: file_picker_linux sha256: "93d3f62f97c657053e7b184fe0f5e22347d85067c053640a30b1ac8ad7844e3b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" file_picker_platform_interface: dependency: transitive description: name: file_picker_platform_interface - sha256: "9e7a7e01e179929241f0afeb2c8c69ac95e29e17c0abea36ed193881c6bef90c" - url: "https://pub.dev" + sha256: b1ddd7909853c9df0eb4dbc5b388837ff313e28d6d5a9a71a83794b70c4c86bd + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.1.0" file_picker_web: dependency: transitive description: name: file_picker_web - sha256: f1af38b3c91fafe0ca97f659b5c6818a057473ef09bb8b722f9f3f5364aa7eed - url: "https://pub.dev" + sha256: "067051c42bb6ceb7650f2771206ca4c4908855a786cc03a0cb7240da441106f3" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1" + version: "3.0.2" fixnum: dependency: "direct main" description: name: fixnum sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" flutter: @@ -451,7 +443,7 @@ packages: description: name: flutter_cache_manager sha256: "1de7849213b4c73c85aca7e0ac687a9a5d82ccdb594366b9dcc26cb6a2189cd2" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.2" flutter_lints: @@ -459,7 +451,7 @@ packages: description: name: flutter_lints sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.0" flutter_localizations: @@ -472,23 +464,23 @@ packages: description: name: flutter_markdown_plus sha256: fce641d6c2106cc495de1cd603f97a4f9d615a97a64011928ded380dbdade935 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.12" flutter_riverpod: dependency: "direct main" description: name: flutter_riverpod - sha256: "56e81e662e6e54e59b231da57e90ac0d06ac67d8e3f2273c129a37ae6282b40c" - url: "https://pub.dev" + sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.4.2" + version: "2.6.1" flutter_rust_bridge: dependency: transitive description: name: flutter_rust_bridge sha256: "02720226035257ad0b571c1256f43df3e1556a499f6bcb004849a0faaa0e87f0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.82.6" flutter_soloud: @@ -496,7 +488,7 @@ packages: description: name: flutter_soloud sha256: "9e753b54f858f988558614db82ae692dd1043fe2a446dd6187076e7d34c000b4" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.7" flutter_svg: @@ -504,7 +496,7 @@ packages: description: name: flutter_svg sha256: "35882981abcbfb8c15b286f0cd690ff25bac12d95eff3e25ee207f37d4c42e7f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0" flutter_test: @@ -517,7 +509,7 @@ packages: description: name: flutter_web_bluetooth sha256: ad26a1b3fef95b86ea5f63793b9a0cdc1a33490f35d754e4e711046cae3ebbf8 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" flutter_web_plugins: @@ -529,24 +521,24 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "27585a6c2b9ac28ffb7b45d87fd1502332af1eb90e1c9f5eb1acb24c71d26e17" - url: "https://pub.dev" + sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.0" + version: "2.5.8" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" - url: "https://pub.dev" + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.0" + version: "2.4.4" frontend_server_client: dependency: transitive description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" glob: @@ -554,7 +546,7 @@ packages: description: name: glob sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" go_router: @@ -562,7 +554,7 @@ packages: description: name: go_router sha256: d7a3576cb312649eaa51f2356450aed686085fb58fcdebda5b359aa951eef7ea - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "17.5.0" graphs: @@ -570,7 +562,7 @@ packages: description: name: graphs sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" gtk: @@ -578,23 +570,23 @@ packages: description: name: gtk sha256: "4ff85b2a16724029dd9e5bbb5a94b6918f9973f74ba571c949d2002801879cf5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" hooks: dependency: transitive description: name: hooks - sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e" - url: "https://pub.dev" + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.3" + version: "2.0.2" html: dependency: "direct main" description: name: html sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.6" http: @@ -602,7 +594,7 @@ packages: description: name: http sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0" http_multi_server: @@ -610,7 +602,7 @@ packages: description: name: http_multi_server sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.2" http_parser: @@ -618,7 +610,7 @@ packages: description: name: http_parser sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.2" image: @@ -626,23 +618,23 @@ packages: description: name: image sha256: "1976370a4df3091bb0f72409c187ad1f9132a818bc6b95ca59c0bae1c75c688e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.9.2" intl: dependency: "direct main" description: name: intl - sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867" - url: "https://pub.dev" + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.20.3" + version: "0.20.2" io: dependency: transitive description: name: io sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" jni: @@ -650,7 +642,7 @@ packages: description: name: jni sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" jni_flutter: @@ -658,7 +650,7 @@ packages: description: name: jni_flutter sha256: "7b717011ea40d04fd47c2731d3d1d36eb99eba3435c2753d62489e8c3c9991d5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" js: @@ -666,31 +658,31 @@ packages: description: name: js sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.7" json_annotation: dependency: "direct main" description: name: json_annotation - sha256: "2a743920d81b7910627f68ee2c9ac1fc0bfee32b9fc3403587d7c6791ca12f80" - url: "https://pub.dev" + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.12.0" + version: "4.9.0" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: e45aefa0324f08c683caafbb94b72837aa6193c61822799c916e45f4a263113d - url: "https://pub.dev" + sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + url: "https://pub.flutter-io.cn" source: hosted - version: "6.14.1" + version: "6.9.5" leak_tracker: dependency: transitive description: name: leak_tracker sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "11.0.2" leak_tracker_flutter_testing: @@ -698,7 +690,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.10" leak_tracker_testing: @@ -706,7 +698,7 @@ packages: description: name: leak_tracker_testing sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" lints: @@ -714,23 +706,15 @@ packages: description: name: lints sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" - listen: - dependency: transitive - description: - name: listen - sha256: "47501a08016a43fcad79252439d723f50f14f88fa7bfd8a177e0a417e5c9e1f2" - url: "https://pub.dev" - source: hosted - version: "1.0.1" logging: dependency: "direct main" description: name: logging sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" markdown: @@ -738,39 +722,31 @@ packages: description: name: markdown sha256: ee85086ad7698b42522c6ad42fe195f1b9898e4d974a1af4576c1a3a176cada9 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.3.1" matcher: dependency: transitive description: name: matcher - sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" - url: "https://pub.dev" + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.20" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.0" - material_ui: - dependency: "direct main" - description: - name: material_ui - sha256: "4f3f38b9953df0a87d6bf5f21880029f77c47048487d5339410c39936be4683b" - url: "https://pub.dev" - source: hosted - version: "1.0.1" mdns_dart: dependency: "direct main" description: name: mdns_dart sha256: "05ea831072a63f5eca5e1be8b88de3e96673d18585ca3d8c97c934f5e0d3b360" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" menu_base: @@ -778,72 +754,54 @@ packages: description: name: menu_base sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.1" meta: dependency: transitive description: name: meta - sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9" - url: "https://pub.dev" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.19.0" + version: "1.18.0" mime: dependency: transitive description: name: mime sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" - native_toolchain_c: - dependency: transitive - description: - name: native_toolchain_c - sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572" - url: "https://pub.dev" - source: hosted - version: "0.17.6" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" objective_c: dependency: transitive description: name: objective_c - sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52" - url: "https://pub.dev" + sha256: b7fb95a6d9a4f009edd63dc5ac69f07420b23a16161c6dd8660290b59c602e8e + url: "https://pub.flutter-io.cn" source: hosted - version: "9.3.0" + version: "9.5.0" octo_image: dependency: transitive description: name: octo_image sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" oronbox_network: dependency: "direct main" description: - path: "." - ref: "v0.1.2" - resolved-ref: "18429280b3b9b774cb80f1b406db26fcce6ef04d" - url: "https://github.com/zxor-org/OronBox-Package-Network.git" - source: git + path: "../OronBox-Package-Network" + relative: true + source: path version: "0.1.2" package_config: dependency: transitive description: name: package_config sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" path: @@ -851,7 +809,7 @@ packages: description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.1" path_parsing: @@ -859,7 +817,7 @@ packages: description: name: path_parsing sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" path_provider: @@ -867,7 +825,7 @@ packages: description: name: path_provider sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.6" path_provider_android: @@ -875,7 +833,7 @@ packages: description: name: path_provider_android sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" path_provider_foundation: @@ -883,7 +841,7 @@ packages: description: name: path_provider_foundation sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.6.0" path_provider_linux: @@ -891,7 +849,7 @@ packages: description: name: path_provider_linux sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.2" path_provider_platform_interface: @@ -899,7 +857,7 @@ packages: description: name: path_provider_platform_interface sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" path_provider_windows: @@ -907,7 +865,7 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0" petitparser: @@ -915,7 +873,7 @@ packages: description: name: petitparser sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.2" platform: @@ -923,7 +881,7 @@ packages: description: name: platform sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.6" plugin_platform_interface: @@ -931,7 +889,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.8" pointycastle: @@ -939,7 +897,7 @@ packages: description: name: pointycastle sha256: "92aa3841d083cc4b0f4709b5c74fd6409a3e6ba833ffc7dc6a8fee096366acf5" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" pool: @@ -947,7 +905,7 @@ packages: description: name: pool sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.2" posix: @@ -955,7 +913,7 @@ packages: description: name: posix sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.5.2" protobuf: @@ -963,7 +921,7 @@ packages: description: name: protobuf sha256: "75ec242d22e950bdcc79ee38dd520ce4ee0bc491d7fadc4ea47694604d22bf06" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.0" pub_semver: @@ -971,7 +929,7 @@ packages: description: name: pub_semver sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" pubspec_parse: @@ -979,7 +937,7 @@ packages: description: name: pubspec_parse sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" puppeteer: @@ -987,7 +945,7 @@ packages: description: name: puppeteer sha256: "272fae28aa8491b76830fba82737007938c7f8a56d6d0aa314aee0298eb2a39f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.26.0" qr: @@ -995,7 +953,7 @@ packages: description: name: qr sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" qr_flutter: @@ -1003,7 +961,7 @@ packages: description: name: qr_flutter sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" quickjs_engine: @@ -1011,7 +969,7 @@ packages: description: name: quickjs_engine sha256: f0738189a6fc0c669b57e5bf8541b12fdfa9d02853611313d7198fe189f4cfa7 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5" record_use: @@ -1019,23 +977,23 @@ packages: description: name: record_use sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" riverpod: dependency: transitive description: name: riverpod - sha256: "84351b3472a447f7b89f961f95c73287009d58c59d8cc1267425d995f78e50f1" - url: "https://pub.dev" + sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.4.2" + version: "2.6.1" rxdart: dependency: transitive description: name: rxdart sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.28.0" screen_retriever: @@ -1043,7 +1001,7 @@ packages: description: name: screen_retriever sha256: ace919117a7520c13a50a6259e60c4a0d4cbe98809468792a91b5c5adada2aa6 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2" screen_retriever_linux: @@ -1051,7 +1009,7 @@ packages: description: name: screen_retriever_linux sha256: "7b52006a5ceae1f3d5af7f77188c3290d6e7d8ded16d99809bea84967c65c257" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2" screen_retriever_macos: @@ -1059,7 +1017,7 @@ packages: description: name: screen_retriever_macos sha256: a1489b99cce597c45a54b9aae1cd94c8d4705353b7e0bb2457a6e4de44e0ad8a - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2" screen_retriever_platform_interface: @@ -1067,7 +1025,7 @@ packages: description: name: screen_retriever_platform_interface sha256: "94a5535277510a63184ca178ce12a1449bc0b38618879aa1c18bf57369c5064a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2" screen_retriever_windows: @@ -1075,7 +1033,7 @@ packages: description: name: screen_retriever_windows sha256: dafc6922b0bfbf1d48cf3ccbf519b4fff47bdcb820da1728ea6db675fecc9324 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.2" segmented_list: @@ -1090,23 +1048,23 @@ packages: description: name: shared_preferences sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.5" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "0634e64bd719f89c012f392938e173521f535d3ecaf66558fa94a056d22b5cc7" - url: "https://pub.dev" + sha256: e8d4762b1e2e8578fc4d0fd548cebf24afd24f49719c08974df92834565e2c53 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.27" + version: "2.4.23" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.6" shared_preferences_linux: @@ -1114,7 +1072,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -1122,7 +1080,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.2" shared_preferences_web: @@ -1130,7 +1088,7 @@ packages: description: name: shared_preferences_web sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.3" shared_preferences_windows: @@ -1138,7 +1096,7 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" shelf: @@ -1146,23 +1104,15 @@ packages: description: name: shelf sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.2" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.3" shelf_web_socket: @@ -1170,7 +1120,7 @@ packages: description: name: shelf_web_socket sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.4" shortid: @@ -1178,7 +1128,7 @@ packages: description: name: shortid sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.2" sky_engine: @@ -1190,88 +1140,72 @@ packages: dependency: transitive description: name: source_gen - sha256: a603f1fb984a7391ae5978d1b92bfaaa08b350dca5c825256f925818f7943bf5 - url: "https://pub.dev" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + url: "https://pub.flutter-io.cn" source: hosted - version: "4.2.4" + version: "2.0.0" source_helper: dependency: transitive description: name: source_helper - sha256: "5e6f216fdf6376c9f3852381ae037499797a3385377d388b011dac98d303c67c" - url: "https://pub.dev" - source: hosted - version: "1.3.13" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b - url: "https://pub.dev" + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "14c2945847669b44089bb1222f66873d7ff7103c58911917f2a63c5a62327898" - url: "https://pub.dev" - source: hosted - version: "0.10.14" + version: "1.3.7" source_span: dependency: transitive description: name: source_span sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.2" sqflite: dependency: transitive description: name: sqflite - sha256: "58a799e6ac17dd32fbab93813d39ed835a75ccc0f8f85b8955fe318c6712b082" - url: "https://pub.dev" + sha256: "564cfed0746fe53140c23b70b308e045c3b31f17778f2f326ccb7d804ea0250a" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.3" + version: "2.4.2+1" sqflite_android: dependency: transitive description: name: sqflite_android - sha256: d0548f9d7422a2dae99ec6f8b0a3074463b132d216fa5ba0d230eeefc901983b - url: "https://pub.dev" + sha256: "881e28efdcc9950fd8e9bb42713dcf1103e62a2e7168f23c9338d82db13dec40" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.3" + version: "2.4.2+3" sqflite_common: dependency: transitive description: name: sqflite_common sha256: "5bf6a55c166e73bf651ba7ec3ed486e577620e3dc8f3a9c6a258a8031b624590" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.11" sqflite_darwin: dependency: transitive description: name: sqflite_darwin - sha256: c86ca18b8f666bbf903924687fe21cc16fc385d086005067e26619ca530bef9f - url: "https://pub.dev" + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.3+1" + version: "2.4.2" sqflite_platform_interface: dependency: transitive description: name: sqflite_platform_interface - sha256: f84939f84350d92d04416f8bc4dc52d3896aec7716cc9e80cf0146342139dc50 - url: "https://pub.dev" + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.1" + version: "2.4.0" stack_trace: dependency: transitive description: name: stack_trace sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.12.1" state_notifier: @@ -1279,7 +1213,7 @@ packages: description: name: state_notifier sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" stream_channel: @@ -1287,7 +1221,7 @@ packages: description: name: stream_channel sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" stream_transform: @@ -1295,7 +1229,7 @@ packages: description: name: stream_transform sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" string_scanner: @@ -1303,7 +1237,7 @@ packages: description: name: string_scanner sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" sync_http: @@ -1311,7 +1245,7 @@ packages: description: name: sync_http sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.1" synchronized: @@ -1319,7 +1253,7 @@ packages: description: name: synchronized sha256: "3a7b5d17422dd0f8d5c6c14feaa5a1c65638b9455f871a96f08437562c046931" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.1+2" term_glyph: @@ -1327,39 +1261,31 @@ packages: description: name: term_glyph sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.2" - test: - dependency: transitive - description: - name: test - sha256: ca578dc12bb8b2f40b67b7d3bd2fac4f31c01a6ff7130a14e2597b919934507f - url: "https://pub.dev" - source: hosted - version: "1.31.1" test_api: dependency: transitive description: name: test_api - sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" - url: "https://pub.dev" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.12" - test_core: + version: "0.7.11" + timing: dependency: transitive description: - name: test_core - sha256: d2e98ec12998368dc59ddd47ab709f2cd55acd6b66dc7db764455a44082f4bc5 - url: "https://pub.dev" + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.18" + version: "1.0.2" tray_manager: dependency: "direct main" description: name: tray_manager sha256: "1a659b08baa6e9b91ef8ce16eda37740de398be1c4cf322b8a1ddfef25c68c5a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.3" tuple: @@ -1367,7 +1293,7 @@ packages: description: name: tuple sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" typed_data: @@ -1375,23 +1301,23 @@ packages: description: name: typed_data sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" universal_ble: dependency: "direct main" description: name: universal_ble - sha256: acf41bc04affa322fbb48a29ee724408fac7b39e9fe83e9ef45d5925076de5e5 - url: "https://pub.dev" + sha256: "8325ca9f5cce2fba2b4efef74a4fcfe7144f303b409d6fc6ed16197b00a1a241" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.1" + version: "1.2.0" universal_platform: dependency: transitive description: name: universal_platform sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" url_launcher: @@ -1399,23 +1325,23 @@ packages: description: name: url_launcher sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: b413d49b73867ac08dd2f9890efd3cc11f2a0e577618d50843440a1fb3776c32 - url: "https://pub.dev" + sha256: "17bc677f0b301615530dd1d67e0a9828cafa2d0b6b6eae4cd3679b7eac4a273c" + url: "https://pub.flutter-io.cn" source: hosted - version: "6.3.32" + version: "6.3.30" url_launcher_ios: dependency: transitive description: name: url_launcher_ios sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.4.1" url_launcher_linux: @@ -1423,7 +1349,7 @@ packages: description: name: url_launcher_linux sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.2" url_launcher_macos: @@ -1431,7 +1357,7 @@ packages: description: name: url_launcher_macos sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.5" url_launcher_platform_interface: @@ -1439,7 +1365,7 @@ packages: description: name: url_launcher_platform_interface sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" url_launcher_web: @@ -1447,7 +1373,7 @@ packages: description: name: url_launcher_web sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.3" url_launcher_windows: @@ -1455,7 +1381,7 @@ packages: description: name: url_launcher_windows sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.5" uuid: @@ -1463,7 +1389,7 @@ packages: description: name: uuid sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.0" vector_graphics: @@ -1471,7 +1397,7 @@ packages: description: name: vector_graphics sha256: "9d0e3b9cb16542ad660daee871e726a10d13a93b7b5391677c3160e8f5e83935" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.3" vector_graphics_codec: @@ -1479,7 +1405,7 @@ packages: description: name: vector_graphics_codec sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.13" vector_graphics_compiler: @@ -1487,23 +1413,23 @@ packages: description: name: vector_graphics_compiler sha256: "4dca4feb77dc3ec7f6e27e49c53241eb8217f55e4f9b12599a27f8903bca5682" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47 - url: "https://pub.dev" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.2" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service sha256: "5f37239c4851efcef929cea7824e76df7f2f0970aef85d66bbc430afa40e72f0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "15.3.0" wasm_interop: @@ -1511,7 +1437,7 @@ packages: description: name: wasm_interop sha256: b1b378f07a4cf0103c25faf34d9a64d2c3312135b9efb47e0ec116ec3b14e48f - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" wasm_run: @@ -1519,7 +1445,7 @@ packages: description: name: wasm_run sha256: "9cb3f7b6905f2c7a962afe9beb68a9e8f7859566f2f885afbae7b72cfc1586eb" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0+2" wasm_run_flutter: @@ -1527,7 +1453,7 @@ packages: description: name: wasm_run_flutter sha256: "9807fd559676614350d5480846de29aa687a1f48b6a1b438cf120e01cffd84a0" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.0" watcher: @@ -1535,7 +1461,7 @@ packages: description: name: watcher sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" web: @@ -1543,7 +1469,7 @@ packages: description: name: web sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" web_socket_channel: @@ -1551,23 +1477,15 @@ packages: description: name: web_socket_channel sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" win32: dependency: transitive description: name: win32 sha256: a0b93865d5644f11cf6a8c3f6db909f1ec168958b5805f6cc684adea957cd63d - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "6.4.0" window_manager: @@ -1575,23 +1493,23 @@ packages: description: name: window_manager sha256: "05c231fd7b23d2380f14c5cc10b7b93d60d4fa4a2fb4e0f032de27e44b5560e9" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.2" windows_file_picker: dependency: transitive description: name: windows_file_picker - sha256: "72cf23466e146f2c0f19e1d78be97ff6409dc15b0c090f8eb284f94f4a33de26" - url: "https://pub.dev" + sha256: "1659127cb9e9e31a136352bfcb50fa4bb9e242dd7e0b71f99c3943b142e3026a" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "1.0.2" xdg_directories: dependency: transitive description: name: xdg_directories sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" xml: @@ -1599,7 +1517,7 @@ packages: description: name: xml sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4" - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.1" yaml: @@ -1607,9 +1525,9 @@ packages: description: name: yaml sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.dev" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.3" sdks: - dart: ">=3.13.0 <4.0.0" - flutter: ">=3.44.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.41.0" diff --git a/pubspec.yaml b/pubspec.yaml index a9fc132d..9e381333 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.1.2+14 environment: - sdk: ^3.13.0 + sdk: ^3.12.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -33,13 +33,19 @@ dependencies: flutter_localizations: sdk: flutter - intl: ^0.20.3 + # Pinned to 0.20.2 to match flutter_localizations in this Flutter fork (3.41.9-oh). + intl: 0.20.2 go_router: ^17.3.0 - flutter_riverpod: ^3.3.2 + flutter_riverpod: ">=2.5.0 <3.0.0" url_launcher: ^6.3.1 cached_network_image: ^3.4.1 - dynamic_color: ^2.1.0 - material_ui: ^1.0.1 + # dynamic_color 2.0+ adopted package:material_ui which requires Dart 3.12+. + # 1.9.0 was the last release before that migration. + dynamic_color: ">=1.7.0 <2.0.0" + # material_ui (Flutter Material split-out package) requires Dart 3.12+, + # but our Flutter fork ships Dart 3.11.5. We import the built-in + # package:flutter/material.dart directly instead — the API surface is + # identical because material_ui is literally that file extracted. dio: ^5.8.0 csv: ^8.0.0 html: ^0.15.6 @@ -47,13 +53,13 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 - freezed_annotation: ^3.1.0 - json_annotation: ^4.12.0 + freezed_annotation: ^2.4.0 + json_annotation: ">=4.0.0 <4.12.0" segmented_list: path: packages/segmented_list flutter_svg: ^2.3.0 shared_preferences: ^2.5.5 - universal_ble: ^2.1.0 + universal_ble: ">=1.0.0 <2.0.0" protobuf: ^6.0.0 fixnum: ^1.1.1 pointycastle: ^4.0.0 @@ -66,7 +72,7 @@ dependencies: enough_convert: ^1.6.0 logging: ^1.3.0 qr_flutter: ^4.1.0 - app_links: ^7.2.0 + app_links: ">=6.3.0 <7.0.0" path_provider: ^2.1.6 desktop_drop: ^0.8.0 window_manager: ^0.5.2 @@ -76,10 +82,11 @@ dependencies: # dynamic Android libraries with a static `.a` filename under Flutter 3.47. wasm_run_flutter: ^0.1.0 quickjs_engine: ^0.1.5 + # Temporarily swapped from the upstream git dependency to a local path + # while we are offline (Pub's git ref fetch requires GitHub connectivity). + # The path points at a v0.1.2 mirror cloned locally from Pub's cache. oronbox_network: - git: - url: https://github.com/zxor-org/OronBox-Package-Network.git - ref: v0.1.2 + path: ../OronBox-Package-Network web: ^1.1.1 flutter_markdown_plus: ^1.0.12 uuid: ^4.5.3 @@ -94,14 +101,17 @@ dev_dependencies: # package. See that file for information about deactivating specific lint # rules and activating additional ones. flutter_lints: ^6.0.0 - build_runner: ^2.16.0 - freezed: ^4.0.0 - json_serializable: ^6.14.0 + # build_runner 2.15.2+ pulls analyzer 13+ which needs meta 1.18+, + # but our Flutter fork pins meta at 1.17.0. + build_runner: ">=2.4.0 <2.15.2" + freezed: ^2.5.0 + # json_serializable 6.15.1+ pulls in build 4.x which clashes with freezed 2.x. + json_serializable: ">=6.0.0 <6.15.1" dependency_overrides: # wasm_run_flutter 0.1.0 still declares the Freezed 2 annotation constraint, # while its generated bindings remain compatible with the Freezed 3 runtime. - freezed_annotation: ^3.1.0 + freezed_annotation: ^2.4.0 # jni 1.0.3 dropped the __ENVP_CAST workaround and fails to compile dartjni # on desktop with recent clang. jni: 1.0.0 diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 00000000..3473a207 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:oronbox/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}