mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-05 14:51:11 +00:00
Compare commits
251 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a56ccb4de | ||
|
|
8f76281fe3 | ||
|
|
c1fc848c92 | ||
|
|
a74f0d62cc | ||
|
|
74021dd8b6 | ||
|
|
4503a0f099 | ||
|
|
b6f0fb41aa | ||
|
|
43e7154ffc | ||
|
|
9a0b97476e | ||
|
|
68f42060ff | ||
|
|
f812bf9890 | ||
|
|
2e8ec39752 | ||
|
|
a6c822ab85 | ||
|
|
f349b475e2 | ||
|
|
01438b22c1 | ||
|
|
5f21a61142 | ||
|
|
18df2d93cc | ||
|
|
70b6e29ad0 | ||
|
|
8f85d96488 | ||
|
|
c8a382c08f | ||
|
|
0f131203f2 | ||
|
|
bfbad50772 | ||
|
|
dc9816eb9e | ||
|
|
c6a0f5b8c0 | ||
|
|
91046e7f5e | ||
|
|
678f8d8cd7 | ||
|
|
6263a0a5e6 | ||
|
|
45c0476636 | ||
|
|
d86d454f52 | ||
|
|
2be5441cf4 | ||
|
|
a673f70862 | ||
|
|
1d59acff2d | ||
|
|
724f7d8242 | ||
|
|
3135edad8e | ||
|
|
bba2dbd360 | ||
|
|
66ead87d47 | ||
|
|
1a1f72a596 | ||
|
|
062014f24a | ||
|
|
4078395a89 | ||
|
|
dd762d53b2 | ||
|
|
eb42c7101d | ||
|
|
9ec72c29ca | ||
|
|
bb6d63efe2 | ||
|
|
380eb1e77f | ||
|
|
e9021117ff | ||
|
|
e56f7c5294 | ||
|
|
32cffea018 | ||
|
|
4b2ac25c1f | ||
|
|
00e8b0c303 | ||
|
|
dc163d790c | ||
|
|
750f3b1fee | ||
|
|
e3bdf33eec | ||
|
|
c5f54e04b5 | ||
|
|
b62c603b01 | ||
|
|
0186b5f9f0 | ||
|
|
70c47a8b85 | ||
|
|
6ec973144e | ||
|
|
9a28257f4a | ||
|
|
07f476e324 | ||
|
|
28efaf0685 | ||
|
|
f69b65f233 | ||
|
|
56c1ec98c5 | ||
|
|
a05737a4f4 | ||
|
|
f37208a383 | ||
|
|
3f6a9f44d4 | ||
|
|
13875f850f | ||
|
|
b787898e1f | ||
|
|
50c8d294f9 | ||
|
|
cf3e67838d | ||
|
|
c8962d509c | ||
|
|
39d571960b | ||
|
|
a132c85b8c | ||
|
|
f68b7a4380 | ||
|
|
138be64c0d | ||
|
|
3fd020b8b0 | ||
|
|
83c0fa6a26 | ||
|
|
0126ae811e | ||
|
|
23e909e330 | ||
|
|
c172b623d7 | ||
|
|
da0bf8f4e7 | ||
|
|
df025319aa | ||
|
|
c456a2ac47 | ||
|
|
a813617689 | ||
|
|
9872823aff | ||
|
|
8c4c11df6a | ||
|
|
fddaa99779 | ||
|
|
fbf40580cf | ||
|
|
8ea5373dec | ||
|
|
8898569067 | ||
|
|
3c60b5a2c1 | ||
|
|
c77684ddb8 | ||
|
|
d750b91f61 | ||
|
|
3f5aaaecd9 | ||
|
|
53ffab783f | ||
|
|
39ddea7254 | ||
|
|
289691896d | ||
|
|
4315e36cbe | ||
|
|
c5de9e2252 | ||
|
|
fe141d98c2 | ||
|
|
62b8718dbd | ||
|
|
f6676ed3d8 | ||
|
|
855ea1fe8f | ||
|
|
dcb288597f | ||
|
|
79e1256759 | ||
|
|
b11603d68c | ||
|
|
6f0c760ab4 | ||
|
|
125fedbc84 | ||
|
|
19488507b0 | ||
|
|
bf246e469f | ||
|
|
1c4eafccca | ||
|
|
aaa97429b9 | ||
|
|
f3fab62291 | ||
|
|
e1ed30b6e6 | ||
|
|
e3c3986379 | ||
|
|
a0290cf28a | ||
|
|
6c3d9d05be | ||
|
|
0f24b506fa | ||
|
|
9704ddc211 | ||
|
|
fc6063866c | ||
|
|
db89100402 | ||
|
|
db024f19bd | ||
|
|
5ccd2def37 | ||
|
|
28789792ce | ||
|
|
7d6f7879c4 | ||
|
|
9959ae8c8f | ||
|
|
f744acbad5 | ||
|
|
da7c4b958d | ||
|
|
3c07d12ee9 | ||
|
|
825b399ab1 | ||
|
|
509f65b165 | ||
|
|
f9c06c0980 | ||
|
|
4718b4627b | ||
|
|
078eae8e52 | ||
|
|
2f680b98e9 | ||
|
|
c26d9cdc42 | ||
|
|
69b87620d6 | ||
|
|
c1c8bebec7 | ||
|
|
7db8f01009 | ||
|
|
967c46e6eb | ||
|
|
5d1443b472 | ||
|
|
a0382a1d2a | ||
|
|
5c668cba2c | ||
|
|
19034a04d5 | ||
|
|
3e9f82ecdf | ||
|
|
f551ccfbde | ||
|
|
1c40fac522 | ||
|
|
a199ba745a | ||
|
|
7a38d0d386 | ||
|
|
d1f19bae4e | ||
|
|
b65187d4f0 | ||
|
|
f6340337db | ||
|
|
6fda5628ff | ||
|
|
2ffb02e62d | ||
|
|
a6a5a117bc | ||
|
|
0983ebe21f | ||
|
|
aaaee30368 | ||
|
|
fd2291a85d | ||
|
|
f98235f2f3 | ||
|
|
77c1b4f51a | ||
|
|
af15d106f0 | ||
|
|
31d867bf3b | ||
|
|
3f660c7d5e | ||
|
|
d82cfb41aa | ||
|
|
3219129094 | ||
|
|
58da84c0a6 | ||
|
|
028660cbba | ||
|
|
857e471f28 | ||
|
|
fba1e49600 | ||
|
|
fc4b5c590b | ||
|
|
90fef6bcba | ||
|
|
cabe05eb03 | ||
|
|
e212928f57 | ||
|
|
95f1cc6481 | ||
|
|
4c7f7c5b2e | ||
|
|
a6942ca396 | ||
|
|
88dd4bdf8b | ||
|
|
64d5e27a72 | ||
|
|
80f87a8337 | ||
|
|
6c940ce6f3 | ||
|
|
c2a512699c | ||
|
|
8d635827c4 | ||
|
|
2f2a3c3889 | ||
|
|
df437b222d | ||
|
|
4822d0c76d | ||
|
|
04e06c18c9 | ||
|
|
e70edb7bab | ||
|
|
d8af51db28 | ||
|
|
bafcf42dbc | ||
|
|
bb96740607 | ||
|
|
5412382a59 | ||
|
|
31626efa9f | ||
|
|
44b4c4be82 | ||
|
|
5e1a9750f8 | ||
|
|
9ea6e09846 | ||
|
|
830ac75f08 | ||
|
|
107ad46a53 | ||
|
|
e26ea0d7d9 | ||
|
|
a6dc5a659e | ||
|
|
f9466dc3a1 | ||
|
|
ca2e971c6d | ||
|
|
99104527d4 | ||
|
|
44bf771f4c | ||
|
|
6119505426 | ||
|
|
998213bc69 | ||
|
|
8bfea81ee6 | ||
|
|
3c1e71891b | ||
|
|
92d65e69da | ||
|
|
86b2411fe6 | ||
|
|
c39412b099 | ||
|
|
7ebfb5e39d | ||
|
|
4e89578695 | ||
|
|
7a921e6d38 | ||
|
|
34ea335b3f | ||
|
|
07ca125c5b | ||
|
|
301c002c90 | ||
|
|
ea0e046bee | ||
|
|
277c193d73 | ||
|
|
0df2fe7580 | ||
|
|
f63a2f833a | ||
|
|
b1b6b358f5 | ||
|
|
4e37b87d59 | ||
|
|
2463bb1560 | ||
|
|
f328d981c8 | ||
|
|
488ad2a485 | ||
|
|
4679d559d9 | ||
|
|
d257663b27 | ||
|
|
5d735632bf | ||
|
|
2139bfb652 | ||
|
|
4d4c9db816 | ||
|
|
2d7e309395 | ||
|
|
b4dc6e34eb | ||
|
|
f958edc5c7 | ||
|
|
2f74fef969 | ||
|
|
b276043c31 | ||
|
|
9cc7a7684c | ||
|
|
3479d09ba5 | ||
|
|
27a05414b8 | ||
|
|
af7074b37b | ||
|
|
05a1b62b8a | ||
|
|
db1b8141d3 | ||
|
|
8a7ac8eb8d | ||
|
|
80456079a3 | ||
|
|
86b35ebd3d | ||
|
|
c4d3d099cd | ||
|
|
e887986854 | ||
|
|
debc31a6ed | ||
|
|
08ddaa897e | ||
|
|
edd49cb55f | ||
|
|
b181d918bd | ||
|
|
df225b9850 | ||
|
|
055421f22f |
258
.github/copilot-instructions.md
vendored
Normal file
258
.github/copilot-instructions.md
vendored
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
# StarCitizenToolBox Flutter/Rust Desktop Application
|
||||||
|
|
||||||
|
StarCitizenToolBox is a Flutter desktop application with Rust native bindings designed for Star Citizen players. It provides localization management, game diagnostics, website translations, performance optimization, and various tools for the Star Citizen gaming experience. The app supports Windows, macOS, and Linux platforms using Fluent UI design.
|
||||||
|
|
||||||
|
Always reference these instructions first and fallback to additional search or context gathering only when information in these instructions is incomplete or found to be in error.
|
||||||
|
|
||||||
|
## Working Effectively
|
||||||
|
|
||||||
|
### Initial Setup and Dependencies
|
||||||
|
|
||||||
|
Install required dependencies in this exact order:
|
||||||
|
|
||||||
|
1. **Install Rust toolchain:**
|
||||||
|
```bash
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
source ~/.cargo/env
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install Flutter SDK (stable channel):**
|
||||||
|
```bash
|
||||||
|
# Clone Flutter repository
|
||||||
|
cd /tmp
|
||||||
|
git clone https://github.com/flutter/flutter.git -b stable --depth 1
|
||||||
|
export PATH="/tmp/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
```
|
||||||
|
Note: If Flutter download fails due to network issues, the build can still proceed with existing generated code.
|
||||||
|
|
||||||
|
3. **Install essential Rust tools:**
|
||||||
|
```bash
|
||||||
|
cargo install cargo-expand
|
||||||
|
cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build Process - NEVER CANCEL LONG-RUNNING COMMANDS
|
||||||
|
|
||||||
|
Execute these commands in sequence. **NEVER CANCEL** - builds can take 45+ minutes:
|
||||||
|
|
||||||
|
1. **Install Flutter dependencies:** (2-3 minutes)
|
||||||
|
```bash
|
||||||
|
flutter pub get
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Generate Dart code:** (3-5 minutes)
|
||||||
|
```bash
|
||||||
|
dart run build_runner build --delete-conflicting-outputs
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Update Rust dependencies:** (10-15 minutes first time, 2-3 minutes subsequent)
|
||||||
|
```bash
|
||||||
|
cd rust && cargo update
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Generate Rust-Dart bridge code:** (5-8 minutes)
|
||||||
|
```bash
|
||||||
|
flutter_rust_bridge_codegen generate
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Generate localization files:** (1-2 minutes)
|
||||||
|
```bash
|
||||||
|
flutter pub global activate intl_utils
|
||||||
|
flutter pub global run intl_utils:generate
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **Build Rust components:** (60-90 seconds debug, 110-120 seconds release)
|
||||||
|
```bash
|
||||||
|
cd rust
|
||||||
|
cargo build --release # NEVER CANCEL: Takes ~2 minutes
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **Build Flutter application:** (15-25 minutes - NEVER CANCEL)
|
||||||
|
```bash
|
||||||
|
flutter build windows -v # Set timeout to 30+ minutes minimum
|
||||||
|
```
|
||||||
|
|
||||||
|
**CRITICAL BUILD TIMING:**
|
||||||
|
- Complete full build from scratch: **45-60 minutes** - NEVER CANCEL
|
||||||
|
- Rust release build: **2 minutes** - NEVER CANCEL
|
||||||
|
- Flutter application build: **15-25 minutes** - NEVER CANCEL
|
||||||
|
- Code generation steps: **10-15 minutes total** - NEVER CANCEL
|
||||||
|
|
||||||
|
### Platform-Specific Build Requirements
|
||||||
|
|
||||||
|
**Windows (Primary Platform):**
|
||||||
|
- MSBuild tools
|
||||||
|
- Visual Studio Build Tools or Visual Studio Community
|
||||||
|
- Windows SDK
|
||||||
|
- LLVM/Clang (version 18+ recommended)
|
||||||
|
|
||||||
|
**Linux (Development/Testing):**
|
||||||
|
- Basic build tools: `build-essential`, `cmake`, `ninja-build`
|
||||||
|
- GTK development libraries
|
||||||
|
- Limited functionality (desktop app designed primarily for Windows)
|
||||||
|
|
||||||
|
**macOS:**
|
||||||
|
- Xcode Command Line Tools
|
||||||
|
- CMake
|
||||||
|
|
||||||
|
### Testing and Validation
|
||||||
|
|
||||||
|
**Rust Component Testing:**
|
||||||
|
```bash
|
||||||
|
cd rust
|
||||||
|
cargo check # Fast syntax check (1-2 minutes)
|
||||||
|
cargo test # Run Rust unit tests (5-10 minutes - NEVER CANCEL)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Flutter Testing:**
|
||||||
|
```bash
|
||||||
|
flutter test # Run Flutter widget tests (2-5 minutes)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Linting and Code Quality:**
|
||||||
|
```bash
|
||||||
|
flutter analyze # Dart/Flutter linting (30-60 seconds)
|
||||||
|
cd rust && cargo clippy # Rust linting (2-3 minutes)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Validation Requirements
|
||||||
|
|
||||||
|
After building, always perform these validation steps:
|
||||||
|
|
||||||
|
1. **Verify application starts:**
|
||||||
|
```bash
|
||||||
|
# Windows
|
||||||
|
./build/windows/x64/runner/Release/starcitizen_doctor.exe
|
||||||
|
|
||||||
|
# Linux (limited functionality)
|
||||||
|
./build/linux/x64/release/bundle/starcitizen_doctor
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Test core functionality:**
|
||||||
|
- Application launches without crashes
|
||||||
|
- Main navigation works
|
||||||
|
- Settings panel accessible
|
||||||
|
- Localization switching functional
|
||||||
|
|
||||||
|
**Note:** Full UI testing requires Windows environment. Linux builds have limited functionality.
|
||||||
|
|
||||||
|
## Project Structure and Key Files
|
||||||
|
|
||||||
|
### Entry Points and Main Code
|
||||||
|
- **Main application:** `lib/main.dart` - Flutter app entry point with multi-window support
|
||||||
|
- **App configuration:** `lib/app.dart` - Application state, routing, theming, and localization
|
||||||
|
- **Rust bridge:** `lib/common/rust/` - Generated Rust-Dart interop code
|
||||||
|
- **UI modules:** `lib/ui/` - All user interface components organized by feature
|
||||||
|
|
||||||
|
### Build Configuration
|
||||||
|
- **Flutter config:** `pubspec.yaml` - Dependencies, assets, build settings
|
||||||
|
- **Rust config:** `rust/Cargo.toml` - Native dependencies and build settings
|
||||||
|
- **Rust bridge:** `flutter_rust_bridge.yaml` - Bridge code generation settings
|
||||||
|
- **Analysis:** `analysis_options.yaml` - Dart/Flutter linting rules
|
||||||
|
|
||||||
|
### Build System Files
|
||||||
|
- **Rust builder:** `rust_builder/` - Custom Rust compilation integration with cargokit
|
||||||
|
- **Platform builds:** `windows/`, `linux/`, `macos/` - Platform-specific build configurations
|
||||||
|
- **CI/CD:** `.github/workflows/windows_nightly.yml` - Automated build pipeline
|
||||||
|
|
||||||
|
### Generated Code (DO NOT EDIT)
|
||||||
|
- `lib/generated/` - Auto-generated localization files
|
||||||
|
- `lib/**/*.g.dart` - Generated JSON serialization code
|
||||||
|
- `lib/**/*.freezed.dart` - Generated immutable data classes
|
||||||
|
- `lib/common/rust/` - Generated Rust-Dart bridge code
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
|
||||||
|
### Making Changes
|
||||||
|
|
||||||
|
1. **For Dart/Flutter changes:**
|
||||||
|
```bash
|
||||||
|
# After UI or logic changes
|
||||||
|
dart run build_runner build --delete-conflicting-outputs
|
||||||
|
flutter analyze
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **For Rust changes:**
|
||||||
|
```bash
|
||||||
|
cd rust
|
||||||
|
cargo check # Quick validation
|
||||||
|
flutter_rust_bridge_codegen generate # Regenerate bridge if API changed
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **For localization changes:**
|
||||||
|
```bash
|
||||||
|
flutter pub global run intl_utils:generate
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pre-commit Validation
|
||||||
|
|
||||||
|
Always run before committing changes:
|
||||||
|
```bash
|
||||||
|
flutter analyze # Dart linting (required for CI)
|
||||||
|
cd rust && cargo clippy # Rust linting
|
||||||
|
flutter test # Widget tests
|
||||||
|
cd rust && cargo test # Rust tests
|
||||||
|
```
|
||||||
|
|
||||||
|
**CI Pipeline will fail if:**
|
||||||
|
- Flutter analyze reports errors
|
||||||
|
- Rust clippy reports errors
|
||||||
|
- Any tests fail
|
||||||
|
- Build process fails
|
||||||
|
|
||||||
|
## Common Issues and Solutions
|
||||||
|
|
||||||
|
### Flutter/Dart Issues
|
||||||
|
- **Build runner conflicts:** Delete generated files and rebuild with `--delete-conflicting-outputs`
|
||||||
|
- **Dependency conflicts:** Run `flutter pub deps` to check for version conflicts
|
||||||
|
- **Localization missing:** Ensure `flutter pub global run intl_utils:generate` completed successfully
|
||||||
|
|
||||||
|
### Rust Issues
|
||||||
|
- **Bridge generation fails:** Verify flutter_rust_bridge_codegen is installed and Rust code compiles
|
||||||
|
- **Link errors:** Ensure all required system libraries are installed for target platform
|
||||||
|
- **API changes:** Regenerate bridge code after modifying Rust API signatures
|
||||||
|
|
||||||
|
### Build Performance
|
||||||
|
- Use `cargo check` instead of `cargo build` for quick Rust validation
|
||||||
|
- Use `flutter analyze` instead of full build for quick Dart validation
|
||||||
|
- Clean build artifacts if experiencing issues: `flutter clean && cd rust && cargo clean`
|
||||||
|
|
||||||
|
## Application Architecture
|
||||||
|
|
||||||
|
**UI Framework:** Flutter with Fluent UI design system for Windows-native appearance
|
||||||
|
**State Management:** Riverpod with code generation for type-safe state management
|
||||||
|
**Routing:** GoRouter for navigation with nested routes
|
||||||
|
**Localization:** Flutter i18n with custom tooling for community translations
|
||||||
|
**Data Layer:** Hive for local storage, HTTP client for network requests
|
||||||
|
**Native Integration:** Rust via flutter_rust_bridge for system operations and performance-critical code
|
||||||
|
|
||||||
|
## Key Development Commands Reference
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Quick development validation (5-10 minutes total)
|
||||||
|
flutter analyze && cd rust && cargo check
|
||||||
|
|
||||||
|
# Full build validation (45-60 minutes - NEVER CANCEL)
|
||||||
|
flutter pub get && \
|
||||||
|
dart run build_runner build --delete-conflicting-outputs && \
|
||||||
|
cd rust && cargo update && cd .. && \
|
||||||
|
flutter_rust_bridge_codegen generate && \
|
||||||
|
flutter pub global run intl_utils:generate && \
|
||||||
|
flutter build windows -v
|
||||||
|
|
||||||
|
# Code generation only (5-10 minutes)
|
||||||
|
dart run build_runner build --delete-conflicting-outputs && \
|
||||||
|
flutter_rust_bridge_codegen generate && \
|
||||||
|
flutter pub global run intl_utils:generate
|
||||||
|
|
||||||
|
# Test execution (10-15 minutes total - NEVER CANCEL)
|
||||||
|
flutter test && cd rust && cargo test
|
||||||
|
```
|
||||||
|
|
||||||
|
**CRITICAL REMINDERS:**
|
||||||
|
- NEVER CANCEL builds or long-running commands - they can take 45+ minutes
|
||||||
|
- Always set command timeouts to 60+ minutes for build operations
|
||||||
|
- Always set command timeouts to 30+ minutes for test operations
|
||||||
|
- Validate changes with both quick checks and full builds before committing
|
||||||
|
- Use Windows environment for complete functionality testing
|
||||||
77
.github/workflows/linux_nightly.yml
vendored
Normal file
77
.github/workflows/linux_nightly.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: "Linux Nightly Build"
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *" # every day at midnight
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Linux dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
# libwebkit2gtk-4.1-dev is required for wry webview (4.0 is not available in Ubuntu 24.04+)
|
||||||
|
sudo apt-get install -y \
|
||||||
|
clang cmake ninja-build pkg-config nasm \
|
||||||
|
libgtk-3-dev liblzma-dev \
|
||||||
|
libsecret-1-dev libjsoncpp-dev \
|
||||||
|
libnotify-dev libayatana-appindicator3-dev \
|
||||||
|
libwebkit2gtk-4.1-dev
|
||||||
|
|
||||||
|
- name: Set up Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: 'stable'
|
||||||
|
cache: true
|
||||||
|
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
|
||||||
|
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
||||||
|
|
||||||
|
- run: flutter --version
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Rust Version
|
||||||
|
run: |
|
||||||
|
rustup --version
|
||||||
|
cargo --version
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
workspaces: "rust"
|
||||||
|
cache-all-crates: true
|
||||||
|
|
||||||
|
- name: Flutter pub get
|
||||||
|
run: flutter pub get
|
||||||
|
- name: Flutter build runner
|
||||||
|
run: dart run build_runner build --delete-conflicting-outputs
|
||||||
|
- name: Rust cargo update
|
||||||
|
run: cargo update
|
||||||
|
working-directory: rust
|
||||||
|
|
||||||
|
- name: Set up Flutter rust bridge
|
||||||
|
run: |
|
||||||
|
cargo install cargo-expand
|
||||||
|
cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0'
|
||||||
|
|
||||||
|
- name: Flutter Rust bridge generate
|
||||||
|
run: flutter_rust_bridge_codegen generate
|
||||||
|
- name: flutter gen l10n
|
||||||
|
run: |
|
||||||
|
flutter pub global activate intl_utils
|
||||||
|
flutter pub global run intl_utils:generate
|
||||||
|
- name: Flutter build Linux
|
||||||
|
run: flutter build linux -v
|
||||||
|
|
||||||
|
- name: Archive build
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: linux
|
||||||
|
path: build/linux/x64/release/bundle
|
||||||
4
.github/workflows/windows_nightly.yml
vendored
4
.github/workflows/windows_nightly.yml
vendored
@ -40,7 +40,8 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v2
|
uses: KyleMayes/install-llvm-action@v2
|
||||||
with:
|
with:
|
||||||
version: "18"
|
version: "18"
|
||||||
|
- name: Set up NASM
|
||||||
|
uses: ilammy/setup-nasm@v1
|
||||||
- name: Flutter pub get
|
- name: Flutter pub get
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Flutter build runner
|
- name: Flutter build runner
|
||||||
@ -68,4 +69,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: windows
|
name: windows
|
||||||
path: build/windows/x64/runner/Release
|
path: build/windows/x64/runner/Release
|
||||||
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,9 +5,11 @@
|
|||||||
*.swp
|
*.swp
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.atom/
|
.atom/
|
||||||
|
.build/
|
||||||
.buildlog/
|
.buildlog/
|
||||||
.history
|
.history
|
||||||
.svn/
|
.svn/
|
||||||
|
.swiftpm/
|
||||||
migrate_working_dir/
|
migrate_working_dir/
|
||||||
|
|
||||||
# IntelliJ related
|
# IntelliJ related
|
||||||
|
|||||||
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"dart.flutterSdkPath": ".fvm/versions/stable",
|
||||||
|
"cmake.ignoreCMakeListsMissing": true
|
||||||
|
}
|
||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
该工具为 星际公民玩家 提供 一键诊断,官网及工具网站汉化,游戏汉化,游戏性能优化 等功能,致力于带来更愉快的游戏体验。
|
该工具为 星际公民玩家 提供 一键诊断,官网及工具网站汉化,游戏汉化,游戏性能优化 等功能,致力于带来更愉快的游戏体验。
|
||||||
|
|
||||||
[](https://github.com/StarCitizenToolBox/app/actions/workflows/windows_nightly.yml) [](http://translate.42kit.com/engage/sctoolbox/)
|
[](https://github.com/StarCitizenToolBox/app/actions/workflows/windows_nightly.yml) [](https://github.com/StarCitizenToolBox/app/actions/workflows/windows_nightly.yml) [](http://translate.42kit.com/engage/sctoolbox/)
|
||||||
|
|
||||||
[](https://apps.microsoft.com/detail/9NF3SWFWNKL1?launch=true)
|
[](https://apps.microsoft.com/detail/9NF3SWFWNKL1?launch=true)
|
||||||
|
|
||||||
|
|||||||
@ -9,11 +9,14 @@ This tool provides Star Citizen players with one-click diagnosis, official websi
|
|||||||
|
|
||||||
### ✨ Feature
|
### ✨ Feature
|
||||||
- Localization management: install the localization of the community and switch languages with one click
|
- Localization management: install the localization of the community and switch languages with one click
|
||||||
|
- Advanced localization: You can choose to translate only parts of the game content, or display it in both languages.
|
||||||
|
- Vehicle sorting: Utilizing game mechanics, vehicles are assigned numerical prefixes to help you quickly find your favorite spaceship.
|
||||||
- One-click diagnosis: log files from hundreds of guinea pig users, which can handle common problems of Star Citizen
|
- One-click diagnosis: log files from hundreds of guinea pig users, which can handle common problems of Star Citizen
|
||||||
- Website Chineseization: Provide manual translation for the Star Citizen official website and Star Citizen tool website (thanks to the Star Citizen Chinese Encyclopedia project), and also provide [Browser Extension (Github)] (https://github.com/xkeyC/StarCitizenBoxBrowserEx).
|
- Website Localization: Provide manual translation for the Star Citizen official website and Star Citizen tool website (thanks to the Star Citizen Chinese Encyclopedia project), and also provide [Browser Extension (Github)] (https://github.com/xkeyC/StarCitizenBoxBrowserEx).
|
||||||
- Performance optimization: Add more detailed performance parameter control to the Star Citizen game, which can be used to optimize performance and obtain better image quality.
|
- Performance optimization: Add more detailed performance parameter control to the Star Citizen game, which can be used to optimize performance and obtain better image quality.
|
||||||
- Server status indicator: The server status indicator function is added a few hours earlier than the official website launcher, and the indication is more detailed.
|
- Server status indicator: The server status indicator function is added a few hours earlier than the official website launcher, and the indication is more detailed.
|
||||||
- Other commonly used tools: a toolbox including p4k offload downloads, cleaning shaders, reinstalling EAC and other functions.
|
- Other commonly used tools: a toolbox including p4k offload downloads, cleaning shaders, reinstalling EAC and other functions.
|
||||||
|
- unp4k_rs: Uses our own powerful engine to quickly unpack games and perform data mining.
|
||||||
|
|
||||||
### 📸 Screenshot
|
### 📸 Screenshot
|
||||||

|

|
||||||
@ -28,4 +31,4 @@ This tool provides Star Citizen players with one-click diagnosis, official websi
|
|||||||
|
|
||||||
### ❤️ Thanks
|
### ❤️ Thanks
|
||||||
|
|
||||||
Special thanks to [Visual Studio Code](https://code.visualstudio.com/) for providing free development tools.
|
Special thanks to [Visual Studio Code](https://code.visualstudio.com/) for providing free development tools.
|
||||||
|
|||||||
@ -32,6 +32,8 @@ analyzer:
|
|||||||
exclude:
|
exclude:
|
||||||
- "**/*.g.dart"
|
- "**/*.g.dart"
|
||||||
- "**/*.freezed.dart"
|
- "**/*.freezed.dart"
|
||||||
|
- "**/generated/*.dart"
|
||||||
|
- "**/generated/**/*.dart"
|
||||||
errors:
|
errors:
|
||||||
invalid_annotation_target: ignore
|
invalid_annotation_target: ignore
|
||||||
# Additional information about this file can be found at
|
# Additional information about this file can be found at
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
assets/ic_hk_fps.png
Normal file
BIN
assets/ic_hk_fps.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
@ -10,7 +10,7 @@
|
|||||||
font-family: 'Material Icons';
|
font-family: 'Material Icons';
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-size: 24px;
|
font-size: 1.5rem; /* 24px */
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
letter-spacing: normal;
|
letter-spacing: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
|
|||||||
@ -207,7 +207,7 @@ function ReportUnTranslate(k, v) {
|
|||||||
const jsRegex = /(?:^|[^<])<script[^>]*>[\s\S]*?<\/script>(?:[^>]|$)/i;
|
const jsRegex = /(?:^|[^<])<script[^>]*>[\s\S]*?<\/script>(?:[^>]|$)/i;
|
||||||
if (k.trim() !== "" && !cnPattern.test(k) && !htmlPattern.test(k) && !cssRegex.test(k) && !jsRegex.test(k)
|
if (k.trim() !== "" && !cnPattern.test(k) && !htmlPattern.test(k) && !cssRegex.test(k) && !jsRegex.test(k)
|
||||||
&& enPattern.test(k) && !k.startsWith("http://") && !k.startsWith("https://")) {
|
&& enPattern.test(k) && !k.startsWith("http://") && !k.startsWith("https://")) {
|
||||||
window.chrome.webview.postMessage({ action: 'webview_localization_capture', key: k, value: v });
|
window.ipc.postMessage(JSON.stringify({ action: 'webview_localization_capture', key: k, value: v }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -217,85 +217,149 @@ InitWebLocalization();
|
|||||||
|
|
||||||
/// ----- Login Script ----
|
/// ----- Login Script ----
|
||||||
async function getRSILauncherToken(channelId) {
|
async function getRSILauncherToken(channelId) {
|
||||||
if (!window.location.href.includes("robertsspaceindustries.com")) return;
|
console.log('[SCToolbox] getRSILauncherToken called with channel:', channelId);
|
||||||
|
|
||||||
let loginBodyElement = $(".c-form.c-signIn");
|
try {
|
||||||
loginBodyElement.show();
|
if (!window.location.href.includes("robertsspaceindustries.com")) {
|
||||||
// wait login
|
console.log('[SCToolbox] Not on RSI site, skipping');
|
||||||
window.chrome.webview.postMessage({ action: 'webview_rsi_login_show_window' });
|
return;
|
||||||
|
|
||||||
// get claims
|
|
||||||
let claimsR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/claims", {
|
|
||||||
method: 'POST', headers: {
|
|
||||||
'x-rsi-token': $.cookie('Rsi-Token'),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (claimsR.status !== 200) return;
|
|
||||||
|
|
||||||
loginBodyElement.hide();
|
|
||||||
SCTShowToast("登录游戏中...");
|
|
||||||
|
|
||||||
let claimsData = (await claimsR.json())["data"];
|
|
||||||
|
|
||||||
let tokenFormData = new FormData();
|
|
||||||
tokenFormData.append('claims', claimsData);
|
|
||||||
tokenFormData.append('gameId', 'SC');
|
|
||||||
let tokenR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/token", {
|
|
||||||
method: 'POST', headers: {
|
|
||||||
'x-rsi-token': $.cookie('Rsi-Token'),
|
|
||||||
},
|
|
||||||
body: tokenFormData
|
|
||||||
});
|
|
||||||
|
|
||||||
if (tokenR.status !== 200) return;
|
|
||||||
let TokenData = (await tokenR.json())["data"]["token"];
|
|
||||||
console.log(TokenData);
|
|
||||||
|
|
||||||
// get release Data
|
|
||||||
let releaseFormData = new FormData();
|
|
||||||
releaseFormData.append("channelId", channelId);
|
|
||||||
releaseFormData.append("claims", claimsData);
|
|
||||||
releaseFormData.append("gameId", "SC");
|
|
||||||
releaseFormData.append("platformId", "prod");
|
|
||||||
let releaseR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/release", {
|
|
||||||
method: 'POST', headers: {
|
|
||||||
'x-rsi-token': $.cookie('Rsi-Token'),
|
|
||||||
},
|
|
||||||
body: releaseFormData
|
|
||||||
});
|
|
||||||
if (releaseR.status !== 200) return;
|
|
||||||
let releaseDataJson = (await releaseR.json())['data'];
|
|
||||||
console.log(releaseDataJson);
|
|
||||||
// get game library
|
|
||||||
let libraryR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/library", {
|
|
||||||
method: 'POST', headers: {
|
|
||||||
'x-rsi-token': $.cookie('Rsi-Token'),
|
|
||||||
},
|
|
||||||
body: releaseFormData
|
|
||||||
});
|
|
||||||
|
|
||||||
let libraryData = (await libraryR.json())["data"]
|
|
||||||
|
|
||||||
// get user avatar
|
|
||||||
let avatarUrl = $(".orion-c-avatar__image").attr("src");
|
|
||||||
|
|
||||||
//post message
|
|
||||||
window.chrome.webview.postMessage({
|
|
||||||
action: 'webview_rsi_login_success', data: {
|
|
||||||
'webToken': $.cookie('Rsi-Token'),
|
|
||||||
'claims': claimsData,
|
|
||||||
'authToken': TokenData,
|
|
||||||
'releaseInfo': releaseDataJson,
|
|
||||||
"avatar": avatarUrl,
|
|
||||||
'libraryData': libraryData,
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
// check if logged in and fix redirect
|
||||||
|
if (window.location.href.endsWith('/connect?jumpto=/account/dashboard')) {
|
||||||
|
if (document.body.textContent.trim() === "/account/dashboard") {
|
||||||
|
window.location.href = "https://robertsspaceindustries.com/account/dashboard";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for jQuery to be ready
|
||||||
|
let waitCount = 0;
|
||||||
|
while (typeof $ === 'undefined' && waitCount < 50) {
|
||||||
|
console.log('[SCToolbox] Waiting for jQuery... attempt', waitCount);
|
||||||
|
await new Promise(r => setTimeout(r, 100));
|
||||||
|
waitCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof $ === 'undefined') {
|
||||||
|
console.error('[SCToolbox] jQuery not available after waiting');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get RSI token from cookie (don't rely on $.cookie plugin)
|
||||||
|
function getCookie(name) {
|
||||||
|
const value = `; ${document.cookie}`;
|
||||||
|
const parts = value.split(`; ${name}=`);
|
||||||
|
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const rsiToken = getCookie('Rsi-Token');
|
||||||
|
console.log('[SCToolbox] RSI Token available:', !!rsiToken);
|
||||||
|
|
||||||
|
if (!rsiToken) {
|
||||||
|
console.log('[SCToolbox] No RSI token, showing login window');
|
||||||
|
let loginBodyElement = $(".c-form authenticationForm sign_in");
|
||||||
|
loginBodyElement.show();
|
||||||
|
window.ipc.postMessage(JSON.stringify({ action: 'webview_rsi_login_show_window' }));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get claims
|
||||||
|
console.log('[SCToolbox] Fetching claims...');
|
||||||
|
let claimsR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/claims", {
|
||||||
|
method: 'POST', headers: {
|
||||||
|
'x-rsi-token': rsiToken,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('[SCToolbox] Claims response status:', claimsR.status);
|
||||||
|
if (claimsR.status !== 200) {
|
||||||
|
console.error('[SCToolbox] Claims request failed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCTShowToast("登录游戏中...");
|
||||||
|
|
||||||
|
let claimsData = (await claimsR.json())["data"];
|
||||||
|
console.log('[SCToolbox] Claims data received');
|
||||||
|
|
||||||
|
let tokenFormData = new FormData();
|
||||||
|
tokenFormData.append('claims', claimsData);
|
||||||
|
tokenFormData.append('gameId', 'SC');
|
||||||
|
let tokenR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/token", {
|
||||||
|
method: 'POST', headers: {
|
||||||
|
'x-rsi-token': rsiToken,
|
||||||
|
},
|
||||||
|
body: tokenFormData
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('[SCToolbox] Token response status:', tokenR.status);
|
||||||
|
if (tokenR.status !== 200) {
|
||||||
|
console.error('[SCToolbox] Token request failed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let TokenData = (await tokenR.json())["data"]["token"];
|
||||||
|
console.log('[SCToolbox] Token received');
|
||||||
|
|
||||||
|
// get release Data
|
||||||
|
let releaseFormData = new FormData();
|
||||||
|
releaseFormData.append("channelId", channelId);
|
||||||
|
releaseFormData.append("claims", claimsData);
|
||||||
|
releaseFormData.append("gameId", "SC");
|
||||||
|
releaseFormData.append("platformId", "prod");
|
||||||
|
let releaseR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/release", {
|
||||||
|
method: 'POST', headers: {
|
||||||
|
'x-rsi-token': rsiToken,
|
||||||
|
},
|
||||||
|
body: releaseFormData
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('[SCToolbox] Release response status:', releaseR.status);
|
||||||
|
if (releaseR.status !== 200) {
|
||||||
|
console.error('[SCToolbox] Release request failed');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let releaseDataJson = (await releaseR.json())['data'];
|
||||||
|
console.log('[SCToolbox] Release data received');
|
||||||
|
|
||||||
|
// get game library
|
||||||
|
let libraryR = await fetch("https://robertsspaceindustries.com/api/launcher/v3/games/library", {
|
||||||
|
method: 'POST', headers: {
|
||||||
|
'x-rsi-token': rsiToken,
|
||||||
|
},
|
||||||
|
body: releaseFormData
|
||||||
|
});
|
||||||
|
|
||||||
|
let libraryData = (await libraryR.json())["data"];
|
||||||
|
console.log('[SCToolbox] Library data received');
|
||||||
|
|
||||||
|
// get user avatar
|
||||||
|
let avatarUrl = $(".orion-c-avatar__image").attr("src") || '';
|
||||||
|
console.log('[SCToolbox] Avatar URL:', avatarUrl);
|
||||||
|
|
||||||
|
//post message
|
||||||
|
console.log('[SCToolbox] Sending login success message...');
|
||||||
|
window.ipc.postMessage(JSON.stringify({
|
||||||
|
action: 'webview_rsi_login_success', data: {
|
||||||
|
'webToken': rsiToken,
|
||||||
|
'claims': claimsData,
|
||||||
|
'authToken': TokenData,
|
||||||
|
'releaseInfo': releaseDataJson,
|
||||||
|
"avatar": avatarUrl,
|
||||||
|
'libraryData': libraryData,
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
console.log('[SCToolbox] Login success message sent');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[SCToolbox] Error in getRSILauncherToken:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function SCTShowToast(message) {
|
function SCTShowToast(message) {
|
||||||
let m = document.createElement('div');
|
let m = document.createElement('div');
|
||||||
m.innerHTML = message;
|
m.innerHTML = message;
|
||||||
m.style.cssText = "font-family:siyuan;max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;";
|
m.style.cssText = "font-family:siyuan;max-width:60%;min-width: 9.375rem;padding:0 0.875rem;height: 2.5rem;color: rgb(255, 255, 255);line-height: 2.5rem;text-align: center;border-radius: 0.25rem;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 1rem;";
|
||||||
document.body.appendChild(m);
|
document.body.appendChild(m);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
let d = 0.5;
|
let d = 0.5;
|
||||||
|
|||||||
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
|
extensions:
|
||||||
123
docs/AUTH_QUICK_START.md
Normal file
123
docs/AUTH_QUICK_START.md
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
# SCToolBox OAuth 认证系统
|
||||||
|
|
||||||
|
## 快速开始
|
||||||
|
|
||||||
|
### 授权流程
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────┐ ┌──────────┐ ┌────────────┐ ┌──────────┐
|
||||||
|
│ Web App │──1──▶│ Browser │──2──▶│ SCToolBox │──3──▶│ Server │
|
||||||
|
└─────────┘ └──────────┘ └────────────┘ └──────────┘
|
||||||
|
▲ │ │
|
||||||
|
│ ├──4──▶ 验证域名 │
|
||||||
|
│ │ 安全性 │
|
||||||
|
│ │ │
|
||||||
|
│ ├──5──▶ 生成 JWT │
|
||||||
|
│ │ 令牌 │
|
||||||
|
│ │ │
|
||||||
|
└─────────────────6─────────────────┘ │
|
||||||
|
返回令牌 │
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### URL Scheme 格式
|
||||||
|
```
|
||||||
|
sctoolbox://auth/{domain}?callbackUrl={回调地址}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 示例
|
||||||
|
```
|
||||||
|
sctoolbox://auth/example.com?callbackUrl=https%3A%2F%2Fexample.com%2Fauth%2Fcallback
|
||||||
|
```
|
||||||
|
|
||||||
|
### 回调格式
|
||||||
|
```
|
||||||
|
{callbackUrl}#access_token={jwt_token}&token_type=Bearer
|
||||||
|
```
|
||||||
|
|
||||||
|
## 功能特性
|
||||||
|
|
||||||
|
- ✅ 基于 JWT 的安全认证
|
||||||
|
- ✅ 域名白名单验证
|
||||||
|
- ✅ 跨平台支持(Windows、macOS、Linux)
|
||||||
|
- ✅ 两种授权方式(直接跳转 / 复制链接)
|
||||||
|
- ✅ 符合 OAuth 2.0 Implicit Flow 标准
|
||||||
|
|
||||||
|
## 实现文件
|
||||||
|
|
||||||
|
### 核心文件
|
||||||
|
- `lib/ui/auth/auth_page.dart` - 授权页面 UI
|
||||||
|
- `lib/ui/auth/auth_ui_model.dart` - 授权页面状态管理
|
||||||
|
- `lib/common/utils/url_scheme_handler.dart` - URL Scheme 处理器
|
||||||
|
|
||||||
|
### 平台配置
|
||||||
|
- `macos/Runner/Info.plist` - macOS URL Scheme 配置
|
||||||
|
- `windows/runner/main.cpp` - Windows Deep Link 处理
|
||||||
|
- `linux/my_application.cc` - Linux Deep Link 处理
|
||||||
|
- `linux/sctoolbox.desktop` - Linux MIME 类型注册
|
||||||
|
- `pubspec.yaml` - MSIX 协议激活配置
|
||||||
|
|
||||||
|
## 使用方法
|
||||||
|
|
||||||
|
### 初始化
|
||||||
|
URL Scheme handler 在 `IndexUI` 中自动初始化:
|
||||||
|
|
||||||
|
```dart
|
||||||
|
useEffect(() {
|
||||||
|
UrlSchemeHandler().initialize(context);
|
||||||
|
return () => UrlSchemeHandler().dispose();
|
||||||
|
}, const []);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Web 应用集成
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// 发起授权
|
||||||
|
const authUrl = `sctoolbox://auth/example.com?callbackUrl=${encodeURIComponent(callbackUrl)}`;
|
||||||
|
window.location.href = authUrl;
|
||||||
|
|
||||||
|
// 处理回调
|
||||||
|
const params = new URLSearchParams(window.location.hash.substring(1));
|
||||||
|
const token = params.get('access_token');
|
||||||
|
```
|
||||||
|
|
||||||
|
## 平台要求
|
||||||
|
|
||||||
|
- **Windows**: 需要使用 MSIX 打包版本
|
||||||
|
- **macOS**: 需要配置 Info.plist
|
||||||
|
- **Linux**: 需要注册 .desktop 文件
|
||||||
|
|
||||||
|
## 安全性
|
||||||
|
|
||||||
|
- ✅ JWT 签名验证
|
||||||
|
- ✅ 域名白名单检查
|
||||||
|
- ✅ 令牌过期时间控制
|
||||||
|
- ✅ 使用 Fragment (#) 传递令牌(更安全)
|
||||||
|
|
||||||
|
## 详细文档
|
||||||
|
|
||||||
|
查看 [完整文档](./AUTH_SYSTEM.md) 了解更多信息,包括:
|
||||||
|
- 详细的授权流程
|
||||||
|
- API 接口说明
|
||||||
|
- Web 应用集成示例
|
||||||
|
- 安全最佳实践
|
||||||
|
- 常见问题解答
|
||||||
|
|
||||||
|
## API 端点
|
||||||
|
|
||||||
|
认证服务提供以下 gRPC 接口:
|
||||||
|
|
||||||
|
- `GenerateToken` - 生成 JWT 令牌
|
||||||
|
- `ValidateToken` - 验证令牌有效性
|
||||||
|
- `GetPublicKey` - 获取公钥用于验证
|
||||||
|
- `GetJWTDomainList` - 获取可信域名列表
|
||||||
|
|
||||||
|
## 测试
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# macOS/Linux
|
||||||
|
open "sctoolbox://auth/test.example.com?callbackUrl=https%3A%2F%2Ftest.example.com%2Fcallback"
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
start "sctoolbox://auth/test.example.com?callbackUrl=https%3A%2F%2Ftest.example.com%2Fcallback"
|
||||||
|
```
|
||||||
@ -1,4 +1,5 @@
|
|||||||
rust_input: rust/src/api/**/*.rs
|
rust_input: rust/src/api/**/*.rs
|
||||||
dart_output: lib/common/rust/
|
dart_output: lib/common/rust/
|
||||||
full_dep: true
|
full_dep: true
|
||||||
web: false
|
web: false
|
||||||
|
enable_lifetime: true
|
||||||
@ -6,7 +6,7 @@ import 'package:starcitizen_doctor/common/io/rs_http.dart';
|
|||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
|
||||||
class AnalyticsApi {
|
class AnalyticsApi {
|
||||||
static touch(String key) async {
|
static Future<void> touch(String key) async {
|
||||||
if (kDebugMode || kProfileMode) {
|
if (kDebugMode || kProfileMode) {
|
||||||
dPrint("AnalyticsApi.touch === $key skip");
|
dPrint("AnalyticsApi.touch === $key skip");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -12,17 +12,14 @@ import 'package:starcitizen_doctor/data/sc_localization_data.dart';
|
|||||||
|
|
||||||
class Api {
|
class Api {
|
||||||
static Future<AppVersionData> getAppVersion() async {
|
static Future<AppVersionData> getAppVersion() async {
|
||||||
return AppVersionData.fromJson(
|
return AppVersionData.fromJson(await getRepoJson("sc_doctor", "version.json"));
|
||||||
await getRepoJson("sc_doctor", "version.json"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<AppPlacardData> getAppPlacard() async {
|
static Future<AppPlacardData> getAppPlacard() async {
|
||||||
return AppPlacardData.fromJson(
|
return AppPlacardData.fromJson(await getRepoJson("sc_doctor", "placard.json"));
|
||||||
await getRepoJson("sc_doctor", "placard.json"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<CountdownFestivalItemData>>
|
static Future<List<CountdownFestivalItemData>> getFestivalCountdownList() async {
|
||||||
getFestivalCountdownList() async {
|
|
||||||
List<CountdownFestivalItemData> l = [];
|
List<CountdownFestivalItemData> l = [];
|
||||||
final r = json.decode(await getRepoData("sc_doctor", "countdown.json"));
|
final r = json.decode(await getRepoData("sc_doctor", "countdown.json"));
|
||||||
if (r is List) {
|
if (r is List) {
|
||||||
@ -30,19 +27,15 @@ class Api {
|
|||||||
l.add(CountdownFestivalItemData.fromJson(element));
|
l.add(CountdownFestivalItemData.fromJson(element));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
l.sort((a, b) => (a.time ?? 0) - (b.time ?? 0));
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> getAppReleaseDataByVersionName(
|
static Future<Map<String, dynamic>> getAppReleaseDataByVersionName(String version) async {
|
||||||
String version) async {
|
final r = await RSHttp.getText("${URLConf.gitlabApiPath}repos/SCToolBox/Release/releases/tags/$version");
|
||||||
final r = await RSHttp.getText(
|
|
||||||
"${URLConf.gitlabApiPath}repos/SCToolBox/Release/releases/tags/$version");
|
|
||||||
return json.decode(r);
|
return json.decode(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<ScLocalizationData>> getScLocalizationData(
|
static Future<List<ScLocalizationData>> getScLocalizationData(String lang) async {
|
||||||
String lang) async {
|
|
||||||
final data = json.decode(await getRepoData("localizations", "$lang.json"));
|
final data = json.decode(await getRepoData("localizations", "$lang.json"));
|
||||||
List<ScLocalizationData> l = [];
|
List<ScLocalizationData> l = [];
|
||||||
if (data is List) {
|
if (data is List) {
|
||||||
@ -80,45 +73,24 @@ class Api {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<List> getScServerStatus() async {
|
static Future<List> getScServerStatus() async {
|
||||||
final r = await RSHttp.getText(
|
final r = await RSHttp.getText("https://status.robertsspaceindustries.com/index.json");
|
||||||
"https://status.robertsspaceindustries.com/index.json");
|
|
||||||
final map = json.decode(r);
|
final map = json.decode(r);
|
||||||
return map["systems"];
|
return map["systems"];
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> getRepoJson(
|
static Future<Map<String, dynamic>> getRepoJson(String dir, String name) async {
|
||||||
String dir, String name) async {
|
|
||||||
final data = await getRepoData(dir, name);
|
final data = await getRepoData(dir, name);
|
||||||
return json.decode(data);
|
return json.decode(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getRepoData(String dir, String name) async {
|
static Future<String> getRepoData(String dir, String name) async {
|
||||||
final r = await RSHttp.getText("${URLConf.apiRepoPath}/$dir/$name",
|
final r = await RSHttp.getText("${URLConf.apiRepoPath}/$dir/$name", withCustomDns: await isUseInternalDNS());
|
||||||
withCustomDns: await isUseInternalDNS());
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> doGoogleTranslate(String input) async {
|
|
||||||
final out = await RSHttp.getText(
|
|
||||||
"${URLConf.googleTranslateApiUrl}/translate_a/single?client=gtx&dt=t&sl=auto&tl=en&q=${Uri.encodeComponent(input)}");
|
|
||||||
// [[["Hello","你好",null,null,10]],null,"zh-CN",null,null,null,1,[],[["zh-CN"],null,[1],["zh-CN"]]]
|
|
||||||
final list = json.decode(out);
|
|
||||||
if (list is List && list.isNotEmpty) {
|
|
||||||
final data = list.first;
|
|
||||||
if (data is List && data.isNotEmpty) {
|
|
||||||
final text = data.first;
|
|
||||||
if (text is List && text.isNotEmpty) {
|
|
||||||
return text.first;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<bool> isUseInternalDNS() async {
|
static Future<bool> isUseInternalDNS() async {
|
||||||
final userBox = await Hive.openBox("app_conf");
|
final userBox = await Hive.openBox("app_conf");
|
||||||
final isUseInternalDNS =
|
final isUseInternalDNS = userBox.get("isUseInternalDNS", defaultValue: false);
|
||||||
userBox.get("isUseInternalDNS", defaultValue: false);
|
|
||||||
return isUseInternalDNS;
|
return isUseInternalDNS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
lib/api/news_api.dart
Normal file
23
lib/api/news_api.dart
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import '../common/conf/url_conf.dart';
|
||||||
|
import '../common/io/rs_http.dart';
|
||||||
|
import '../common/utils/log.dart';
|
||||||
|
import '../data/citizen_news_data.dart';
|
||||||
|
import 'api.dart';
|
||||||
|
|
||||||
|
class NewsApi {
|
||||||
|
static Future<CitizenNewsData?> getLatest() async {
|
||||||
|
try {
|
||||||
|
final data = await RSHttp.getText(
|
||||||
|
"${URLConf.newsApiHome}/api/latest",
|
||||||
|
withCustomDns: await Api.isUseInternalDNS(),
|
||||||
|
);
|
||||||
|
final map = json.decode(data);
|
||||||
|
return CitizenNewsData.fromJson(map);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("getLatestNews error: $e");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:dart_rss/dart_rss.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/io/rs_http.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
|
||||||
|
|
||||||
class RSSApi {
|
|
||||||
static Future<List<RssItem>> getRssVideo() async {
|
|
||||||
final r = await RSHttp.getText(URLConf.rssVideoUrl);
|
|
||||||
final f = RssFeed.parse(r);
|
|
||||||
return f.items.sublist(0, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<List<RssItem>> getRssText() async {
|
|
||||||
final r2 = await RSHttp.getText(URLConf.rssTextUrl2);
|
|
||||||
final r2f = RssFeed.parse(r2);
|
|
||||||
final items = r2f.items;
|
|
||||||
items.sort((a, b) {
|
|
||||||
final aDate = HttpDate.parse(a.pubDate ?? "").millisecondsSinceEpoch;
|
|
||||||
final bDate = HttpDate.parse(b.pubDate ?? "").millisecondsSinceEpoch;
|
|
||||||
return bDate - aDate;
|
|
||||||
});
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
148
lib/app.dart
148
lib/app.dart
@ -2,8 +2,8 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
@ -23,9 +23,9 @@ import 'package:window_manager/window_manager.dart';
|
|||||||
import 'api/analytics.dart';
|
import 'api/analytics.dart';
|
||||||
import 'api/api.dart';
|
import 'api/api.dart';
|
||||||
import 'common/conf/url_conf.dart';
|
import 'common/conf/url_conf.dart';
|
||||||
import 'common/helper/system_helper.dart';
|
|
||||||
import 'common/io/rs_http.dart';
|
import 'common/io/rs_http.dart';
|
||||||
import 'common/rust/frb_generated.dart';
|
import 'common/rust/frb_generated.dart';
|
||||||
|
import 'common/rust/api/applinks_api.dart' as applinks;
|
||||||
import 'common/rust/api/win32_api.dart' as win32;
|
import 'common/rust/api/win32_api.dart' as win32;
|
||||||
import 'data/app_version_data.dart';
|
import 'data/app_version_data.dart';
|
||||||
import 'generated/no_l10n_strings.dart';
|
import 'generated/no_l10n_strings.dart';
|
||||||
@ -34,6 +34,7 @@ import 'ui/home/game_doctor/game_doctor_ui.dart';
|
|||||||
import 'ui/home/localization/advanced_localization_ui.dart';
|
import 'ui/home/localization/advanced_localization_ui.dart';
|
||||||
import 'ui/index_ui.dart';
|
import 'ui/index_ui.dart';
|
||||||
import 'ui/settings/upgrade_dialog.dart';
|
import 'ui/settings/upgrade_dialog.dart';
|
||||||
|
import 'ui/tools/unp4kc/dcb_viewer_ui.dart';
|
||||||
import 'ui/tools/unp4kc/unp4kc_ui.dart';
|
import 'ui/tools/unp4kc/unp4kc_ui.dart';
|
||||||
|
|
||||||
part 'app.g.dart';
|
part 'app.g.dart';
|
||||||
@ -41,7 +42,7 @@ part 'app.g.dart';
|
|||||||
part 'app.freezed.dart';
|
part 'app.freezed.dart';
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class AppGlobalState with _$AppGlobalState {
|
abstract class AppGlobalState with _$AppGlobalState {
|
||||||
const factory AppGlobalState({
|
const factory AppGlobalState({
|
||||||
String? deviceUUID,
|
String? deviceUUID,
|
||||||
String? applicationSupportDir,
|
String? applicationSupportDir,
|
||||||
@ -50,6 +51,7 @@ class AppGlobalState with _$AppGlobalState {
|
|||||||
@Default(ThemeConf()) ThemeConf themeConf,
|
@Default(ThemeConf()) ThemeConf themeConf,
|
||||||
Locale? appLocale,
|
Locale? appLocale,
|
||||||
Box? appConfBox,
|
Box? appConfBox,
|
||||||
|
@Default(10) windowsVersion,
|
||||||
}) = _AppGlobalState;
|
}) = _AppGlobalState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,17 +59,15 @@ class AppGlobalState with _$AppGlobalState {
|
|||||||
GoRouter router(Ref ref) {
|
GoRouter router(Ref ref) {
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(path: '/', pageBuilder: (context, state) => myPageBuilder(context, state, const SplashUI())),
|
||||||
path: '/',
|
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const SplashUI()),
|
|
||||||
),
|
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/index',
|
path: '/index',
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const IndexUI()),
|
pageBuilder: (context, state) => myPageBuilder(context, state, const IndexUI()),
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: "downloader",
|
path: "downloader",
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const HomeDownloaderUI())),
|
pageBuilder: (context, state) => myPageBuilder(context, state, const HomeDownloaderUI()),
|
||||||
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: 'game_doctor',
|
path: 'game_doctor',
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const HomeGameDoctorUI()),
|
pageBuilder: (context, state) => myPageBuilder(context, state, const HomeGameDoctorUI()),
|
||||||
@ -77,17 +77,24 @@ GoRouter router(Ref ref) {
|
|||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const HomePerformanceUI()),
|
pageBuilder: (context, state) => myPageBuilder(context, state, const HomePerformanceUI()),
|
||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: 'advanced_localization',
|
path: 'advanced_localization',
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const AdvancedLocalizationUI()))
|
pageBuilder: (context, state) => myPageBuilder(context, state, const AdvancedLocalizationUI()),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
GoRoute(path: '/tools', builder: (_, __) => const SizedBox(), routes: [
|
GoRoute(
|
||||||
GoRoute(
|
path: '/tools',
|
||||||
path: 'unp4kc',
|
builder: (_, _) => const SizedBox(),
|
||||||
pageBuilder: (context, state) => myPageBuilder(context, state, const UnP4kcUI()),
|
routes: [
|
||||||
),
|
GoRoute(path: 'unp4kc', pageBuilder: (context, state) => myPageBuilder(context, state, const UnP4kcUI())),
|
||||||
]),
|
GoRoute(
|
||||||
GoRoute(path: '/guide', pageBuilder: (context, state) => myPageBuilder(context, state, const GuideUI()))
|
path: 'dcb_viewer',
|
||||||
|
pageBuilder: (context, state) =>
|
||||||
|
myPageBuilder(context, state, DcbViewerUI(initialFilePath: (state.extra as Map?)?['path'])),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
GoRoute(path: '/guide', pageBuilder: (context, state) => myPageBuilder(context, state, const GuideUI())),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -95,13 +102,13 @@ GoRouter router(Ref ref) {
|
|||||||
@riverpod
|
@riverpod
|
||||||
class AppGlobalModel extends _$AppGlobalModel {
|
class AppGlobalModel extends _$AppGlobalModel {
|
||||||
static Map<Locale, String> get appLocaleSupport => {
|
static Map<Locale, String> get appLocaleSupport => {
|
||||||
const Locale("auto"): S.current.settings_app_language_auto,
|
const Locale("auto"): S.current.settings_app_language_auto,
|
||||||
const Locale("zh", "CN"): NoL10n.langZHS,
|
const Locale("zh", "CN"): NoL10n.langZHS,
|
||||||
const Locale("zh", "TW"): NoL10n.langZHT,
|
const Locale("zh", "TW"): NoL10n.langZHT,
|
||||||
const Locale("en"): NoL10n.langEn,
|
const Locale("en"): NoL10n.langEn,
|
||||||
const Locale("ja"): NoL10n.langJa,
|
const Locale("ja"): NoL10n.langJa,
|
||||||
const Locale("ru"): NoL10n.langRU,
|
const Locale("ru"): NoL10n.langRU,
|
||||||
};
|
};
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AppGlobalState build() {
|
AppGlobalState build() {
|
||||||
@ -120,9 +127,15 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
await RSHttp.init();
|
await RSHttp.init();
|
||||||
dPrint("---- rust bridge init -----");
|
dPrint("---- rust bridge init -----");
|
||||||
|
|
||||||
|
// Register URL scheme
|
||||||
|
if ((!ConstConf.isMSE || kDebugMode) && Platform.isWindows) {
|
||||||
|
await _registerUrlScheme();
|
||||||
|
}
|
||||||
|
|
||||||
// init Hive
|
// init Hive
|
||||||
try {
|
try {
|
||||||
Hive.init("$applicationSupportDir/db");
|
Hive.init("$applicationSupportDir/db");
|
||||||
|
await Future.delayed(const Duration(milliseconds: 100));
|
||||||
final box = await Hive.openBox("app_conf");
|
final box = await Hive.openBox("app_conf");
|
||||||
state = state.copyWith(appConfBox: box);
|
state = state.copyWith(appConfBox: box);
|
||||||
if (box.get("install_id", defaultValue: "") == "") {
|
if (box.get("install_id", defaultValue: "") == "") {
|
||||||
@ -147,16 +160,6 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// init powershell
|
|
||||||
if (Platform.isWindows) {
|
|
||||||
try {
|
|
||||||
await SystemHelper.initPowershellPath();
|
|
||||||
dPrint("---- Powershell init -----");
|
|
||||||
} catch (e) {
|
|
||||||
dPrint("powershell init failed : $e");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get windows info
|
// get windows info
|
||||||
WindowsDeviceInfo? windowsDeviceInfo;
|
WindowsDeviceInfo? windowsDeviceInfo;
|
||||||
try {
|
try {
|
||||||
@ -170,16 +173,19 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
windowManager.waitUntilReadyToShow().then((_) async {
|
windowManager.waitUntilReadyToShow().then((_) async {
|
||||||
await windowManager.setTitle("SCToolBox");
|
await windowManager.setTitle("SCToolBox");
|
||||||
await windowManager.setSkipTaskbar(false);
|
await windowManager.setSkipTaskbar(false);
|
||||||
await windowManager.show();
|
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
await Window.initialize();
|
|
||||||
await Window.hideWindowControls();
|
|
||||||
if (windowsDeviceInfo?.productName.contains("Windows 11") ?? false) {
|
if (windowsDeviceInfo?.productName.contains("Windows 11") ?? false) {
|
||||||
await Window.setEffect(
|
// Apply acrylic effect before showing window
|
||||||
effect: WindowEffect.acrylic,
|
await Window.setEffect(effect: WindowEffect.acrylic, color: Colors.transparent, dark: true);
|
||||||
);
|
state = state.copyWith(windowsVersion: 11);
|
||||||
|
dPrint("---- Windows 11 Acrylic Effect applied -----");
|
||||||
|
} else {
|
||||||
|
state = state.copyWith(windowsVersion: 10);
|
||||||
|
await Window.setEffect(effect: WindowEffect.disabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Show window after acrylic effect is applied
|
||||||
|
await windowManager.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
dPrint("---- Window init -----");
|
dPrint("---- Window init -----");
|
||||||
@ -227,18 +233,24 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
if (state.networkVersionData == null) {
|
if (state.networkVersionData == null) {
|
||||||
if (!context.mounted) return false;
|
if (!context.mounted) return false;
|
||||||
await showToast(
|
await showToast(
|
||||||
context, S.current.app_common_network_error(ConstConf.appVersionDate, checkUpdateError.toString()));
|
context,
|
||||||
|
S.current.app_common_network_error(ConstConf.appVersionDate, checkUpdateError.toString()),
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Platform.isWindows) return false;
|
if (!Platform.isWindows) return false;
|
||||||
final lastVersion =
|
final lastVersion = ConstConf.isMSE
|
||||||
ConstConf.isMSE ? state.networkVersionData?.mSELastVersionCode : state.networkVersionData?.lastVersionCode;
|
? state.networkVersionData?.mSELastVersionCode
|
||||||
|
: state.networkVersionData?.lastVersionCode;
|
||||||
if ((lastVersion ?? 0) > ConstConf.appVersionCode) {
|
if ((lastVersion ?? 0) > ConstConf.appVersionCode) {
|
||||||
// need update
|
// need update
|
||||||
if (!context.mounted) return false;
|
if (!context.mounted) return false;
|
||||||
|
|
||||||
final r =
|
final r = await showDialog(
|
||||||
await showDialog(dismissWithEsc: false, context: context, builder: (context) => const UpgradeDialogUI());
|
dismissWithEsc: false,
|
||||||
|
context: context,
|
||||||
|
builder: (context) => const UpgradeDialogUI(),
|
||||||
|
);
|
||||||
|
|
||||||
if (r != true) {
|
if (r != true) {
|
||||||
if (!context.mounted) return false;
|
if (!context.mounted) return false;
|
||||||
@ -252,7 +264,7 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
|
|
||||||
Timer? _activityThemeColorTimer;
|
Timer? _activityThemeColorTimer;
|
||||||
|
|
||||||
checkActivityThemeColor(AppVersionData networkVersionData) {
|
void checkActivityThemeColor(AppVersionData networkVersionData) {
|
||||||
if (_activityThemeColorTimer != null) {
|
if (_activityThemeColorTimer != null) {
|
||||||
_activityThemeColorTimer?.cancel();
|
_activityThemeColorTimer?.cancel();
|
||||||
_activityThemeColorTimer = null;
|
_activityThemeColorTimer = null;
|
||||||
@ -265,8 +277,10 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
|
|
||||||
dPrint("now == $now start == $startTime end == $endTime");
|
dPrint("now == $now start == $startTime end == $endTime");
|
||||||
if (now < startTime) {
|
if (now < startTime) {
|
||||||
_activityThemeColorTimer =
|
_activityThemeColorTimer = Timer(
|
||||||
Timer(Duration(milliseconds: startTime - now), () => checkActivityThemeColor(networkVersionData));
|
Duration(milliseconds: startTime - now),
|
||||||
|
() => checkActivityThemeColor(networkVersionData),
|
||||||
|
);
|
||||||
dPrint("start Timer ....");
|
dPrint("start Timer ....");
|
||||||
} else if (now >= startTime && now <= endTime) {
|
} else if (now >= startTime && now <= endTime) {
|
||||||
dPrint("update Color ....");
|
dPrint("update Color ....");
|
||||||
@ -281,8 +295,10 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// wait for end
|
// wait for end
|
||||||
_activityThemeColorTimer =
|
_activityThemeColorTimer = Timer(
|
||||||
Timer(Duration(milliseconds: endTime - now), () => checkActivityThemeColor(networkVersionData));
|
Duration(milliseconds: endTime - now),
|
||||||
|
() => checkActivityThemeColor(networkVersionData),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
dPrint("reset Color ....");
|
dPrint("reset Color ....");
|
||||||
state = state.copyWith(
|
state = state.copyWith(
|
||||||
@ -295,7 +311,7 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeLocale(value) async {
|
void changeLocale(dynamic value) async {
|
||||||
final appConfBox = await Hive.openBox("app_conf");
|
final appConfBox = await Hive.openBox("app_conf");
|
||||||
if (value is Locale) {
|
if (value is Locale) {
|
||||||
if (value.languageCode == "auto") {
|
if (value.languageCode == "auto") {
|
||||||
@ -303,14 +319,36 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
await appConfBox.put("app_locale", null);
|
await appConfBox.put("app_locale", null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final localeCode =
|
final localeCode = value.countryCode != null
|
||||||
value.countryCode != null ? "${value.languageCode}_${value.countryCode ?? ""}" : value.languageCode;
|
? "${value.languageCode}_${value.countryCode ?? ""}"
|
||||||
|
: value.languageCode;
|
||||||
dPrint("changeLocale == $value localeCode=== $localeCode");
|
dPrint("changeLocale == $value localeCode=== $localeCode");
|
||||||
await appConfBox.put("app_locale", localeCode);
|
await appConfBox.put("app_locale", localeCode);
|
||||||
state = state.copyWith(appLocale: value);
|
state = state.copyWith(appLocale: value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Register sctoolbox:// URL scheme for non-MSE builds
|
||||||
|
Future<void> _registerUrlScheme() async {
|
||||||
|
try {
|
||||||
|
const scheme = "sctoolbox";
|
||||||
|
const appName = "SCToolBox";
|
||||||
|
final result = await applinks.registerApplinks(scheme: scheme, appName: appName);
|
||||||
|
if (result.success) {
|
||||||
|
if (result.wasModified) {
|
||||||
|
dPrint("URL scheme '$scheme' registered successfully: ${result.message}");
|
||||||
|
} else {
|
||||||
|
dPrint("URL scheme '$scheme' already registered: ${result.message}");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dPrint("URL scheme '$scheme' registration check: ${result.message}");
|
||||||
|
// Even if check fails, the registration might have succeeded
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("Failed to register URL scheme: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<String> _initAppDir() async {
|
Future<String> _initAppDir() async {
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
final userProfileDir = Platform.environment["USERPROFILE"];
|
final userProfileDir = Platform.environment["USERPROFILE"];
|
||||||
@ -348,7 +386,7 @@ class AppGlobalModel extends _$AppGlobalModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class ThemeConf with _$ThemeConf {
|
abstract class ThemeConf with _$ThemeConf {
|
||||||
const factory ThemeConf({
|
const factory ThemeConf({
|
||||||
@Default(Color(0xbf132431)) Color backgroundColor,
|
@Default(Color(0xbf132431)) Color backgroundColor,
|
||||||
@Default(Color(0xf2132431)) Color menuColor,
|
@Default(Color(0xf2132431)) Color menuColor,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
// ignore_for_file: type=lint
|
// 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
|
// 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
|
||||||
|
|
||||||
@ -9,465 +9,565 @@ part of 'app.dart';
|
|||||||
// FreezedGenerator
|
// FreezedGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
T _$identity<T>(T value) => value;
|
T _$identity<T>(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');
|
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$AppGlobalState {
|
mixin _$AppGlobalState {
|
||||||
String? get deviceUUID => throw _privateConstructorUsedError;
|
|
||||||
String? get applicationSupportDir => throw _privateConstructorUsedError;
|
|
||||||
String? get applicationBinaryModuleDir => throw _privateConstructorUsedError;
|
|
||||||
AppVersionData? get networkVersionData => throw _privateConstructorUsedError;
|
|
||||||
ThemeConf get themeConf => throw _privateConstructorUsedError;
|
|
||||||
Locale? get appLocale => throw _privateConstructorUsedError;
|
|
||||||
Box<dynamic>? get appConfBox => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
String? get deviceUUID; String? get applicationSupportDir; String? get applicationBinaryModuleDir; AppVersionData? get networkVersionData; ThemeConf get themeConf; Locale? get appLocale; Box? get appConfBox; dynamic get windowsVersion;
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// Create a copy of AppGlobalState
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
$AppGlobalStateCopyWith<AppGlobalState> get copyWith =>
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
throw _privateConstructorUsedError;
|
@pragma('vm:prefer-inline')
|
||||||
|
$AppGlobalStateCopyWith<AppGlobalState> get copyWith => _$AppGlobalStateCopyWithImpl<AppGlobalState>(this as AppGlobalState, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is AppGlobalState&&(identical(other.deviceUUID, deviceUUID) || other.deviceUUID == deviceUUID)&&(identical(other.applicationSupportDir, applicationSupportDir) || other.applicationSupportDir == applicationSupportDir)&&(identical(other.applicationBinaryModuleDir, applicationBinaryModuleDir) || other.applicationBinaryModuleDir == applicationBinaryModuleDir)&&(identical(other.networkVersionData, networkVersionData) || other.networkVersionData == networkVersionData)&&(identical(other.themeConf, themeConf) || other.themeConf == themeConf)&&(identical(other.appLocale, appLocale) || other.appLocale == appLocale)&&(identical(other.appConfBox, appConfBox) || other.appConfBox == appConfBox)&&const DeepCollectionEquality().equals(other.windowsVersion, windowsVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,deviceUUID,applicationSupportDir,applicationBinaryModuleDir,networkVersionData,themeConf,appLocale,appConfBox,const DeepCollectionEquality().hash(windowsVersion));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'AppGlobalState(deviceUUID: $deviceUUID, applicationSupportDir: $applicationSupportDir, applicationBinaryModuleDir: $applicationBinaryModuleDir, networkVersionData: $networkVersionData, themeConf: $themeConf, appLocale: $appLocale, appConfBox: $appConfBox, windowsVersion: $windowsVersion)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class $AppGlobalStateCopyWith<$Res> {
|
abstract mixin class $AppGlobalStateCopyWith<$Res> {
|
||||||
factory $AppGlobalStateCopyWith(
|
factory $AppGlobalStateCopyWith(AppGlobalState value, $Res Function(AppGlobalState) _then) = _$AppGlobalStateCopyWithImpl;
|
||||||
AppGlobalState value, $Res Function(AppGlobalState) then) =
|
@useResult
|
||||||
_$AppGlobalStateCopyWithImpl<$Res, AppGlobalState>;
|
$Res call({
|
||||||
@useResult
|
String? deviceUUID, String? applicationSupportDir, String? applicationBinaryModuleDir, AppVersionData? networkVersionData, ThemeConf themeConf, Locale? appLocale, Box? appConfBox, dynamic windowsVersion
|
||||||
$Res call(
|
});
|
||||||
{String? deviceUUID,
|
|
||||||
String? applicationSupportDir,
|
|
||||||
String? applicationBinaryModuleDir,
|
$ThemeConfCopyWith<$Res> get themeConf;
|
||||||
AppVersionData? networkVersionData,
|
|
||||||
ThemeConf themeConf,
|
|
||||||
Locale? appLocale,
|
|
||||||
Box<dynamic>? appConfBox});
|
|
||||||
|
|
||||||
$ThemeConfCopyWith<$Res> get themeConf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class _$AppGlobalStateCopyWithImpl<$Res, $Val extends AppGlobalState>
|
class _$AppGlobalStateCopyWithImpl<$Res>
|
||||||
implements $AppGlobalStateCopyWith<$Res> {
|
implements $AppGlobalStateCopyWith<$Res> {
|
||||||
_$AppGlobalStateCopyWithImpl(this._value, this._then);
|
_$AppGlobalStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
// ignore: unused_field
|
final AppGlobalState _self;
|
||||||
final $Val _value;
|
final $Res Function(AppGlobalState) _then;
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
/// Create a copy of AppGlobalState
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline') @override $Res call({Object? deviceUUID = freezed,Object? applicationSupportDir = freezed,Object? applicationBinaryModuleDir = freezed,Object? networkVersionData = freezed,Object? themeConf = null,Object? appLocale = freezed,Object? appConfBox = freezed,Object? windowsVersion = freezed,}) {
|
||||||
@override
|
return _then(_self.copyWith(
|
||||||
$Res call({
|
deviceUUID: freezed == deviceUUID ? _self.deviceUUID : deviceUUID // ignore: cast_nullable_to_non_nullable
|
||||||
Object? deviceUUID = freezed,
|
as String?,applicationSupportDir: freezed == applicationSupportDir ? _self.applicationSupportDir : applicationSupportDir // ignore: cast_nullable_to_non_nullable
|
||||||
Object? applicationSupportDir = freezed,
|
as String?,applicationBinaryModuleDir: freezed == applicationBinaryModuleDir ? _self.applicationBinaryModuleDir : applicationBinaryModuleDir // ignore: cast_nullable_to_non_nullable
|
||||||
Object? applicationBinaryModuleDir = freezed,
|
as String?,networkVersionData: freezed == networkVersionData ? _self.networkVersionData : networkVersionData // ignore: cast_nullable_to_non_nullable
|
||||||
Object? networkVersionData = freezed,
|
as AppVersionData?,themeConf: null == themeConf ? _self.themeConf : themeConf // ignore: cast_nullable_to_non_nullable
|
||||||
Object? themeConf = null,
|
as ThemeConf,appLocale: freezed == appLocale ? _self.appLocale : appLocale // ignore: cast_nullable_to_non_nullable
|
||||||
Object? appLocale = freezed,
|
as Locale?,appConfBox: freezed == appConfBox ? _self.appConfBox : appConfBox // ignore: cast_nullable_to_non_nullable
|
||||||
Object? appConfBox = freezed,
|
as Box?,windowsVersion: freezed == windowsVersion ? _self.windowsVersion : windowsVersion // ignore: cast_nullable_to_non_nullable
|
||||||
}) {
|
as dynamic,
|
||||||
return _then(_value.copyWith(
|
));
|
||||||
deviceUUID: freezed == deviceUUID
|
}
|
||||||
? _value.deviceUUID
|
/// Create a copy of AppGlobalState
|
||||||
: deviceUUID // ignore: cast_nullable_to_non_nullable
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
as String?,
|
@override
|
||||||
applicationSupportDir: freezed == applicationSupportDir
|
@pragma('vm:prefer-inline')
|
||||||
? _value.applicationSupportDir
|
$ThemeConfCopyWith<$Res> get themeConf {
|
||||||
: applicationSupportDir // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
return $ThemeConfCopyWith<$Res>(_self.themeConf, (value) {
|
||||||
applicationBinaryModuleDir: freezed == applicationBinaryModuleDir
|
return _then(_self.copyWith(themeConf: value));
|
||||||
? _value.applicationBinaryModuleDir
|
});
|
||||||
: applicationBinaryModuleDir // ignore: cast_nullable_to_non_nullable
|
}
|
||||||
as String?,
|
|
||||||
networkVersionData: freezed == networkVersionData
|
|
||||||
? _value.networkVersionData
|
|
||||||
: networkVersionData // ignore: cast_nullable_to_non_nullable
|
|
||||||
as AppVersionData?,
|
|
||||||
themeConf: null == themeConf
|
|
||||||
? _value.themeConf
|
|
||||||
: themeConf // ignore: cast_nullable_to_non_nullable
|
|
||||||
as ThemeConf,
|
|
||||||
appLocale: freezed == appLocale
|
|
||||||
? _value.appLocale
|
|
||||||
: appLocale // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Locale?,
|
|
||||||
appConfBox: freezed == appConfBox
|
|
||||||
? _value.appConfBox
|
|
||||||
: appConfBox // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Box<dynamic>?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
$ThemeConfCopyWith<$Res> get themeConf {
|
|
||||||
return $ThemeConfCopyWith<$Res>(_value.themeConf, (value) {
|
|
||||||
return _then(_value.copyWith(themeConf: value) as $Val);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$AppGlobalStateImplCopyWith<$Res>
|
|
||||||
implements $AppGlobalStateCopyWith<$Res> {
|
|
||||||
factory _$$AppGlobalStateImplCopyWith(_$AppGlobalStateImpl value,
|
|
||||||
$Res Function(_$AppGlobalStateImpl) then) =
|
|
||||||
__$$AppGlobalStateImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String? deviceUUID,
|
|
||||||
String? applicationSupportDir,
|
|
||||||
String? applicationBinaryModuleDir,
|
|
||||||
AppVersionData? networkVersionData,
|
|
||||||
ThemeConf themeConf,
|
|
||||||
Locale? appLocale,
|
|
||||||
Box<dynamic>? appConfBox});
|
|
||||||
|
|
||||||
@override
|
/// Adds pattern-matching-related methods to [AppGlobalState].
|
||||||
$ThemeConfCopyWith<$Res> get themeConf;
|
extension AppGlobalStatePatterns on AppGlobalState {
|
||||||
|
/// 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 extends Object?>(TResult Function( _AppGlobalState value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState() 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 extends Object?>(TResult Function( _AppGlobalState value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState():
|
||||||
|
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 extends Object?>(TResult? Function( _AppGlobalState value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState() 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 extends Object?>(TResult Function( String? deviceUUID, String? applicationSupportDir, String? applicationBinaryModuleDir, AppVersionData? networkVersionData, ThemeConf themeConf, Locale? appLocale, Box? appConfBox, dynamic windowsVersion)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState() when $default != null:
|
||||||
|
return $default(_that.deviceUUID,_that.applicationSupportDir,_that.applicationBinaryModuleDir,_that.networkVersionData,_that.themeConf,_that.appLocale,_that.appConfBox,_that.windowsVersion);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 extends Object?>(TResult Function( String? deviceUUID, String? applicationSupportDir, String? applicationBinaryModuleDir, AppVersionData? networkVersionData, ThemeConf themeConf, Locale? appLocale, Box? appConfBox, dynamic windowsVersion) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState():
|
||||||
|
return $default(_that.deviceUUID,_that.applicationSupportDir,_that.applicationBinaryModuleDir,_that.networkVersionData,_that.themeConf,_that.appLocale,_that.appConfBox,_that.windowsVersion);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 extends Object?>(TResult? Function( String? deviceUUID, String? applicationSupportDir, String? applicationBinaryModuleDir, AppVersionData? networkVersionData, ThemeConf themeConf, Locale? appLocale, Box? appConfBox, dynamic windowsVersion)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _AppGlobalState() when $default != null:
|
||||||
|
return $default(_that.deviceUUID,_that.applicationSupportDir,_that.applicationBinaryModuleDir,_that.networkVersionData,_that.themeConf,_that.appLocale,_that.appConfBox,_that.windowsVersion);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$AppGlobalStateImplCopyWithImpl<$Res>
|
|
||||||
extends _$AppGlobalStateCopyWithImpl<$Res, _$AppGlobalStateImpl>
|
|
||||||
implements _$$AppGlobalStateImplCopyWith<$Res> {
|
|
||||||
__$$AppGlobalStateImplCopyWithImpl(
|
|
||||||
_$AppGlobalStateImpl _value, $Res Function(_$AppGlobalStateImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? deviceUUID = freezed,
|
|
||||||
Object? applicationSupportDir = freezed,
|
|
||||||
Object? applicationBinaryModuleDir = freezed,
|
|
||||||
Object? networkVersionData = freezed,
|
|
||||||
Object? themeConf = null,
|
|
||||||
Object? appLocale = freezed,
|
|
||||||
Object? appConfBox = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$AppGlobalStateImpl(
|
|
||||||
deviceUUID: freezed == deviceUUID
|
|
||||||
? _value.deviceUUID
|
|
||||||
: deviceUUID // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
applicationSupportDir: freezed == applicationSupportDir
|
|
||||||
? _value.applicationSupportDir
|
|
||||||
: applicationSupportDir // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
applicationBinaryModuleDir: freezed == applicationBinaryModuleDir
|
|
||||||
? _value.applicationBinaryModuleDir
|
|
||||||
: applicationBinaryModuleDir // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
networkVersionData: freezed == networkVersionData
|
|
||||||
? _value.networkVersionData
|
|
||||||
: networkVersionData // ignore: cast_nullable_to_non_nullable
|
|
||||||
as AppVersionData?,
|
|
||||||
themeConf: null == themeConf
|
|
||||||
? _value.themeConf
|
|
||||||
: themeConf // ignore: cast_nullable_to_non_nullable
|
|
||||||
as ThemeConf,
|
|
||||||
appLocale: freezed == appLocale
|
|
||||||
? _value.appLocale
|
|
||||||
: appLocale // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Locale?,
|
|
||||||
appConfBox: freezed == appConfBox
|
|
||||||
? _value.appConfBox
|
|
||||||
: appConfBox // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Box<dynamic>?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
|
|
||||||
class _$AppGlobalStateImpl implements _AppGlobalState {
|
|
||||||
const _$AppGlobalStateImpl(
|
|
||||||
{this.deviceUUID,
|
|
||||||
this.applicationSupportDir,
|
|
||||||
this.applicationBinaryModuleDir,
|
|
||||||
this.networkVersionData,
|
|
||||||
this.themeConf = const ThemeConf(),
|
|
||||||
this.appLocale,
|
|
||||||
this.appConfBox});
|
|
||||||
|
|
||||||
@override
|
class _AppGlobalState implements AppGlobalState {
|
||||||
final String? deviceUUID;
|
const _AppGlobalState({this.deviceUUID, this.applicationSupportDir, this.applicationBinaryModuleDir, this.networkVersionData, this.themeConf = const ThemeConf(), this.appLocale, this.appConfBox, this.windowsVersion = 10});
|
||||||
@override
|
|
||||||
final String? applicationSupportDir;
|
|
||||||
@override
|
|
||||||
final String? applicationBinaryModuleDir;
|
|
||||||
@override
|
|
||||||
final AppVersionData? networkVersionData;
|
|
||||||
@override
|
|
||||||
@JsonKey()
|
|
||||||
final ThemeConf themeConf;
|
|
||||||
@override
|
|
||||||
final Locale? appLocale;
|
|
||||||
@override
|
|
||||||
final Box<dynamic>? appConfBox;
|
|
||||||
|
|
||||||
@override
|
@override final String? deviceUUID;
|
||||||
String toString() {
|
@override final String? applicationSupportDir;
|
||||||
return 'AppGlobalState(deviceUUID: $deviceUUID, applicationSupportDir: $applicationSupportDir, applicationBinaryModuleDir: $applicationBinaryModuleDir, networkVersionData: $networkVersionData, themeConf: $themeConf, appLocale: $appLocale, appConfBox: $appConfBox)';
|
@override final String? applicationBinaryModuleDir;
|
||||||
}
|
@override final AppVersionData? networkVersionData;
|
||||||
|
@override@JsonKey() final ThemeConf themeConf;
|
||||||
|
@override final Locale? appLocale;
|
||||||
|
@override final Box? appConfBox;
|
||||||
|
@override@JsonKey() final dynamic windowsVersion;
|
||||||
|
|
||||||
@override
|
/// Create a copy of AppGlobalState
|
||||||
bool operator ==(Object other) {
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
return identical(this, other) ||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
(other.runtimeType == runtimeType &&
|
@pragma('vm:prefer-inline')
|
||||||
other is _$AppGlobalStateImpl &&
|
_$AppGlobalStateCopyWith<_AppGlobalState> get copyWith => __$AppGlobalStateCopyWithImpl<_AppGlobalState>(this, _$identity);
|
||||||
(identical(other.deviceUUID, deviceUUID) ||
|
|
||||||
other.deviceUUID == deviceUUID) &&
|
|
||||||
(identical(other.applicationSupportDir, applicationSupportDir) ||
|
|
||||||
other.applicationSupportDir == applicationSupportDir) &&
|
|
||||||
(identical(other.applicationBinaryModuleDir,
|
|
||||||
applicationBinaryModuleDir) ||
|
|
||||||
other.applicationBinaryModuleDir ==
|
|
||||||
applicationBinaryModuleDir) &&
|
|
||||||
(identical(other.networkVersionData, networkVersionData) ||
|
|
||||||
other.networkVersionData == networkVersionData) &&
|
|
||||||
(identical(other.themeConf, themeConf) ||
|
|
||||||
other.themeConf == themeConf) &&
|
|
||||||
(identical(other.appLocale, appLocale) ||
|
|
||||||
other.appLocale == appLocale) &&
|
|
||||||
(identical(other.appConfBox, appConfBox) ||
|
|
||||||
other.appConfBox == appConfBox));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType,
|
|
||||||
deviceUUID,
|
|
||||||
applicationSupportDir,
|
|
||||||
applicationBinaryModuleDir,
|
|
||||||
networkVersionData,
|
|
||||||
themeConf,
|
|
||||||
appLocale,
|
|
||||||
appConfBox);
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
@override
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
bool operator ==(Object other) {
|
||||||
@override
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AppGlobalState&&(identical(other.deviceUUID, deviceUUID) || other.deviceUUID == deviceUUID)&&(identical(other.applicationSupportDir, applicationSupportDir) || other.applicationSupportDir == applicationSupportDir)&&(identical(other.applicationBinaryModuleDir, applicationBinaryModuleDir) || other.applicationBinaryModuleDir == applicationBinaryModuleDir)&&(identical(other.networkVersionData, networkVersionData) || other.networkVersionData == networkVersionData)&&(identical(other.themeConf, themeConf) || other.themeConf == themeConf)&&(identical(other.appLocale, appLocale) || other.appLocale == appLocale)&&(identical(other.appConfBox, appConfBox) || other.appConfBox == appConfBox)&&const DeepCollectionEquality().equals(other.windowsVersion, windowsVersion));
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$AppGlobalStateImplCopyWith<_$AppGlobalStateImpl> get copyWith =>
|
|
||||||
__$$AppGlobalStateImplCopyWithImpl<_$AppGlobalStateImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _AppGlobalState implements AppGlobalState {
|
|
||||||
const factory _AppGlobalState(
|
|
||||||
{final String? deviceUUID,
|
|
||||||
final String? applicationSupportDir,
|
|
||||||
final String? applicationBinaryModuleDir,
|
|
||||||
final AppVersionData? networkVersionData,
|
|
||||||
final ThemeConf themeConf,
|
|
||||||
final Locale? appLocale,
|
|
||||||
final Box<dynamic>? appConfBox}) = _$AppGlobalStateImpl;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String? get deviceUUID;
|
int get hashCode => Object.hash(runtimeType,deviceUUID,applicationSupportDir,applicationBinaryModuleDir,networkVersionData,themeConf,appLocale,appConfBox,const DeepCollectionEquality().hash(windowsVersion));
|
||||||
@override
|
|
||||||
String? get applicationSupportDir;
|
|
||||||
@override
|
|
||||||
String? get applicationBinaryModuleDir;
|
|
||||||
@override
|
|
||||||
AppVersionData? get networkVersionData;
|
|
||||||
@override
|
|
||||||
ThemeConf get themeConf;
|
|
||||||
@override
|
|
||||||
Locale? get appLocale;
|
|
||||||
@override
|
|
||||||
Box<dynamic>? get appConfBox;
|
|
||||||
|
|
||||||
/// Create a copy of AppGlobalState
|
@override
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
String toString() {
|
||||||
@override
|
return 'AppGlobalState(deviceUUID: $deviceUUID, applicationSupportDir: $applicationSupportDir, applicationBinaryModuleDir: $applicationBinaryModuleDir, networkVersionData: $networkVersionData, themeConf: $themeConf, appLocale: $appLocale, appConfBox: $appConfBox, windowsVersion: $windowsVersion)';
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
}
|
||||||
_$$AppGlobalStateImplCopyWith<_$AppGlobalStateImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$AppGlobalStateCopyWith<$Res> implements $AppGlobalStateCopyWith<$Res> {
|
||||||
|
factory _$AppGlobalStateCopyWith(_AppGlobalState value, $Res Function(_AppGlobalState) _then) = __$AppGlobalStateCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
String? deviceUUID, String? applicationSupportDir, String? applicationBinaryModuleDir, AppVersionData? networkVersionData, ThemeConf themeConf, Locale? appLocale, Box? appConfBox, dynamic windowsVersion
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@override $ThemeConfCopyWith<$Res> get themeConf;
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$AppGlobalStateCopyWithImpl<$Res>
|
||||||
|
implements _$AppGlobalStateCopyWith<$Res> {
|
||||||
|
__$AppGlobalStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _AppGlobalState _self;
|
||||||
|
final $Res Function(_AppGlobalState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of AppGlobalState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? deviceUUID = freezed,Object? applicationSupportDir = freezed,Object? applicationBinaryModuleDir = freezed,Object? networkVersionData = freezed,Object? themeConf = null,Object? appLocale = freezed,Object? appConfBox = freezed,Object? windowsVersion = freezed,}) {
|
||||||
|
return _then(_AppGlobalState(
|
||||||
|
deviceUUID: freezed == deviceUUID ? _self.deviceUUID : deviceUUID // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,applicationSupportDir: freezed == applicationSupportDir ? _self.applicationSupportDir : applicationSupportDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,applicationBinaryModuleDir: freezed == applicationBinaryModuleDir ? _self.applicationBinaryModuleDir : applicationBinaryModuleDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,networkVersionData: freezed == networkVersionData ? _self.networkVersionData : networkVersionData // ignore: cast_nullable_to_non_nullable
|
||||||
|
as AppVersionData?,themeConf: null == themeConf ? _self.themeConf : themeConf // ignore: cast_nullable_to_non_nullable
|
||||||
|
as ThemeConf,appLocale: freezed == appLocale ? _self.appLocale : appLocale // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Locale?,appConfBox: freezed == appConfBox ? _self.appConfBox : appConfBox // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Box?,windowsVersion: freezed == windowsVersion ? _self.windowsVersion : windowsVersion // ignore: cast_nullable_to_non_nullable
|
||||||
|
as dynamic,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a copy of AppGlobalState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$ThemeConfCopyWith<$Res> get themeConf {
|
||||||
|
|
||||||
|
return $ThemeConfCopyWith<$Res>(_self.themeConf, (value) {
|
||||||
|
return _then(_self.copyWith(themeConf: value));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$ThemeConf {
|
mixin _$ThemeConf {
|
||||||
Color get backgroundColor => throw _privateConstructorUsedError;
|
|
||||||
Color get menuColor => throw _privateConstructorUsedError;
|
|
||||||
Color get micaColor => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of ThemeConf
|
Color get backgroundColor; Color get menuColor; Color get micaColor;
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// Create a copy of ThemeConf
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
$ThemeConfCopyWith<ThemeConf> get copyWith =>
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
throw _privateConstructorUsedError;
|
@pragma('vm:prefer-inline')
|
||||||
|
$ThemeConfCopyWith<ThemeConf> get copyWith => _$ThemeConfCopyWithImpl<ThemeConf>(this as ThemeConf, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is ThemeConf&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.menuColor, menuColor) || other.menuColor == menuColor)&&(identical(other.micaColor, micaColor) || other.micaColor == micaColor));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,backgroundColor,menuColor,micaColor);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ThemeConf(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class $ThemeConfCopyWith<$Res> {
|
abstract mixin class $ThemeConfCopyWith<$Res> {
|
||||||
factory $ThemeConfCopyWith(ThemeConf value, $Res Function(ThemeConf) then) =
|
factory $ThemeConfCopyWith(ThemeConf value, $Res Function(ThemeConf) _then) = _$ThemeConfCopyWithImpl;
|
||||||
_$ThemeConfCopyWithImpl<$Res, ThemeConf>;
|
@useResult
|
||||||
@useResult
|
$Res call({
|
||||||
$Res call({Color backgroundColor, Color menuColor, Color micaColor});
|
Color backgroundColor, Color menuColor, Color micaColor
|
||||||
}
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class _$ThemeConfCopyWithImpl<$Res, $Val extends ThemeConf>
|
class _$ThemeConfCopyWithImpl<$Res>
|
||||||
implements $ThemeConfCopyWith<$Res> {
|
implements $ThemeConfCopyWith<$Res> {
|
||||||
_$ThemeConfCopyWithImpl(this._value, this._then);
|
_$ThemeConfCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
// ignore: unused_field
|
final ThemeConf _self;
|
||||||
final $Val _value;
|
final $Res Function(ThemeConf) _then;
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of ThemeConf
|
/// Create a copy of ThemeConf
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline') @override $Res call({Object? backgroundColor = null,Object? menuColor = null,Object? micaColor = null,}) {
|
||||||
@override
|
return _then(_self.copyWith(
|
||||||
$Res call({
|
backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? backgroundColor = null,
|
as Color,menuColor: null == menuColor ? _self.menuColor : menuColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? menuColor = null,
|
as Color,micaColor: null == micaColor ? _self.micaColor : micaColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? micaColor = null,
|
as Color,
|
||||||
}) {
|
));
|
||||||
return _then(_value.copyWith(
|
|
||||||
backgroundColor: null == backgroundColor
|
|
||||||
? _value.backgroundColor
|
|
||||||
: backgroundColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Color,
|
|
||||||
menuColor: null == menuColor
|
|
||||||
? _value.menuColor
|
|
||||||
: menuColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Color,
|
|
||||||
micaColor: null == micaColor
|
|
||||||
? _value.micaColor
|
|
||||||
: micaColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Color,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$ThemeConfImplCopyWith<$Res>
|
|
||||||
implements $ThemeConfCopyWith<$Res> {
|
|
||||||
factory _$$ThemeConfImplCopyWith(
|
|
||||||
_$ThemeConfImpl value, $Res Function(_$ThemeConfImpl) then) =
|
|
||||||
__$$ThemeConfImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call({Color backgroundColor, Color menuColor, Color micaColor});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$ThemeConfImplCopyWithImpl<$Res>
|
|
||||||
extends _$ThemeConfCopyWithImpl<$Res, _$ThemeConfImpl>
|
|
||||||
implements _$$ThemeConfImplCopyWith<$Res> {
|
|
||||||
__$$ThemeConfImplCopyWithImpl(
|
|
||||||
_$ThemeConfImpl _value, $Res Function(_$ThemeConfImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of ThemeConf
|
/// Adds pattern-matching-related methods to [ThemeConf].
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
extension ThemeConfPatterns on ThemeConf {
|
||||||
@pragma('vm:prefer-inline')
|
/// A variant of `map` that fallback to returning `orElse`.
|
||||||
@override
|
///
|
||||||
$Res call({
|
/// It is equivalent to doing:
|
||||||
Object? backgroundColor = null,
|
/// ```dart
|
||||||
Object? menuColor = null,
|
/// switch (sealedClass) {
|
||||||
Object? micaColor = null,
|
/// case final Subclass value:
|
||||||
}) {
|
/// return ...;
|
||||||
return _then(_$ThemeConfImpl(
|
/// case _:
|
||||||
backgroundColor: null == backgroundColor
|
/// return orElse();
|
||||||
? _value.backgroundColor
|
/// }
|
||||||
: backgroundColor // ignore: cast_nullable_to_non_nullable
|
/// ```
|
||||||
as Color,
|
|
||||||
menuColor: null == menuColor
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ThemeConf value)? $default,{required TResult orElse(),}){
|
||||||
? _value.menuColor
|
final _that = this;
|
||||||
: menuColor // ignore: cast_nullable_to_non_nullable
|
switch (_that) {
|
||||||
as Color,
|
case _ThemeConf() when $default != null:
|
||||||
micaColor: null == micaColor
|
return $default(_that);case _:
|
||||||
? _value.micaColor
|
return orElse();
|
||||||
: micaColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Color,
|
}
|
||||||
));
|
}
|
||||||
}
|
/// 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 extends Object?>(TResult Function( _ThemeConf value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _ThemeConf():
|
||||||
|
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 extends Object?>(TResult? Function( _ThemeConf value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _ThemeConf() 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 extends Object?>(TResult Function( Color backgroundColor, Color menuColor, Color micaColor)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _ThemeConf() when $default != null:
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor);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 extends Object?>(TResult Function( Color backgroundColor, Color menuColor, Color micaColor) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _ThemeConf():
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor);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 extends Object?>(TResult? Function( Color backgroundColor, Color menuColor, Color micaColor)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _ThemeConf() when $default != null:
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
|
|
||||||
class _$ThemeConfImpl implements _ThemeConf {
|
|
||||||
const _$ThemeConfImpl(
|
|
||||||
{this.backgroundColor = const Color(0xbf132431),
|
|
||||||
this.menuColor = const Color(0xf2132431),
|
|
||||||
this.micaColor = const Color(0xff0a3142)});
|
|
||||||
|
|
||||||
@override
|
class _ThemeConf implements ThemeConf {
|
||||||
@JsonKey()
|
const _ThemeConf({this.backgroundColor = const Color(0xbf132431), this.menuColor = const Color(0xf2132431), this.micaColor = const Color(0xff0a3142)});
|
||||||
final Color backgroundColor;
|
|
||||||
@override
|
|
||||||
@JsonKey()
|
|
||||||
final Color menuColor;
|
|
||||||
@override
|
|
||||||
@JsonKey()
|
|
||||||
final Color micaColor;
|
|
||||||
|
|
||||||
@override
|
@override@JsonKey() final Color backgroundColor;
|
||||||
String toString() {
|
@override@JsonKey() final Color menuColor;
|
||||||
return 'ThemeConf(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor)';
|
@override@JsonKey() final Color micaColor;
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
/// Create a copy of ThemeConf
|
||||||
bool operator ==(Object other) {
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
return identical(this, other) ||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
(other.runtimeType == runtimeType &&
|
@pragma('vm:prefer-inline')
|
||||||
other is _$ThemeConfImpl &&
|
_$ThemeConfCopyWith<_ThemeConf> get copyWith => __$ThemeConfCopyWithImpl<_ThemeConf>(this, _$identity);
|
||||||
(identical(other.backgroundColor, backgroundColor) ||
|
|
||||||
other.backgroundColor == backgroundColor) &&
|
|
||||||
(identical(other.menuColor, menuColor) ||
|
|
||||||
other.menuColor == menuColor) &&
|
|
||||||
(identical(other.micaColor, micaColor) ||
|
|
||||||
other.micaColor == micaColor));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode =>
|
|
||||||
Object.hash(runtimeType, backgroundColor, menuColor, micaColor);
|
|
||||||
|
|
||||||
/// Create a copy of ThemeConf
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
@override
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
bool operator ==(Object other) {
|
||||||
@override
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThemeConf&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.menuColor, menuColor) || other.menuColor == menuColor)&&(identical(other.micaColor, micaColor) || other.micaColor == micaColor));
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$ThemeConfImplCopyWith<_$ThemeConfImpl> get copyWith =>
|
|
||||||
__$$ThemeConfImplCopyWithImpl<_$ThemeConfImpl>(this, _$identity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _ThemeConf implements ThemeConf {
|
|
||||||
const factory _ThemeConf(
|
|
||||||
{final Color backgroundColor,
|
|
||||||
final Color menuColor,
|
|
||||||
final Color micaColor}) = _$ThemeConfImpl;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Color get backgroundColor;
|
int get hashCode => Object.hash(runtimeType,backgroundColor,menuColor,micaColor);
|
||||||
@override
|
|
||||||
Color get menuColor;
|
|
||||||
@override
|
|
||||||
Color get micaColor;
|
|
||||||
|
|
||||||
/// Create a copy of ThemeConf
|
@override
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
String toString() {
|
||||||
@override
|
return 'ThemeConf(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor)';
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$ThemeConfImplCopyWith<_$ThemeConfImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$ThemeConfCopyWith<$Res> implements $ThemeConfCopyWith<$Res> {
|
||||||
|
factory _$ThemeConfCopyWith(_ThemeConf value, $Res Function(_ThemeConf) _then) = __$ThemeConfCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
Color backgroundColor, Color menuColor, Color micaColor
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$ThemeConfCopyWithImpl<$Res>
|
||||||
|
implements _$ThemeConfCopyWith<$Res> {
|
||||||
|
__$ThemeConfCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _ThemeConf _self;
|
||||||
|
final $Res Function(_ThemeConf) _then;
|
||||||
|
|
||||||
|
/// Create a copy of ThemeConf
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? backgroundColor = null,Object? menuColor = null,Object? micaColor = null,}) {
|
||||||
|
return _then(_ThemeConf(
|
||||||
|
backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Color,menuColor: null == menuColor ? _self.menuColor : menuColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Color,micaColor: null == micaColor ? _self.micaColor : micaColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as Color,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
|
|||||||
117
lib/app.g.dart
117
lib/app.g.dart
@ -6,37 +6,98 @@ part of 'app.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$routerHash() => r'cdf659da46a6dfbab2368a85be2f803f54823142';
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
/// See also [router].
|
|
||||||
@ProviderFor(router)
|
@ProviderFor(router)
|
||||||
final routerProvider = AutoDisposeProvider<GoRouter>.internal(
|
final routerProvider = RouterProvider._();
|
||||||
router,
|
|
||||||
name: r'routerProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$routerHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
final class RouterProvider
|
||||||
// ignore: unused_element
|
extends $FunctionalProvider<GoRouter, GoRouter, GoRouter>
|
||||||
typedef RouterRef = AutoDisposeProviderRef<GoRouter>;
|
with $Provider<GoRouter> {
|
||||||
String _$appGlobalModelHash() => r'4e372bc744903960e4e7b146dbb394ded15e2c18';
|
RouterProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'routerProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$routerHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
$ProviderElement<GoRouter> $createElement($ProviderPointer pointer) =>
|
||||||
|
$ProviderElement(pointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
GoRouter create(Ref ref) {
|
||||||
|
return router(ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(GoRouter value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<GoRouter>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$routerHash() => r'e89f3f0277879147cdce5373cbe2554821e9cd31';
|
||||||
|
|
||||||
/// See also [AppGlobalModel].
|
|
||||||
@ProviderFor(AppGlobalModel)
|
@ProviderFor(AppGlobalModel)
|
||||||
final appGlobalModelProvider =
|
final appGlobalModelProvider = AppGlobalModelProvider._();
|
||||||
AutoDisposeNotifierProvider<AppGlobalModel, AppGlobalState>.internal(
|
|
||||||
AppGlobalModel.new,
|
|
||||||
name: r'appGlobalModelProvider',
|
|
||||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
|
||||||
? null
|
|
||||||
: _$appGlobalModelHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$AppGlobalModel = AutoDisposeNotifier<AppGlobalState>;
|
final class AppGlobalModelProvider
|
||||||
// ignore_for_file: type=lint
|
extends $NotifierProvider<AppGlobalModel, AppGlobalState> {
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
AppGlobalModelProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'appGlobalModelProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$appGlobalModelHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
AppGlobalModel create() => AppGlobalModel();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(AppGlobalState value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<AppGlobalState>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$appGlobalModelHash() => r'74128d2194d00a0e3dbb000dcaf6452e0b966d9c';
|
||||||
|
|
||||||
|
abstract class _$AppGlobalModel extends $Notifier<AppGlobalState> {
|
||||||
|
AppGlobalState build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final ref = this.ref as $Ref<AppGlobalState, AppGlobalState>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<AppGlobalState, AppGlobalState>,
|
||||||
|
AppGlobalState,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleCreate(ref, build);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -6,10 +6,8 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
|
||||||
class BinaryModuleConf {
|
class BinaryModuleConf {
|
||||||
static const _modules = {
|
// aria2c has been replaced by rqbit (Rust-based torrent library)
|
||||||
"aria2c": "0",
|
static const _modules = <String, String>{};
|
||||||
"unp4kc": "1",
|
|
||||||
};
|
|
||||||
|
|
||||||
static Future extractModule(List<String> modules, String workingDir) async {
|
static Future extractModule(List<String> modules, String workingDir) async {
|
||||||
for (var m in _modules.entries) {
|
for (var m in _modules.entries) {
|
||||||
@ -18,11 +16,8 @@ class BinaryModuleConf {
|
|||||||
final version = m.value;
|
final version = m.value;
|
||||||
final dir = "$workingDir\\$name";
|
final dir = "$workingDir\\$name";
|
||||||
final versionFile = File("$dir\\version");
|
final versionFile = File("$dir\\version");
|
||||||
if (kReleaseMode &&
|
if (kReleaseMode && await versionFile.exists() && (await versionFile.readAsString()).trim() == version) {
|
||||||
await versionFile.exists() &&
|
dPrint("BinaryModuleConf.extractModule skip $name version == $version");
|
||||||
(await versionFile.readAsString()).trim() == version) {
|
|
||||||
dPrint(
|
|
||||||
"BinaryModuleConf.extractModule skip $name version == $version");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// write model file
|
// write model file
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
class ConstConf {
|
class ConstConf {
|
||||||
static const String appVersion = "2.14.1";
|
static const String appVersion = "3.1.0";
|
||||||
static const int appVersionCode = 65;
|
static const int appVersionCode = 80;
|
||||||
static const String appVersionDate = "2025-05-08";
|
static const String appVersionDate = "2026-01-19";
|
||||||
static const _gameChannels = [
|
static const _gameChannels = ["LIVE", "4.0_PREVIEW", "PTU", "EPTU", "TECH-PREVIEW", "HOTFIX"];
|
||||||
"LIVE",
|
|
||||||
"4.0_PREVIEW",
|
|
||||||
"PTU",
|
|
||||||
"EPTU",
|
|
||||||
"TECH-PREVIEW",
|
|
||||||
"HOTFIX",
|
|
||||||
];
|
|
||||||
static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true";
|
static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true";
|
||||||
|
static const win32AppId = isMSE
|
||||||
|
? "56575xkeyC.MSE_bsn1nexg8e4qe!starcitizendoctor"
|
||||||
|
: "{6D809377-6AF0-444B-8957-A3773F02200E}\\Starcitizen_Doctor\\starcitizen_doctor.exe";
|
||||||
static const dohAddress = "https://223.6.6.6/resolve";
|
static const dohAddress = "https://223.6.6.6/resolve";
|
||||||
static const inputMethodServerPort = 59399;
|
static const inputMethodServerPort = 59399;
|
||||||
}
|
}
|
||||||
@ -18,9 +16,16 @@ class ConstConf {
|
|||||||
class AppConf {
|
class AppConf {
|
||||||
static List<String>? _networkGameChannels;
|
static List<String>? _networkGameChannels;
|
||||||
|
|
||||||
static setNetworkChannels(List<String>? channels) {
|
static void setNetworkChannels(List<String>? channels) {
|
||||||
_networkGameChannels = channels;
|
_networkGameChannels = channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<String> get gameChannels => _networkGameChannels ?? ConstConf._gameChannels;
|
static List<String> get gameChannels {
|
||||||
|
final baseChannels = _networkGameChannels ?? ConstConf._gameChannels;
|
||||||
|
// On Linux, add lowercase variants for case-sensitive filesystem
|
||||||
|
if (Platform.isLinux) {
|
||||||
|
return [...baseChannels, ...baseChannels.map((c) => c.toLowerCase())];
|
||||||
|
}
|
||||||
|
return baseChannels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,106 +1,77 @@
|
|||||||
import 'package:starcitizen_doctor/api/api.dart';
|
import 'package:starcitizen_doctor/api/api.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/doh_client.dart';
|
import 'package:starcitizen_doctor/common/io/doh_client.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/rs_http.dart';
|
import 'package:starcitizen_doctor/common/rust/api/http_api.dart' as rust_http;
|
||||||
import 'package:starcitizen_doctor/common/rust/http_package.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
|
||||||
class URLConf {
|
class URLConf {
|
||||||
/// HOME API
|
/// HOME API
|
||||||
static String gitApiHome = "https://git.scbox.xkeyc.cn";
|
static String gitApiHome = "https://git.scbox.xkeyc.cn";
|
||||||
static String rssApiHome = "https://rss.scbox.xkeyc.cn";
|
static String newsApiHome = "https://scbox.citizenwiki.cn";
|
||||||
static const String analyticsApiHome = "https://scbox.org";
|
static const String analyticsApiHome = "https://scbox.org";
|
||||||
|
|
||||||
|
/// PartyRoom Server
|
||||||
|
// static const String partyRoomServerAddress = "localhost";
|
||||||
|
// static const int partyRoomServerPort = 50051;
|
||||||
|
static const String partyRoomServerAddress = "ecdn.partyroom.grpc.scbox.xkeyc.cn";
|
||||||
|
static const int partyRoomServerPort = 443;
|
||||||
|
|
||||||
static bool isUrlCheckPass = false;
|
static bool isUrlCheckPass = false;
|
||||||
|
|
||||||
/// URLS
|
/// URLS
|
||||||
static String get giteaAttachmentsUrl => "$gitApiHome/SCToolBox/Release";
|
static String get giteaAttachmentsUrl => "$gitApiHome/SCToolBox/Release";
|
||||||
|
|
||||||
static String get gitlabLocalizationUrl =>
|
static String get gitlabLocalizationUrl => "$gitApiHome/SCToolBox/LocalizationData";
|
||||||
"$gitApiHome/SCToolBox/LocalizationData";
|
|
||||||
|
|
||||||
static String get gitApiRSILauncherEnhanceUrl =>
|
static String get gitApiRSILauncherEnhanceUrl => "$gitApiHome/SCToolBox/RSILauncherEnhance";
|
||||||
"$gitApiHome/SCToolBox/RSILauncherEnhance";
|
|
||||||
|
|
||||||
static String get apiRepoPath => "$gitApiHome/SCToolBox/api/raw/branch/main";
|
static String get apiRepoPath => "$gitApiHome/SCToolBox/api/raw/branch/main";
|
||||||
|
|
||||||
static String get gitlabApiPath => "$gitApiHome/api/v1/";
|
static String get gitlabApiPath => "$gitApiHome/api/v1/";
|
||||||
|
|
||||||
static String get webTranslateHomeUrl =>
|
static String get webTranslateHomeUrl => "$gitApiHome/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales";
|
||||||
"$gitApiHome/SCToolBox/ScWeb_Chinese_Translate/raw/branch/main/json/locales";
|
|
||||||
|
|
||||||
static String get rssVideoUrl =>
|
|
||||||
"$rssApiHome/bilibili/user/channel/27976358/290653";
|
|
||||||
|
|
||||||
static String get rssTextUrl2 =>
|
|
||||||
"$rssApiHome/baidu/tieba/user/%E7%81%AC%E7%81%ACG%E7%81%AC%E7%81%AC&";
|
|
||||||
|
|
||||||
static const String googleTranslateApiUrl =
|
|
||||||
"https://translate-g-proxy.xkeyc.com";
|
|
||||||
|
|
||||||
static const feedbackUrl = "https://support.citizenwiki.cn/all";
|
static const feedbackUrl = "https://support.citizenwiki.cn/all";
|
||||||
static const feedbackFAQUrl = "https://support.citizenwiki.cn/t/sc-toolbox";
|
static const feedbackFAQUrl = "https://support.citizenwiki.cn/t/sc-toolbox";
|
||||||
static String nav42KitUrl = "https://payload.citizenwiki.cn/api/community-navs?sort=is_sponsored&depth=2&page=1&limit=1000";
|
static String nav42KitUrl =
|
||||||
|
"https://payload.citizenwiki.cn/api/community-navs?sort=is_sponsored&depth=2&page=1&limit=1000";
|
||||||
|
|
||||||
static String get devReleaseUrl => "$gitApiHome/SCToolBox/Release/releases";
|
static String get devReleaseUrl => "$gitApiHome/SCToolBox/Release/releases";
|
||||||
|
|
||||||
|
/// RSI Avatar Base URL
|
||||||
|
static const String rsiAvatarBaseUrl = "https://robertsspaceindustries.com";
|
||||||
|
|
||||||
static Future<bool> checkHost() async {
|
static Future<bool> checkHost() async {
|
||||||
// 使用 DNS 获取可用列表
|
// 使用 DNS 获取可用列表
|
||||||
final gitApiList = _genFinalList(await dnsLookupTxt("git.dns.scbox.org"));
|
final gitApiList = _genFinalList(await dnsLookupTxt("git.dns.scbox.org"));
|
||||||
dPrint("DNS gitApiList ==== $gitApiList");
|
dPrint("DNS gitApiList ==== $gitApiList");
|
||||||
final fasterGit = await getFasterUrl(gitApiList);
|
final fasterGit = await rust_http.getFasterUrl(
|
||||||
|
urls: gitApiList,
|
||||||
|
pathSuffix: "/SCToolBox/Api/raw/branch/main/sc_doctor/version.json",
|
||||||
|
);
|
||||||
dPrint("gitApiList.Faster ==== $fasterGit");
|
dPrint("gitApiList.Faster ==== $fasterGit");
|
||||||
if (fasterGit != null) {
|
if (fasterGit != null) {
|
||||||
gitApiHome = fasterGit;
|
gitApiHome = fasterGit;
|
||||||
}
|
}
|
||||||
final rssApiList = _genFinalList(await dnsLookupTxt("rss.dns.scbox.org"));
|
final newsApiList = _genFinalList(await dnsLookupTxt("news.dns.scbox.org"));
|
||||||
final fasterRss = await getFasterUrl(rssApiList);
|
final fasterNews = await rust_http.getFasterUrl(urls: newsApiList, pathSuffix: "/api/latest");
|
||||||
dPrint("DNS rssApiList ==== $rssApiList");
|
dPrint("DNS newsApiList ==== $newsApiList");
|
||||||
dPrint("rssApiList.Faster ==== $fasterRss");
|
dPrint("newsApiList.Faster ==== $fasterNews");
|
||||||
if (fasterRss != null) {
|
if (fasterNews != null) {
|
||||||
rssApiHome = fasterRss;
|
newsApiHome = fasterNews;
|
||||||
}
|
}
|
||||||
isUrlCheckPass = fasterGit != null && fasterRss != null;
|
isUrlCheckPass = fasterGit != null && fasterNews != null;
|
||||||
return isUrlCheckPass;
|
return isUrlCheckPass;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<String>> dnsLookupTxt(String host) async {
|
static Future<List<String>> dnsLookupTxt(String host) async {
|
||||||
if (await Api.isUseInternalDNS()) {
|
if (await Api.isUseInternalDNS()) {
|
||||||
dPrint("[URLConf] use internal DNS LookupTxt $host");
|
dPrint("[URLConf] use internal DNS LookupTxt $host");
|
||||||
return RSHttp.dnsLookupTxt(host);
|
return rust_http.dnsLookupTxt(host: host);
|
||||||
}
|
}
|
||||||
dPrint("[URLConf] use DOH LookupTxt $host");
|
dPrint("[URLConf] use DOH LookupTxt $host");
|
||||||
return (await DohClient.resolveTXT(host)) ?? [];
|
return (await DohClient.resolveTXT(host)) ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getFasterUrl(List<String> urls) async {
|
|
||||||
String firstUrl = "";
|
|
||||||
int callLen = 0;
|
|
||||||
|
|
||||||
void onCall(RustHttpResponse? response, String url) {
|
|
||||||
callLen++;
|
|
||||||
if (response != null && response.statusCode == 200 && firstUrl.isEmpty) {
|
|
||||||
firstUrl = url;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var value in urls) {
|
|
||||||
RSHttp.head(value).then((resp) => onCall(resp, value), onError: (err) {
|
|
||||||
callLen++;
|
|
||||||
dPrint("RSHttp.head error $err");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
await Future.delayed(const Duration(milliseconds: 16));
|
|
||||||
if (firstUrl.isNotEmpty) {
|
|
||||||
return firstUrl;
|
|
||||||
}
|
|
||||||
if (callLen == urls.length && firstUrl.isEmpty) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<String> _genFinalList(List<String> sList) {
|
static List<String> _genFinalList(List<String> sList) {
|
||||||
List<String> list = [];
|
List<String> list = [];
|
||||||
for (var ll in sList) {
|
for (var ll in sList) {
|
||||||
|
|||||||
508
lib/common/helper/game_log_analyzer.dart
Normal file
508
lib/common/helper/game_log_analyzer.dart
Normal file
@ -0,0 +1,508 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/helper/log_helper.dart';
|
||||||
|
import 'package:starcitizen_doctor/generated/l10n.dart';
|
||||||
|
|
||||||
|
/// 日志分析结果数据类
|
||||||
|
class LogAnalyzeLineData {
|
||||||
|
final String type;
|
||||||
|
final String title;
|
||||||
|
final String? data;
|
||||||
|
final String? dateTime;
|
||||||
|
final String? tag; // 统计标签,用于定位日志(如 "game_start"),不依赖本地化
|
||||||
|
|
||||||
|
// 格式化后的字段
|
||||||
|
final String? victimId; // 受害者ID (actor_death)
|
||||||
|
final String? location; // 位置信息 (request_location_inventory)
|
||||||
|
final String? area; // 区域信息
|
||||||
|
final String? playerName; // 玩家名称 (player_login)
|
||||||
|
|
||||||
|
const LogAnalyzeLineData({
|
||||||
|
required this.type,
|
||||||
|
required this.title,
|
||||||
|
this.data,
|
||||||
|
this.dateTime,
|
||||||
|
this.tag,
|
||||||
|
this.victimId,
|
||||||
|
this.location,
|
||||||
|
this.area,
|
||||||
|
this.playerName,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'LogAnalyzeLineData(type: $type, title: $title, data: $data, dateTime: $dateTime)';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 日志分析统计数据
|
||||||
|
class LogAnalyzeStatistics {
|
||||||
|
final String playerName;
|
||||||
|
final int killCount;
|
||||||
|
final int deathCount;
|
||||||
|
final int selfKillCount;
|
||||||
|
final int vehicleDestructionCount;
|
||||||
|
final int vehicleDestructionCountHard;
|
||||||
|
final DateTime? gameStartTime;
|
||||||
|
final int gameCrashLineNumber;
|
||||||
|
final String? latestLocation; // 最新位置信息(全量查找)
|
||||||
|
|
||||||
|
const LogAnalyzeStatistics({
|
||||||
|
required this.playerName,
|
||||||
|
required this.killCount,
|
||||||
|
required this.deathCount,
|
||||||
|
required this.selfKillCount,
|
||||||
|
required this.vehicleDestructionCount,
|
||||||
|
required this.vehicleDestructionCountHard,
|
||||||
|
this.gameStartTime,
|
||||||
|
required this.gameCrashLineNumber,
|
||||||
|
this.latestLocation,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 游戏日志分析器
|
||||||
|
class GameLogAnalyzer {
|
||||||
|
static const String unknownValue = "<Unknown>";
|
||||||
|
|
||||||
|
// 正则表达式定义
|
||||||
|
static final _baseRegExp = RegExp(r'\[Notice\]\s+<([^>]+)>');
|
||||||
|
static final _gameLoadingRegExp = RegExp(
|
||||||
|
r'<[^>]+>\s+Loading screen for\s+(\w+)\s+:\s+SC_Frontend closed after\s+(\d+\.\d+)\s+seconds',
|
||||||
|
);
|
||||||
|
static final _logDateTimeRegExp = RegExp(r'<(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)>');
|
||||||
|
static final DateFormat _dateTimeFormatter = DateFormat('yyyy-MM-dd HH:mm:ss:SSS');
|
||||||
|
|
||||||
|
// 致命碰撞解析
|
||||||
|
static final _fatalCollisionPatterns = {
|
||||||
|
'vehicle': RegExp(r'Fatal Collision occured for vehicle\s+(\S+)'),
|
||||||
|
'zone': RegExp(r'Zone:\s*([^,\]]+)'),
|
||||||
|
'player_pilot': RegExp(r'PlayerPilot:\s*(\d)'),
|
||||||
|
'hit_entity': RegExp(r'hitting entity:\s*(\w+)'),
|
||||||
|
'distance': RegExp(r'Distance:\s*([\d.]+)'),
|
||||||
|
};
|
||||||
|
|
||||||
|
// 载具损毁解析
|
||||||
|
static final _vehicleDestructionPattern = RegExp(
|
||||||
|
r"Vehicle\s+'([^']+)'.*?" // 载具型号
|
||||||
|
r"in zone\s+'([^']+)'.*?" // Zone
|
||||||
|
r"destroy level \d+ to (\d+).*?" // 损毁等级
|
||||||
|
r"caused by\s+'([^']+)'", // 责任方
|
||||||
|
);
|
||||||
|
|
||||||
|
// 角色死亡解析
|
||||||
|
static final _actorDeathPattern = RegExp(
|
||||||
|
r"Actor '([^']+)'.*?" // 受害者ID
|
||||||
|
r"ejected from zone '([^']+)'.*?" // 原载具/区域
|
||||||
|
r"to zone '([^']+)'", // 目标区域
|
||||||
|
);
|
||||||
|
|
||||||
|
// 角色名称解析
|
||||||
|
static final _characterNamePattern = RegExp(r"name\s+([^-]+)");
|
||||||
|
|
||||||
|
// 本地库存请求解析
|
||||||
|
static final _requestLocationInventoryPattern = RegExp(r"Player\[([^\]]+)\].*?Location\[([^\]]+)\]");
|
||||||
|
|
||||||
|
// 载具控制解析
|
||||||
|
static final vehicleControlPattern = RegExp(r"granted control token for '([^']+)'\s+\[(\d+)\]");
|
||||||
|
|
||||||
|
/// 公开的日期时间解析方法,供其他模块使用
|
||||||
|
static DateTime? getLogLineDateTime(String line) => _getLogLineDateTime(line);
|
||||||
|
|
||||||
|
/// 公开的日期时间字符串解析方法
|
||||||
|
static String? getLogLineDateTimeString(String line) => _getLogLineDateTimeString(line);
|
||||||
|
|
||||||
|
/// 从载具名称中移除末尾的ID
|
||||||
|
/// 示例: ANVL_Hornet_F7A_Mk2_3467069517923 -> ANVL_Hornet_F7A_Mk2
|
||||||
|
static String removeVehicleId(String vehicleName) {
|
||||||
|
final regex = RegExp(r'_\d+$');
|
||||||
|
return vehicleName.replaceAll(regex, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 分析整个日志文件
|
||||||
|
///
|
||||||
|
/// [logFile] 日志文件
|
||||||
|
/// [startTime] 开始时间,如果提供则只统计此时间之后的数据
|
||||||
|
/// 返回日志分析结果列表和统计数据
|
||||||
|
static Future<(List<LogAnalyzeLineData>, LogAnalyzeStatistics)> analyzeLogFile(
|
||||||
|
File logFile, {
|
||||||
|
DateTime? startTime,
|
||||||
|
}) async {
|
||||||
|
if (!(await logFile.exists())) {
|
||||||
|
return (
|
||||||
|
[LogAnalyzeLineData(type: "error", title: S.current.log_analyzer_no_log_file)],
|
||||||
|
LogAnalyzeStatistics(
|
||||||
|
playerName: "",
|
||||||
|
killCount: 0,
|
||||||
|
deathCount: 0,
|
||||||
|
selfKillCount: 0,
|
||||||
|
vehicleDestructionCount: 0,
|
||||||
|
vehicleDestructionCountHard: 0,
|
||||||
|
gameCrashLineNumber: -1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final logLines = utf8.decode((await logFile.readAsBytes()), allowMalformed: true).split("\n");
|
||||||
|
return _analyzeLogLines(logLines, startTime: startTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 分析日志行列表
|
||||||
|
///
|
||||||
|
/// [logLines] 日志行列表
|
||||||
|
/// [startTime] 开始时间,如果提供则只影响计数统计,不影响 gameStartTime 和位置的全量查找
|
||||||
|
/// 返回日志分析结果列表和统计数据
|
||||||
|
static (List<LogAnalyzeLineData>, LogAnalyzeStatistics) _analyzeLogLines(
|
||||||
|
List<String> logLines, {
|
||||||
|
DateTime? startTime,
|
||||||
|
}) {
|
||||||
|
final results = <LogAnalyzeLineData>[];
|
||||||
|
String playerName = "";
|
||||||
|
int killCount = 0;
|
||||||
|
int deathCount = 0;
|
||||||
|
int selfKillCount = 0;
|
||||||
|
int vehicleDestructionCount = 0;
|
||||||
|
int vehicleDestructionCountHard = 0;
|
||||||
|
DateTime? gameStartTime; // 全量查找,不受 startTime 影响
|
||||||
|
String? latestLocation; // 全量查找最新位置
|
||||||
|
int gameCrashLineNumber = -1;
|
||||||
|
bool shouldCount = startTime == null; // 只影响计数
|
||||||
|
|
||||||
|
for (var i = 0; i < logLines.length; i++) {
|
||||||
|
final line = logLines[i];
|
||||||
|
if (line.isEmpty) continue;
|
||||||
|
|
||||||
|
// 如果设置了 startTime,检查当前行时间
|
||||||
|
if (startTime != null && !shouldCount) {
|
||||||
|
final lineTime = _getLogLineDateTime(line);
|
||||||
|
if (lineTime != null && lineTime.isAfter(startTime)) {
|
||||||
|
shouldCount = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理游戏开始(全量查找第一次出现)
|
||||||
|
if (gameStartTime == null) {
|
||||||
|
gameStartTime = _getLogLineDateTime(line);
|
||||||
|
if (gameStartTime != null) {
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "info",
|
||||||
|
title: S.current.log_analyzer_game_start,
|
||||||
|
tag: "game_start", // 使用 tag 标识,不依赖本地化
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏加载时间
|
||||||
|
final gameLoading = _parseGameLoading(line);
|
||||||
|
if (gameLoading != null) {
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "info",
|
||||||
|
title: S.current.log_analyzer_game_loading,
|
||||||
|
data: S.current.log_analyzer_mode_loading_time(gameLoading.$1, gameLoading.$2),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基础事件解析
|
||||||
|
final baseEvent = _parseBaseEvent(line);
|
||||||
|
if (baseEvent != null) {
|
||||||
|
LogAnalyzeLineData? data;
|
||||||
|
switch (baseEvent) {
|
||||||
|
case "AccountLoginCharacterStatus_Character":
|
||||||
|
data = _parseCharacterName(line);
|
||||||
|
if (data != null && data.playerName != null) {
|
||||||
|
playerName = data.playerName!; // 全量更新玩家名称
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "FatalCollision":
|
||||||
|
data = _parseFatalCollision(line);
|
||||||
|
break;
|
||||||
|
case "Vehicle Destruction":
|
||||||
|
data = _parseVehicleDestruction(line, playerName, shouldCount, (isHard) {
|
||||||
|
if (isHard) {
|
||||||
|
vehicleDestructionCountHard++;
|
||||||
|
} else {
|
||||||
|
vehicleDestructionCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "[ActorState] Dead":
|
||||||
|
data = _parseActorDeath(line, playerName, shouldCount, (isKill, isDeath, isSelfKill) {
|
||||||
|
if (isSelfKill) {
|
||||||
|
selfKillCount++;
|
||||||
|
} else {
|
||||||
|
if (isKill) killCount++;
|
||||||
|
if (isDeath) deathCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "RequestLocationInventory":
|
||||||
|
data = _parseRequestLocationInventory(line);
|
||||||
|
if (data != null && data.location != null) {
|
||||||
|
latestLocation = data.location; // 全量更新最新位置
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (data != null) {
|
||||||
|
results.add(data);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏关闭
|
||||||
|
if (line.contains("[CIG] CCIGBroker::FastShutdown")) {
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "info",
|
||||||
|
title: S.current.log_analyzer_game_close,
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏崩溃
|
||||||
|
if (line.contains("Cloud Imperium Games public crash handler")) {
|
||||||
|
gameCrashLineNumber = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理崩溃信息
|
||||||
|
if (gameCrashLineNumber > 0) {
|
||||||
|
final lastLineDateTime = gameStartTime != null
|
||||||
|
? _getLogLineDateTime(logLines.lastWhere((e) => e.startsWith("<20")))
|
||||||
|
: null;
|
||||||
|
final crashInfo = logLines.sublist(gameCrashLineNumber);
|
||||||
|
final info = SCLoggerHelper.getGameRunningLogInfo(crashInfo);
|
||||||
|
crashInfo.add(S.current.log_analyzer_one_click_diagnosis_header);
|
||||||
|
if (info != null) {
|
||||||
|
crashInfo.add(info.key);
|
||||||
|
if (info.value.isNotEmpty) {
|
||||||
|
crashInfo.add(S.current.log_analyzer_details_info(info.value));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
crashInfo.add(S.current.log_analyzer_no_crash_detected);
|
||||||
|
}
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "game_crash",
|
||||||
|
title: S.current.log_analyzer_game_crash,
|
||||||
|
data: crashInfo.join("\n"),
|
||||||
|
dateTime: lastLineDateTime != null ? _dateTimeFormatter.format(lastLineDateTime) : null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加统计信息
|
||||||
|
if (killCount > 0 || deathCount > 0) {
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "statistics",
|
||||||
|
title: S.current.log_analyzer_kill_summary,
|
||||||
|
data: S.current.log_analyzer_kill_death_suicide_count(
|
||||||
|
killCount,
|
||||||
|
deathCount,
|
||||||
|
selfKillCount,
|
||||||
|
vehicleDestructionCount,
|
||||||
|
vehicleDestructionCountHard,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统计游戏时长
|
||||||
|
if (gameStartTime != null) {
|
||||||
|
final lastLineDateTime = _getLogLineDateTime(logLines.lastWhere((e) => e.startsWith("<20"), orElse: () => ""));
|
||||||
|
if (lastLineDateTime != null) {
|
||||||
|
final duration = lastLineDateTime.difference(gameStartTime);
|
||||||
|
results.add(
|
||||||
|
LogAnalyzeLineData(
|
||||||
|
type: "statistics",
|
||||||
|
title: S.current.log_analyzer_play_time,
|
||||||
|
data: S.current.log_analyzer_play_time_format(
|
||||||
|
duration.inHours,
|
||||||
|
duration.inMinutes.remainder(60),
|
||||||
|
duration.inSeconds.remainder(60),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final statistics = LogAnalyzeStatistics(
|
||||||
|
playerName: playerName,
|
||||||
|
killCount: killCount,
|
||||||
|
deathCount: deathCount,
|
||||||
|
selfKillCount: selfKillCount,
|
||||||
|
vehicleDestructionCount: vehicleDestructionCount,
|
||||||
|
vehicleDestructionCountHard: vehicleDestructionCountHard,
|
||||||
|
gameStartTime: gameStartTime,
|
||||||
|
gameCrashLineNumber: gameCrashLineNumber,
|
||||||
|
latestLocation: latestLocation,
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results, statistics);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 解析辅助方法 ====================
|
||||||
|
|
||||||
|
static String? _parseBaseEvent(String line) {
|
||||||
|
final match = _baseRegExp.firstMatch(line);
|
||||||
|
return match?.group(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static (String, String)? _parseGameLoading(String line) {
|
||||||
|
final match = _gameLoadingRegExp.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
return (match.group(1) ?? "-", match.group(2) ?? "-");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DateTime? _getLogLineDateTime(String line) {
|
||||||
|
final match = _logDateTimeRegExp.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
final dateTimeString = match.group(1);
|
||||||
|
if (dateTimeString != null) {
|
||||||
|
return DateTime.parse(dateTimeString).toLocal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static String? _getLogLineDateTimeString(String line) {
|
||||||
|
final dateTime = _getLogLineDateTime(line);
|
||||||
|
if (dateTime != null) {
|
||||||
|
return _dateTimeFormatter.format(dateTime);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static String? _safeExtract(RegExp pattern, String line) => pattern.firstMatch(line)?.group(1)?.trim();
|
||||||
|
|
||||||
|
static LogAnalyzeLineData? _parseFatalCollision(String line) {
|
||||||
|
final vehicle = _safeExtract(_fatalCollisionPatterns['vehicle']!, line) ?? unknownValue;
|
||||||
|
final zone = _safeExtract(_fatalCollisionPatterns['zone']!, line) ?? unknownValue;
|
||||||
|
final playerPilot = (_safeExtract(_fatalCollisionPatterns['player_pilot']!, line) ?? '0') == '1';
|
||||||
|
final hitEntity = _safeExtract(_fatalCollisionPatterns['hit_entity']!, line) ?? unknownValue;
|
||||||
|
final distance = double.tryParse(_safeExtract(_fatalCollisionPatterns['distance']!, line) ?? '') ?? 0.0;
|
||||||
|
|
||||||
|
return LogAnalyzeLineData(
|
||||||
|
type: "fatal_collision",
|
||||||
|
title: S.current.log_analyzer_filter_fatal_collision,
|
||||||
|
data: S.current.log_analyzer_collision_details(
|
||||||
|
zone,
|
||||||
|
playerPilot ? '✅' : '❌',
|
||||||
|
hitEntity,
|
||||||
|
vehicle,
|
||||||
|
distance.toStringAsFixed(2),
|
||||||
|
),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static LogAnalyzeLineData? _parseVehicleDestruction(
|
||||||
|
String line,
|
||||||
|
String playerName,
|
||||||
|
bool shouldCount,
|
||||||
|
void Function(bool isHard) onDestruction,
|
||||||
|
) {
|
||||||
|
final match = _vehicleDestructionPattern.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
final vehicleModel = match.group(1) ?? unknownValue;
|
||||||
|
final zone = match.group(2) ?? unknownValue;
|
||||||
|
final destructionLevel = int.tryParse(match.group(3) ?? '') ?? 0;
|
||||||
|
final causedBy = match.group(4) ?? unknownValue;
|
||||||
|
|
||||||
|
final destructionLevelMap = {1: S.current.log_analyzer_soft_death, 2: S.current.log_analyzer_disintegration};
|
||||||
|
|
||||||
|
if (shouldCount && causedBy.trim() == playerName) {
|
||||||
|
onDestruction(destructionLevel == 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return LogAnalyzeLineData(
|
||||||
|
type: "vehicle_destruction",
|
||||||
|
title: S.current.log_analyzer_filter_vehicle_damaged,
|
||||||
|
data: S.current.log_analyzer_vehicle_damage_details(
|
||||||
|
vehicleModel,
|
||||||
|
zone,
|
||||||
|
destructionLevel.toString(),
|
||||||
|
destructionLevelMap[destructionLevel] ?? unknownValue,
|
||||||
|
causedBy,
|
||||||
|
),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LogAnalyzeLineData? _parseActorDeath(
|
||||||
|
String line,
|
||||||
|
String playerName,
|
||||||
|
bool shouldCount,
|
||||||
|
void Function(bool isKill, bool isDeath, bool isSelfKill) onDeath,
|
||||||
|
) {
|
||||||
|
final match = _actorDeathPattern.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
final victimId = match.group(1) ?? unknownValue;
|
||||||
|
final fromZone = match.group(2) ?? unknownValue;
|
||||||
|
final toZone = match.group(3) ?? unknownValue;
|
||||||
|
|
||||||
|
if (shouldCount) {
|
||||||
|
final isDeath = victimId.trim() == playerName;
|
||||||
|
if (isDeath) {
|
||||||
|
onDeath(false, true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return LogAnalyzeLineData(
|
||||||
|
type: "actor_death",
|
||||||
|
title: S.current.log_analyzer_filter_character_death,
|
||||||
|
data: S.current.log_analyzer_death_details(victimId, fromZone, toZone),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
location: fromZone,
|
||||||
|
area: toZone,
|
||||||
|
victimId: victimId,
|
||||||
|
playerName: playerName,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LogAnalyzeLineData? _parseCharacterName(String line) {
|
||||||
|
final match = _characterNamePattern.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
final characterName = match.group(1)?.trim() ?? unknownValue;
|
||||||
|
return LogAnalyzeLineData(
|
||||||
|
type: "player_login",
|
||||||
|
title: S.current.log_analyzer_player_login(characterName),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
playerName: characterName, // 格式化字段
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LogAnalyzeLineData? _parseRequestLocationInventory(String line) {
|
||||||
|
final match = _requestLocationInventoryPattern.firstMatch(line);
|
||||||
|
if (match != null) {
|
||||||
|
final playerId = match.group(1) ?? unknownValue;
|
||||||
|
final location = match.group(2) ?? unknownValue;
|
||||||
|
|
||||||
|
return LogAnalyzeLineData(
|
||||||
|
type: "request_location_inventory",
|
||||||
|
title: S.current.log_analyzer_view_local_inventory,
|
||||||
|
data: S.current.log_analyzer_player_location(playerId, location),
|
||||||
|
dateTime: _getLogLineDateTimeString(line),
|
||||||
|
location: location, // 格式化字段
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,11 +3,20 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:hive_ce/hive.dart';
|
import 'package:hive_ce/hive.dart';
|
||||||
import 'package:starcitizen_doctor/common/conf/conf.dart';
|
import 'package:starcitizen_doctor/common/conf/conf.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
|
||||||
class SCLoggerHelper {
|
class SCLoggerHelper {
|
||||||
static Future<String?> getLogFilePath() async {
|
static Future<String?> getLogFilePath() async {
|
||||||
if (!Platform.isWindows) return null;
|
if (!Platform.isWindows) {
|
||||||
|
final wineUserPath = await getWineUserPath();
|
||||||
|
if (wineUserPath == null) return null;
|
||||||
|
// /home/xkeyc/Games/star-citizen/drive_c/users/xkeyc/AppData/Roaming/rsilauncher/
|
||||||
|
final rsiLauncherPath = "$wineUserPath/AppData/Roaming/rsilauncher";
|
||||||
|
dPrint("rsiLauncherPath Wine:$rsiLauncherPath");
|
||||||
|
final jsonLogPath = "$rsiLauncherPath/logs/log.log";
|
||||||
|
return jsonLogPath;
|
||||||
|
}
|
||||||
Map<String, String> envVars = Platform.environment;
|
Map<String, String> envVars = Platform.environment;
|
||||||
final appDataPath = envVars["appdata"];
|
final appDataPath = envVars["appdata"];
|
||||||
if (appDataPath == null) {
|
if (appDataPath == null) {
|
||||||
@ -20,6 +29,14 @@ class SCLoggerHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getShaderCachePath() async {
|
static Future<String?> getShaderCachePath() async {
|
||||||
|
if (!Platform.isWindows) {
|
||||||
|
final wineUserPath = await getWineUserPath();
|
||||||
|
if (wineUserPath == null) return null;
|
||||||
|
// /home/xkeyc/Games/star-citizen/drive_c/users/xkeyc/AppData/Local/star citizen/
|
||||||
|
final scCachePath = "$wineUserPath/AppData/Local/star citizen";
|
||||||
|
dPrint("getShaderCachePath Wine === $scCachePath");
|
||||||
|
return scCachePath;
|
||||||
|
}
|
||||||
Map<String, String> envVars = Platform.environment;
|
Map<String, String> envVars = Platform.environment;
|
||||||
final appDataPath = envVars["LOCALAPPDATA"];
|
final appDataPath = envVars["LOCALAPPDATA"];
|
||||||
if (appDataPath == null) {
|
if (appDataPath == null) {
|
||||||
@ -30,6 +47,23 @@ class SCLoggerHelper {
|
|||||||
return scCachePath;
|
return scCachePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<String?> getWineUserPath() async {
|
||||||
|
// get game path in hiveBox
|
||||||
|
final confBox = await Hive.openBox("app_conf");
|
||||||
|
final path = confBox.get("custom_game_path");
|
||||||
|
if (path?.isEmpty ?? true) return null;
|
||||||
|
// path eg: /home/xkeyc/Games/star-citizen/drive_c/Program Files/Roberts Space Industries/StarCitizen/LIVE/
|
||||||
|
// resolve wine c_drive path
|
||||||
|
final wineCDrivePath = path.toString().split('/drive_c/').first;
|
||||||
|
// scan wine user path == current_unix_user
|
||||||
|
final wineUserPath = "$wineCDrivePath/drive_c/users/${Platform.environment['USER']}";
|
||||||
|
// check exists
|
||||||
|
final wineUserDir = Directory(wineUserPath);
|
||||||
|
if (!await wineUserDir.exists()) return null;
|
||||||
|
dPrint("getWineUserPath === $wineUserPath");
|
||||||
|
return wineUserPath;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<List?> getLauncherLogList() async {
|
static Future<List?> getLauncherLogList() async {
|
||||||
if (!Platform.isWindows) return [];
|
if (!Platform.isWindows) return [];
|
||||||
try {
|
try {
|
||||||
@ -43,20 +77,25 @@ class SCLoggerHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<String>> getGameInstallPath(List listData,
|
static Future<List<String>> getGameInstallPath(
|
||||||
{bool checkExists = true,
|
List listData, {
|
||||||
List<String> withVersion = const ["LIVE"]}) async {
|
bool checkExists = true,
|
||||||
|
List<String> withVersion = const ["LIVE"],
|
||||||
|
}) async {
|
||||||
List<String> scInstallPaths = [];
|
List<String> scInstallPaths = [];
|
||||||
|
|
||||||
checkAndAddPath(String path, bool checkExists) async {
|
checkAndAddPath(String path, bool checkExists) async {
|
||||||
// 将所有连续的 \\ 替换为 \
|
// Handle JSON-escaped backslashes (\\\\) -> single backslash (\\)
|
||||||
path = path.replaceAll(RegExp(r'\\+'), "\\");
|
path = path.replaceAll(r'\\', r'\');
|
||||||
if (path.isNotEmpty && !scInstallPaths.contains(path)) {
|
// Normalize path separators to current platform format
|
||||||
|
path = path.platformPath;
|
||||||
|
|
||||||
|
// Case-insensitive check for existing paths
|
||||||
|
if (path.isNotEmpty && !scInstallPaths.any((p) => p.toLowerCase() == path.toLowerCase())) {
|
||||||
if (!checkExists) {
|
if (!checkExists) {
|
||||||
dPrint("find installPath == $path");
|
dPrint("find installPath == $path");
|
||||||
scInstallPaths.add(path);
|
scInstallPaths.add(path);
|
||||||
} else if (await File("$path/Bin64/StarCitizen.exe").exists() &&
|
} else if (await File("$path/Bin64/StarCitizen.exe").exists() && await File("$path/Data.p4k").exists()) {
|
||||||
await File("$path/Data.p4k").exists()) {
|
|
||||||
dPrint("find installPath == $path");
|
dPrint("find installPath == $path");
|
||||||
scInstallPaths.add(path);
|
scInstallPaths.add(path);
|
||||||
}
|
}
|
||||||
@ -67,14 +106,25 @@ class SCLoggerHelper {
|
|||||||
final path = confBox.get("custom_game_path");
|
final path = confBox.get("custom_game_path");
|
||||||
if (path != null && path != "") {
|
if (path != null && path != "") {
|
||||||
for (var v in withVersion) {
|
for (var v in withVersion) {
|
||||||
await checkAndAddPath("$path\\$v", checkExists);
|
await checkAndAddPath("$path\\$v".platformPath, checkExists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (var v in withVersion) {
|
for (var v in withVersion) {
|
||||||
String pattern =
|
// Platform-specific regex patterns for game install path detection
|
||||||
r'([a-zA-Z]:\\\\[^\\\\]*\\\\[^\\\\]*\\\\StarCitizen\\\\' + v + r')';
|
// Uses restrictive character class to avoid matching across JSON delimiters
|
||||||
|
String pattern;
|
||||||
|
if (Platform.isWindows) {
|
||||||
|
// Windows: Match paths like C:\...\StarCitizen\LIVE
|
||||||
|
// Path segments can only contain: letters, numbers, space, dot, underscore, hyphen, parentheses
|
||||||
|
// Handles both single backslash, forward slash, and JSON-escaped double backslash
|
||||||
|
pattern =
|
||||||
|
r'([a-zA-Z]:(?:[/\\]|\\\\)(?:[a-zA-Z0-9 ._()-]+(?:[/\\]|\\\\))*StarCitizen(?:[/\\]|\\\\)' + v + r')';
|
||||||
|
} else {
|
||||||
|
// Unix (Wine): Match paths like /home/user/.../StarCitizen/LIVE
|
||||||
|
pattern = r'(/(?:[a-zA-Z0-9 ._()-]+/)*StarCitizen/' + v + r')';
|
||||||
|
}
|
||||||
RegExp regExp = RegExp(pattern, caseSensitive: false);
|
RegExp regExp = RegExp(pattern, caseSensitive: false);
|
||||||
for (var i = listData.length - 1; i > 0; i--) {
|
for (var i = listData.length - 1; i > 0; i--) {
|
||||||
final line = listData[i];
|
final line = listData[i];
|
||||||
@ -89,10 +139,14 @@ class SCLoggerHelper {
|
|||||||
// 动态检测更多位置
|
// 动态检测更多位置
|
||||||
for (var fileName in List.from(scInstallPaths)) {
|
for (var fileName in List.from(scInstallPaths)) {
|
||||||
for (var v in withVersion) {
|
for (var v in withVersion) {
|
||||||
if (fileName.toString().endsWith(v)) {
|
final suffix = '\\$v'.platformPath.toLowerCase();
|
||||||
|
if (fileName.toString().toLowerCase().endsWith(suffix)) {
|
||||||
for (var nv in withVersion) {
|
for (var nv in withVersion) {
|
||||||
final nextName =
|
final basePath = fileName.toString().replaceAll(
|
||||||
"${fileName.toString().replaceAll("\\$v", "")}\\$nv";
|
RegExp('${RegExp.escape(suffix)}\$', caseSensitive: false),
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
final nextName = "$basePath\\$nv".platformPath;
|
||||||
await checkAndAddPath(nextName, true);
|
await checkAndAddPath(nextName, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,9 +162,10 @@ class SCLoggerHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static String getGameChannelID(String installPath) {
|
static String getGameChannelID(String installPath) {
|
||||||
|
final pathLower = installPath.platformPath.toLowerCase();
|
||||||
for (var value in AppConf.gameChannels) {
|
for (var value in AppConf.gameChannels) {
|
||||||
if (installPath.endsWith("\\$value")) {
|
if (pathLower.endsWith('\\${value.toLowerCase()}'.platformPath)) {
|
||||||
return value;
|
return value.toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
@ -121,8 +176,7 @@ class SCLoggerHelper {
|
|||||||
if (!await logFile.exists()) {
|
if (!await logFile.exists()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return await logFile.readAsLines(
|
return await logFile.readAsLines(encoding: const Utf8Codec(allowMalformed: true));
|
||||||
encoding: const Utf8Codec(allowMalformed: true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MapEntry<String, String>? getGameRunningLogInfo(List<String> logs) {
|
static MapEntry<String, String>? getGameRunningLogInfo(List<String> logs) {
|
||||||
@ -138,47 +192,47 @@ class SCLoggerHelper {
|
|||||||
|
|
||||||
static MapEntry<String, String>? _checkRunningLine(String line) {
|
static MapEntry<String, String>? _checkRunningLine(String line) {
|
||||||
if (line.contains("STATUS_CRYENGINE_OUT_OF_SYSMEM")) {
|
if (line.contains("STATUS_CRYENGINE_OUT_OF_SYSMEM")) {
|
||||||
return MapEntry(S.current.doctor_game_error_low_memory,
|
return MapEntry(S.current.doctor_game_error_low_memory, S.current.doctor_game_error_low_memory_info);
|
||||||
S.current.doctor_game_error_low_memory_info);
|
|
||||||
}
|
}
|
||||||
if (line.contains("EXCEPTION_ACCESS_VIOLATION")) {
|
if (line.contains("EXCEPTION_ACCESS_VIOLATION")) {
|
||||||
return MapEntry(S.current.doctor_game_error_generic_info,
|
return MapEntry(S.current.doctor_game_error_generic_info, "https://docs.qq.com/doc/DUURxUVhzTmZoY09Z");
|
||||||
"https://docs.qq.com/doc/DUURxUVhzTmZoY09Z");
|
|
||||||
}
|
}
|
||||||
if (line.contains("DXGI_ERROR_DEVICE_REMOVED")) {
|
if (line.contains("DXGI_ERROR_DEVICE_REMOVED")) {
|
||||||
return MapEntry(S.current.doctor_game_error_gpu_crash,
|
return MapEntry(S.current.doctor_game_error_gpu_crash, "https://www.bilibili.com/read/cv19335199");
|
||||||
"https://www.bilibili.com/read/cv19335199");
|
|
||||||
}
|
}
|
||||||
if (line.contains("Wakeup socket sendto error")) {
|
if (line.contains("Wakeup socket sendto error")) {
|
||||||
return MapEntry(S.current.doctor_game_error_socket_error,
|
return MapEntry(S.current.doctor_game_error_socket_error, S.current.doctor_game_error_socket_error_info);
|
||||||
S.current.doctor_game_error_socket_error_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.contains("The requested operation requires elevated")) {
|
if (line.contains("The requested operation requires elevated")) {
|
||||||
return MapEntry(S.current.doctor_game_error_permissions_error,
|
return MapEntry(
|
||||||
S.current.doctor_game_error_permissions_error_info);
|
S.current.doctor_game_error_permissions_error,
|
||||||
|
S.current.doctor_game_error_permissions_error_info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (line.contains(
|
if (line.contains("The process cannot access the file because is is being used by another process")) {
|
||||||
"The process cannot access the file because is is being used by another process")) {
|
return MapEntry(
|
||||||
return MapEntry(S.current.doctor_game_error_game_process_error,
|
S.current.doctor_game_error_game_process_error,
|
||||||
S.current.doctor_game_error_game_process_error_info);
|
S.current.doctor_game_error_game_process_error_info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (line.contains("0xc0000043")) {
|
if (line.contains("0xc0000043")) {
|
||||||
return MapEntry(S.current.doctor_game_error_game_damaged_file,
|
return MapEntry(
|
||||||
S.current.doctor_game_error_game_damaged_file_info);
|
S.current.doctor_game_error_game_damaged_file,
|
||||||
|
S.current.doctor_game_error_game_damaged_file_info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (line.contains("option to verify the content of the Data.p4k file")) {
|
if (line.contains("option to verify the content of the Data.p4k file")) {
|
||||||
return MapEntry(S.current.doctor_game_error_game_damaged_p4k_file,
|
return MapEntry(
|
||||||
S.current.doctor_game_error_game_damaged_p4k_file_info);
|
S.current.doctor_game_error_game_damaged_p4k_file,
|
||||||
|
S.current.doctor_game_error_game_damaged_p4k_file_info,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (line.contains("OUTOFMEMORY Direct3D could not allocate")) {
|
if (line.contains("OUTOFMEMORY Direct3D could not allocate")) {
|
||||||
return MapEntry(S.current.doctor_game_error_low_gpu_memory,
|
return MapEntry(S.current.doctor_game_error_low_gpu_memory, S.current.doctor_game_error_low_gpu_memory_info);
|
||||||
S.current.doctor_game_error_low_gpu_memory_info);
|
|
||||||
}
|
}
|
||||||
if (line.contains(
|
if (line.contains("try disabling with r_vulkanDisableLayers = 1 in your user.cfg")) {
|
||||||
"try disabling with r_vulkanDisableLayers = 1 in your user.cfg")) {
|
return MapEntry(S.current.doctor_game_error_gpu_vulkan_crash, S.current.doctor_game_error_gpu_vulkan_crash_info);
|
||||||
return MapEntry(S.current.doctor_game_error_gpu_vulkan_crash,
|
|
||||||
S.current.doctor_game_error_gpu_vulkan_crash_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unknown
|
/// Unknown
|
||||||
|
|||||||
@ -1,82 +1,36 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:hive_ce/hive.dart';
|
import 'package:hive_ce/hive.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/utils/base_utils.dart';
|
||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/rust/api/win32_api.dart' as win32;
|
||||||
|
|
||||||
class SystemHelper {
|
class SystemHelper {
|
||||||
static String powershellPath = "powershell.exe";
|
|
||||||
|
|
||||||
static initPowershellPath() async {
|
|
||||||
try {
|
|
||||||
var result = await Process.run(powershellPath, ["echo", "pong"]);
|
|
||||||
if (!result.stdout.toString().startsWith("pong") &&
|
|
||||||
powershellPath == "powershell.exe") {
|
|
||||||
throw "powershell check failed";
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
Map<String, String> envVars = Platform.environment;
|
|
||||||
final systemRoot = envVars["SYSTEMROOT"];
|
|
||||||
if (systemRoot != null) {
|
|
||||||
final autoSearchPath =
|
|
||||||
"$systemRoot\\System32\\WindowsPowerShell\\v1.0\\powershell.exe";
|
|
||||||
dPrint("auto search powershell path === $autoSearchPath");
|
|
||||||
powershellPath = autoSearchPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future<bool> checkNvmePatchStatus() async {
|
static Future<bool> checkNvmePatchStatus() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(SystemHelper.powershellPath, [
|
return await win32.checkNvmePatchStatus();
|
||||||
"Get-ItemProperty",
|
|
||||||
"-Path",
|
|
||||||
"\"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\stornvme\\Parameters\\Device\"",
|
|
||||||
"-Name",
|
|
||||||
"\"ForcedPhysicalSectorSizeInBytes\""
|
|
||||||
]);
|
|
||||||
dPrint("checkNvmePatchStatus result ==== ${result.stdout}");
|
|
||||||
if (result.stderr == "" &&
|
|
||||||
result.stdout.toString().contains("{* 4095}")) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
dPrint("checkNvmePatchStatus error: $e");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> addNvmePatch() async {
|
static Future<String> addNvmePatch() async {
|
||||||
var result = await Process.run(powershellPath, [
|
try {
|
||||||
'New-ItemProperty',
|
await win32.addNvmePatch();
|
||||||
"-Path",
|
return "";
|
||||||
"\"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\stornvme\\Parameters\\Device\"",
|
} catch (e) {
|
||||||
"-Name",
|
dPrint("addNvmePatch error: $e");
|
||||||
"ForcedPhysicalSectorSizeInBytes",
|
return e.toString();
|
||||||
"-PropertyType MultiString",
|
}
|
||||||
"-Force -Value",
|
|
||||||
"\"* 4095\""
|
|
||||||
]);
|
|
||||||
dPrint("nvme_PhysicalBytes result == ${result.stdout}");
|
|
||||||
return result.stderr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static doRemoveNvmePath() async {
|
static Future<bool> doRemoveNvmePath() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(powershellPath, [
|
await win32.removeNvmePatch();
|
||||||
"Clear-ItemProperty",
|
return true;
|
||||||
"-Path",
|
|
||||||
"\"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\stornvme\\Parameters\\Device\"",
|
|
||||||
"-Name",
|
|
||||||
"\"ForcedPhysicalSectorSizeInBytes\""
|
|
||||||
]);
|
|
||||||
dPrint("doRemoveNvmePath result ==== ${result.stdout}");
|
|
||||||
if (result.stderr == "") {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
dPrint("doRemoveNvmePath error: $e");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -88,7 +42,7 @@ class SystemHelper {
|
|||||||
if (path != null && path != "") {
|
if (path != null && path != "") {
|
||||||
if (await File(path).exists()) {
|
if (await File(path).exists()) {
|
||||||
if (skipEXE) {
|
if (skipEXE) {
|
||||||
return "${path.toString().replaceAll("\\RSI Launcher.exe", "")}\\";
|
return "${path.toString().replaceAll("\\RSI Launcher.exe".platformPath, "")}\\".platformPath;
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
@ -100,42 +54,44 @@ class SystemHelper {
|
|||||||
"$programDataPath\\Microsoft\\Windows\\Start Menu\\Programs\\Roberts Space Industries\\RSI Launcher.lnk";
|
"$programDataPath\\Microsoft\\Windows\\Start Menu\\Programs\\Roberts Space Industries\\RSI Launcher.lnk";
|
||||||
final rsiLinkFile = File(rsiFilePath);
|
final rsiLinkFile = File(rsiFilePath);
|
||||||
if (await rsiLinkFile.exists()) {
|
if (await rsiLinkFile.exists()) {
|
||||||
final r = await Process.run(SystemHelper.powershellPath, [
|
try {
|
||||||
"(New-Object -ComObject WScript.Shell).CreateShortcut(\"$rsiFilePath\").targetpath"
|
final targetPath = await win32.resolveShortcut(lnkPath: rsiFilePath);
|
||||||
]);
|
if (targetPath.contains("RSI Launcher.exe")) {
|
||||||
if (r.stdout.toString().contains("RSI Launcher.exe")) {
|
final start = targetPath.split("RSI Launcher.exe");
|
||||||
final start = r.stdout.toString().split("RSI Launcher.exe");
|
if (skipEXE) {
|
||||||
if (skipEXE) {
|
return start[0];
|
||||||
return start[0];
|
}
|
||||||
|
return "${start[0]}RSI Launcher.exe";
|
||||||
}
|
}
|
||||||
return "${start[0]}RSI Launcher.exe";
|
} catch (e) {
|
||||||
|
dPrint("resolveShortcut error: $e");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static killRSILauncher() async {
|
static Future<void> killRSILauncher() async {
|
||||||
var psr = await Process.run(
|
var pList = await getPID("RSI Launcher");
|
||||||
powershellPath, ["ps", "\"RSI Launcher\"", "|select -expand id"]);
|
for (var pid in pList) {
|
||||||
if (psr.stderr == "") {
|
try {
|
||||||
for (var value in (psr.stdout ?? "").toString().split("\n")) {
|
Process.killPid(pid);
|
||||||
dPrint(value);
|
} catch (e) {
|
||||||
if (value != "") {
|
dPrint("killRSILauncher Error: $e");
|
||||||
Process.killPid(int.parse(value));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<List<String>> getPID(String name) async {
|
static Future<List<int>> getPID(String name) async {
|
||||||
final r = await Process.run(powershellPath, ["(ps $name).Id"]);
|
try {
|
||||||
final str = r.stdout.toString().trim();
|
final pList = await win32.getProcessListByName(processName: name);
|
||||||
dPrint(str);
|
return pList.map((e) => e.pid).toList();
|
||||||
if (str.isEmpty) return [];
|
} catch (e) {
|
||||||
return str.split("\n");
|
dPrint("getPID Error: $e");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static checkAndLaunchRSILauncher(String path) async {
|
static Future<void> checkAndLaunchRSILauncher(String path) async {
|
||||||
// check running and kill
|
// check running and kill
|
||||||
await killRSILauncher();
|
await killRSILauncher();
|
||||||
// launch
|
// launch
|
||||||
@ -143,65 +99,84 @@ class SystemHelper {
|
|||||||
if (processorAffinity == null) {
|
if (processorAffinity == null) {
|
||||||
Process.run(path, []);
|
Process.run(path, []);
|
||||||
} else {
|
} else {
|
||||||
Process.run("cmd.exe", [
|
Process.run("cmd.exe", ['/C', 'Start', '""', '/High', '/Affinity', processorAffinity, path]);
|
||||||
'/C',
|
|
||||||
'Start',
|
|
||||||
'""',
|
|
||||||
'/High',
|
|
||||||
'/Affinity',
|
|
||||||
processorAffinity,
|
|
||||||
path,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
dPrint(path);
|
dPrint(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<int> getSystemMemorySizeGB() async {
|
static Future<int> getSystemMemorySizeGB() async {
|
||||||
final r = await Process.run(powershellPath, [
|
try {
|
||||||
"(Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum).sum /1gb"
|
final memoryGb = await win32.getSystemMemorySizeGb();
|
||||||
]);
|
return memoryGb.toInt();
|
||||||
return int.tryParse(r.stdout.toString().trim()) ?? 0;
|
} catch (e) {
|
||||||
|
dPrint("getSystemMemorySizeGB error: $e");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getSystemCimInstance(String win32InstanceName,
|
static Future<String> getSystemCimInstance(String win32InstanceName, {pathName = "Name"}) async {
|
||||||
{pathName = "Name"}) async {
|
// This method is deprecated, use getSystemInfo() instead
|
||||||
final r = await Process.run(
|
try {
|
||||||
powershellPath, ["(Get-CimInstance $win32InstanceName).$pathName"]);
|
final sysInfo = await win32.getSystemInfo();
|
||||||
return r.stdout.toString().trim();
|
if (win32InstanceName.contains("OperatingSystem")) {
|
||||||
|
return sysInfo.osName;
|
||||||
|
} else if (win32InstanceName.contains("Processor")) {
|
||||||
|
return sysInfo.cpuName;
|
||||||
|
} else if (win32InstanceName.contains("VideoController")) {
|
||||||
|
return sysInfo.gpuInfo;
|
||||||
|
} else if (win32InstanceName.contains("DiskDrive")) {
|
||||||
|
return sysInfo.diskInfo;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("getSystemCimInstance error: $e");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getSystemName() async {
|
static Future<String> getSystemName() async {
|
||||||
final r = await Process.run(
|
try {
|
||||||
powershellPath, ["(Get-ComputerInfo | Select-Object -expand OsName)"]);
|
final sysInfo = await win32.getSystemInfo();
|
||||||
return r.stdout.toString().trim();
|
return sysInfo.osName;
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("getSystemName error: $e");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getCpuName() async {
|
static Future<String> getCpuName() async {
|
||||||
final r = await Process.run(
|
try {
|
||||||
powershellPath, ["(Get-WmiObject -Class Win32_Processor).Name"]);
|
final sysInfo = await win32.getSystemInfo();
|
||||||
return r.stdout.toString().trim();
|
return sysInfo.cpuName;
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("getCpuName error: $e");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getGpuInfo() async {
|
static Future<String> getGpuInfo() async {
|
||||||
const cmd = r"""
|
try {
|
||||||
$adapterMemory = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name "HardwareInformation.AdapterString", "HardwareInformation.qwMemorySize" -Exclude PSPath -ErrorAction SilentlyContinue)
|
// Try registry first for more accurate VRAM info
|
||||||
foreach ($adapter in $adapterMemory) {
|
final regInfo = await win32.getGpuInfoFromRegistry();
|
||||||
[PSCustomObject] @{
|
if (regInfo.isNotEmpty) {
|
||||||
Model=$adapter."HardwareInformation.AdapterString"
|
return regInfo;
|
||||||
"VRAM (GB)"=[math]::round($adapter."HardwareInformation.qwMemorySize"/1GB)
|
}
|
||||||
}
|
// Fallback to WMI
|
||||||
}
|
final sysInfo = await win32.getSystemInfo();
|
||||||
""";
|
return sysInfo.gpuInfo;
|
||||||
final r = await Process.run(powershellPath, [cmd]);
|
} catch (e) {
|
||||||
return r.stdout.toString().trim();
|
dPrint("getGpuInfo error: $e");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> getDiskInfo() async {
|
static Future<String> getDiskInfo() async {
|
||||||
return (await Process.run(powershellPath,
|
try {
|
||||||
["Get-PhysicalDisk | format-table BusType,FriendlyName,Size"]))
|
final sysInfo = await win32.getSystemInfo();
|
||||||
.stdout
|
return sysInfo.diskInfo;
|
||||||
.toString()
|
} catch (e) {
|
||||||
.trim();
|
dPrint("getDiskInfo error: $e");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<int> getDirLen(String path, {List<String>? skipPath}) async {
|
static Future<int> getDirLen(String path, {List<String>? skipPath}) async {
|
||||||
@ -228,17 +203,17 @@ foreach ($adapter in $adapterMemory) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future<int> getNumberOfLogicalProcessors() async {
|
static Future<int> getNumberOfLogicalProcessors() async {
|
||||||
final cpuNumberResult = await Process.run(powershellPath,
|
try {
|
||||||
["(Get-WmiObject -Class Win32_Processor).NumberOfLogicalProcessors"]);
|
return await win32.getNumberOfLogicalProcessors();
|
||||||
if (cpuNumberResult.exitCode != 0) return 0;
|
} catch (e) {
|
||||||
return int.tryParse(cpuNumberResult.stdout.toString().trim()) ?? 0;
|
dPrint("getNumberOfLogicalProcessors error: $e");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String?> getCpuAffinity() async {
|
static Future<String?> getCpuAffinity() async {
|
||||||
final confBox = await Hive.openBox("app_conf");
|
final confBox = await Hive.openBox("app_conf");
|
||||||
final eCoreCount = int.tryParse(
|
final eCoreCount = int.tryParse(confBox.get("gameLaunch_eCore_count", defaultValue: "0")) ?? 0;
|
||||||
confBox.get("gameLaunch_eCore_count", defaultValue: "0")) ??
|
|
||||||
0;
|
|
||||||
final cpuNumber = await getNumberOfLogicalProcessors();
|
final cpuNumber = await getNumberOfLogicalProcessors();
|
||||||
if (cpuNumber == 0 || eCoreCount == 0 || eCoreCount > cpuNumber) {
|
if (cpuNumber == 0 || eCoreCount == 0 || eCoreCount > cpuNumber) {
|
||||||
return null;
|
return null;
|
||||||
@ -255,17 +230,17 @@ foreach ($adapter in $adapterMemory) {
|
|||||||
final binaryString = sb.toString();
|
final binaryString = sb.toString();
|
||||||
int hexDigits = (binaryString.length / 4).ceil();
|
int hexDigits = (binaryString.length / 4).ceil();
|
||||||
dPrint("Affinity sb ==== $sb");
|
dPrint("Affinity sb ==== $sb");
|
||||||
return int.parse(binaryString, radix: 2)
|
return int.parse(binaryString, radix: 2).toRadixString(16).padLeft(hexDigits, '0').toUpperCase();
|
||||||
.toRadixString(16)
|
|
||||||
.padLeft(hexDigits, '0')
|
|
||||||
.toUpperCase();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future openDir(path, {bool isFile = false}) async {
|
static Future openDir(dynamic path, {bool isFile = false}) async {
|
||||||
dPrint("SystemHelper.openDir path === $path");
|
dPrint("SystemHelper.openDir path === $path");
|
||||||
if (Platform.isWindows) {
|
if (Platform.isWindows) {
|
||||||
await Process.run(SystemHelper.powershellPath,
|
try {
|
||||||
["explorer.exe", isFile ? "/select,$path" : "\"/select,\"$path\"\""]);
|
await win32.openDirWithExplorer(path: path.toString(), isFile: isFile);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("openDir error: $e");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
839
lib/common/helper/yearly_report_analyzer.dart
Normal file
839
lib/common/helper/yearly_report_analyzer.dart
Normal file
@ -0,0 +1,839 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:isolate';
|
||||||
|
import 'package:starcitizen_doctor/common/helper/game_log_analyzer.dart';
|
||||||
|
|
||||||
|
/// 年度报告数据类
|
||||||
|
class YearlyReportData {
|
||||||
|
// 基础统计
|
||||||
|
final int totalLaunchCount; // 累计启动次数
|
||||||
|
final Duration totalPlayTime; // 累计游玩时长
|
||||||
|
final int yearlyLaunchCount; // 年度启动次数
|
||||||
|
final Duration yearlyPlayTime; // 年度游玩时长
|
||||||
|
final int totalCrashCount; // 总崩溃次数
|
||||||
|
final int yearlyCrashCount; // 年度崩溃次数
|
||||||
|
|
||||||
|
// 时间统计
|
||||||
|
final DateTime? yearlyFirstLaunchTime; // 年度第一次启动时间
|
||||||
|
final DateTime? earliestPlayDate; // 年度游玩最早的一天 (05:00及以后)
|
||||||
|
final DateTime? latestPlayDate; // 年度游玩最晚的一天 (04:00及以前)
|
||||||
|
|
||||||
|
// 游玩时长统计
|
||||||
|
final Duration? longestSession; // 最长单次游玩时长
|
||||||
|
final DateTime? longestSessionDate; // 最长游玩那一天
|
||||||
|
final Duration? shortestSession; // 最短单次游玩时长 (超过5分钟的)
|
||||||
|
final DateTime? shortestSessionDate; // 最短游玩那一天
|
||||||
|
final Duration? averageSessionTime; // 平均单次游玩时长
|
||||||
|
|
||||||
|
// 载具统计
|
||||||
|
final int yearlyVehicleDestructionCount; // 年度炸船次数
|
||||||
|
final String? mostDestroyedVehicle; // 年度炸的最多的船
|
||||||
|
final int mostDestroyedVehicleCount; // 炸的最多的船的次数
|
||||||
|
final String? mostPilotedVehicle; // 年度最爱驾驶的载具
|
||||||
|
final int mostPilotedVehicleCount; // 驾驶次数
|
||||||
|
|
||||||
|
// 账号统计
|
||||||
|
final int accountCount; // 账号数量
|
||||||
|
final String? mostPlayedAccount; // 游玩最多的账号
|
||||||
|
final int mostPlayedAccountSessionCount; // 游玩最多的账号的会话次数
|
||||||
|
|
||||||
|
// 地点统计
|
||||||
|
final List<MapEntry<String, int>> topLocations; // Top 地点访问统计
|
||||||
|
|
||||||
|
// 击杀统计 (K/D)
|
||||||
|
final int yearlyKillCount; // 年度击杀次数
|
||||||
|
final int yearlyDeathCount; // 年度死亡次数
|
||||||
|
final int yearlySelfKillCount; // 年度自杀次数
|
||||||
|
|
||||||
|
// 月份统计
|
||||||
|
final int? mostPlayedMonth; // 游玩最多的月份 (1-12)
|
||||||
|
final int mostPlayedMonthCount; // 该月游玩次数
|
||||||
|
final int? leastPlayedMonth; // 游玩最少的月份 (1-12, 不包括完全没上游戏的月份)
|
||||||
|
final int leastPlayedMonthCount; // 该月游玩次数
|
||||||
|
|
||||||
|
// 连续游玩/离线统计
|
||||||
|
final int longestPlayStreak; // 最长连续游玩天数
|
||||||
|
final DateTime? playStreakStartDate; // 连续游玩开始日期
|
||||||
|
final DateTime? playStreakEndDate; // 连续游玩结束日期
|
||||||
|
final int longestOfflineStreak; // 最长连续离线天数
|
||||||
|
final DateTime? offlineStreakStartDate; // 连续离线开始日期
|
||||||
|
final DateTime? offlineStreakEndDate; // 连续离线结束日期
|
||||||
|
|
||||||
|
// 详细数据 (用于展示)
|
||||||
|
final Map<String, int> vehiclePilotedDetails; // 驾驶载具详情
|
||||||
|
final Map<String, int> accountSessionDetails; // 账号会话详情
|
||||||
|
final Map<String, int> locationDetails; // 地点访问详情
|
||||||
|
|
||||||
|
const YearlyReportData({
|
||||||
|
required this.totalLaunchCount,
|
||||||
|
required this.totalPlayTime,
|
||||||
|
required this.yearlyLaunchCount,
|
||||||
|
required this.yearlyPlayTime,
|
||||||
|
required this.totalCrashCount,
|
||||||
|
required this.yearlyCrashCount,
|
||||||
|
this.yearlyFirstLaunchTime,
|
||||||
|
this.earliestPlayDate,
|
||||||
|
this.latestPlayDate,
|
||||||
|
this.longestSession,
|
||||||
|
this.longestSessionDate,
|
||||||
|
this.shortestSession,
|
||||||
|
this.shortestSessionDate,
|
||||||
|
this.averageSessionTime,
|
||||||
|
required this.yearlyVehicleDestructionCount,
|
||||||
|
this.mostDestroyedVehicle,
|
||||||
|
required this.mostDestroyedVehicleCount,
|
||||||
|
this.mostPilotedVehicle,
|
||||||
|
required this.mostPilotedVehicleCount,
|
||||||
|
required this.accountCount,
|
||||||
|
this.mostPlayedAccount,
|
||||||
|
required this.mostPlayedAccountSessionCount,
|
||||||
|
required this.topLocations,
|
||||||
|
required this.yearlyKillCount,
|
||||||
|
required this.yearlyDeathCount,
|
||||||
|
required this.yearlySelfKillCount,
|
||||||
|
this.mostPlayedMonth,
|
||||||
|
required this.mostPlayedMonthCount,
|
||||||
|
this.leastPlayedMonth,
|
||||||
|
required this.leastPlayedMonthCount,
|
||||||
|
required this.longestPlayStreak,
|
||||||
|
this.playStreakStartDate,
|
||||||
|
this.playStreakEndDate,
|
||||||
|
required this.longestOfflineStreak,
|
||||||
|
this.offlineStreakStartDate,
|
||||||
|
this.offlineStreakEndDate,
|
||||||
|
required this.vehiclePilotedDetails,
|
||||||
|
required this.accountSessionDetails,
|
||||||
|
required this.locationDetails,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// 将 DateTime 转换为 UTC 毫秒时间戳
|
||||||
|
static int? _toUtcTimestamp(DateTime? dateTime) {
|
||||||
|
if (dateTime == null) return null;
|
||||||
|
return dateTime.toUtc().millisecondsSinceEpoch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 转换为 JSON Map
|
||||||
|
///
|
||||||
|
/// 时间字段使用 UTC 毫秒时间戳 (int),配合 timezoneOffsetMinutes 可在客户端还原本地时间
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final now = DateTime.now();
|
||||||
|
final offset = now.timeZoneOffset;
|
||||||
|
|
||||||
|
return {
|
||||||
|
// 元数据
|
||||||
|
'generatedAtUtc': _toUtcTimestamp(now),
|
||||||
|
'timezoneOffsetMinutes': offset.inMinutes,
|
||||||
|
|
||||||
|
// 基础统计
|
||||||
|
'totalLaunchCount': totalLaunchCount,
|
||||||
|
'totalPlayTimeMs': totalPlayTime.inMilliseconds,
|
||||||
|
'yearlyLaunchCount': yearlyLaunchCount,
|
||||||
|
'yearlyPlayTimeMs': yearlyPlayTime.inMilliseconds,
|
||||||
|
'totalCrashCount': totalCrashCount,
|
||||||
|
'yearlyCrashCount': yearlyCrashCount,
|
||||||
|
|
||||||
|
// 时间统计 (UTC 毫秒时间戳)
|
||||||
|
'yearlyFirstLaunchTimeUtc': _toUtcTimestamp(yearlyFirstLaunchTime),
|
||||||
|
'earliestPlayDateUtc': _toUtcTimestamp(earliestPlayDate),
|
||||||
|
'latestPlayDateUtc': _toUtcTimestamp(latestPlayDate),
|
||||||
|
|
||||||
|
// 游玩时长统计
|
||||||
|
'longestSessionMs': longestSession?.inMilliseconds,
|
||||||
|
'longestSessionDateUtc': _toUtcTimestamp(longestSessionDate),
|
||||||
|
'shortestSessionMs': shortestSession?.inMilliseconds,
|
||||||
|
'shortestSessionDateUtc': _toUtcTimestamp(shortestSessionDate),
|
||||||
|
'averageSessionTimeMs': averageSessionTime?.inMilliseconds,
|
||||||
|
|
||||||
|
// 载具统计
|
||||||
|
'yearlyVehicleDestructionCount': yearlyVehicleDestructionCount,
|
||||||
|
'mostDestroyedVehicle': mostDestroyedVehicle,
|
||||||
|
'mostDestroyedVehicleCount': mostDestroyedVehicleCount,
|
||||||
|
'mostPilotedVehicle': mostPilotedVehicle,
|
||||||
|
'mostPilotedVehicleCount': mostPilotedVehicleCount,
|
||||||
|
|
||||||
|
// 账号统计
|
||||||
|
'accountCount': accountCount,
|
||||||
|
'mostPlayedAccount': mostPlayedAccount,
|
||||||
|
'mostPlayedAccountSessionCount': mostPlayedAccountSessionCount,
|
||||||
|
|
||||||
|
// 地点统计
|
||||||
|
'topLocations': topLocations.map((e) => {'location': e.key, 'count': e.value}).toList(),
|
||||||
|
|
||||||
|
// 击杀统计
|
||||||
|
'yearlyKillCount': yearlyKillCount,
|
||||||
|
'yearlyDeathCount': yearlyDeathCount,
|
||||||
|
'yearlySelfKillCount': yearlySelfKillCount,
|
||||||
|
|
||||||
|
// 月份统计
|
||||||
|
'mostPlayedMonth': mostPlayedMonth,
|
||||||
|
'mostPlayedMonthCount': mostPlayedMonthCount,
|
||||||
|
'leastPlayedMonth': leastPlayedMonth,
|
||||||
|
'leastPlayedMonthCount': leastPlayedMonthCount,
|
||||||
|
|
||||||
|
// 连续游玩/离线统计
|
||||||
|
'longestPlayStreak': longestPlayStreak,
|
||||||
|
'playStreakStartDateUtc': _toUtcTimestamp(playStreakStartDate),
|
||||||
|
'playStreakEndDateUtc': _toUtcTimestamp(playStreakEndDate),
|
||||||
|
'longestOfflineStreak': longestOfflineStreak,
|
||||||
|
'offlineStreakStartDateUtc': _toUtcTimestamp(offlineStreakStartDate),
|
||||||
|
'offlineStreakEndDateUtc': _toUtcTimestamp(offlineStreakEndDate),
|
||||||
|
|
||||||
|
// 详细数据
|
||||||
|
'vehiclePilotedDetails': vehiclePilotedDetails,
|
||||||
|
'accountSessionDetails': accountSessionDetails,
|
||||||
|
'locationDetails': locationDetails,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return '''YearlyReportData(
|
||||||
|
totalLaunchCount: $totalLaunchCount,
|
||||||
|
totalPlayTime: $totalPlayTime,
|
||||||
|
yearlyLaunchCount: $yearlyLaunchCount,
|
||||||
|
yearlyPlayTime: $yearlyPlayTime,
|
||||||
|
totalCrashCount: $totalCrashCount,
|
||||||
|
yearlyCrashCount: $yearlyCrashCount,
|
||||||
|
yearlyFirstLaunchTime: $yearlyFirstLaunchTime,
|
||||||
|
earliestPlayDate: $earliestPlayDate,
|
||||||
|
latestPlayDate: $latestPlayDate,
|
||||||
|
longestSession: $longestSession (on $longestSessionDate),
|
||||||
|
shortestSession: $shortestSession (on $shortestSessionDate),
|
||||||
|
averageSessionTime: $averageSessionTime,
|
||||||
|
yearlyVehicleDestructionCount: $yearlyVehicleDestructionCount,
|
||||||
|
mostDestroyedVehicle: $mostDestroyedVehicle ($mostDestroyedVehicleCount),
|
||||||
|
mostPilotedVehicle: $mostPilotedVehicle ($mostPilotedVehicleCount),
|
||||||
|
accountCount: $accountCount,
|
||||||
|
mostPlayedAccount: $mostPlayedAccount ($mostPlayedAccountSessionCount),
|
||||||
|
topLocations: ${topLocations.take(5).map((e) => '${e.key}: ${e.value}').join(', ')},
|
||||||
|
)''';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 单个日志文件的统计结果 (内部使用)
|
||||||
|
class _LogFileStats {
|
||||||
|
DateTime? startTime;
|
||||||
|
DateTime? endTime;
|
||||||
|
bool hasCrash = false;
|
||||||
|
int killCount = 0;
|
||||||
|
int deathCount = 0;
|
||||||
|
int selfKillCount = 0;
|
||||||
|
Set<String> playerNames = {};
|
||||||
|
String? currentPlayerName;
|
||||||
|
String? firstPlayerName; // 第一个检测到的玩家名,用于去重
|
||||||
|
|
||||||
|
// 载具损毁: 载具型号 (去除ID后) -> 次数
|
||||||
|
Map<String, int> vehicleDestruction = {};
|
||||||
|
|
||||||
|
// 驾驶载具: 载具型号 (去除ID后) -> 次数
|
||||||
|
Map<String, int> vehiclePiloted = {};
|
||||||
|
|
||||||
|
// 地点访问: 地点名 -> 次数
|
||||||
|
Map<String, int> locationVisits = {};
|
||||||
|
|
||||||
|
// 上次记录死亡的时间 (用于 2s 内去重)
|
||||||
|
DateTime? _lastDeathTime;
|
||||||
|
|
||||||
|
// 年度内的会话记录
|
||||||
|
List<_SessionInfo> yearlySessions = [];
|
||||||
|
|
||||||
|
/// 生成用于去重的唯一标识
|
||||||
|
/// 基于启动时间和第一个玩家名生成
|
||||||
|
String? get uniqueKey {
|
||||||
|
if (startTime == null) return null;
|
||||||
|
final timeKey = startTime!.toUtc().toIso8601String();
|
||||||
|
final playerKey = firstPlayerName ?? 'unknown';
|
||||||
|
return '$timeKey|$playerKey';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 单次游玩会话信息
|
||||||
|
class _SessionInfo {
|
||||||
|
final DateTime startTime;
|
||||||
|
final DateTime endTime;
|
||||||
|
|
||||||
|
_SessionInfo({required this.startTime, required this.endTime});
|
||||||
|
|
||||||
|
Duration get duration => endTime.difference(startTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 年度报告分析器
|
||||||
|
class YearlyReportAnalyzer {
|
||||||
|
static final _characterNamePattern = RegExp(r'name\s+([^-]+)');
|
||||||
|
static final _vehicleDestructionPattern = RegExp(
|
||||||
|
r"Vehicle\s+'([^']+)'.*?" // 载具型号
|
||||||
|
r"in zone\s+'([^']+)'.*?" // Zone
|
||||||
|
r"destroy level \d+ to (\d+).*?" // 损毁等级
|
||||||
|
r"caused by\s+'([^']+)'", // 责任方
|
||||||
|
);
|
||||||
|
static final _actorDeathPattern = RegExp(
|
||||||
|
r"Actor '([^']+)'.*?" // 受害者ID
|
||||||
|
r"ejected from zone '([^']+)'.*?" // 原载具/区域
|
||||||
|
r"to zone '([^']+)'", // 目标区域
|
||||||
|
);
|
||||||
|
|
||||||
|
// Legacy 格式的正则表达式 (旧版日志)
|
||||||
|
static final _legacyActorDeathPattern = RegExp(
|
||||||
|
r"CActor::Kill: '([^']+)'.*?" // 受害者ID
|
||||||
|
r"in zone '([^']+)'.*?" // 死亡位置区域
|
||||||
|
r"killed by '([^']+)'.*?" // 击杀者ID
|
||||||
|
r"with damage type '([^']+)'", // 伤害类型
|
||||||
|
);
|
||||||
|
static final _requestLocationInventoryPattern = RegExp(r"Player\[([^\]]+)\].*?Location\[([^\]]+)\]");
|
||||||
|
|
||||||
|
/// 分析单个日志文件
|
||||||
|
static Future<_LogFileStats> _analyzeLogFile(File logFile, int targetYear) async {
|
||||||
|
final stats = _LogFileStats();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!(await logFile.exists())) {
|
||||||
|
return stats;
|
||||||
|
}
|
||||||
|
|
||||||
|
final content = utf8.decode(await logFile.readAsBytes(), allowMalformed: true);
|
||||||
|
final lines = content.split('\n');
|
||||||
|
|
||||||
|
for (final line in lines) {
|
||||||
|
if (line.isEmpty) continue;
|
||||||
|
|
||||||
|
final lineTime = GameLogAnalyzer.getLogLineDateTime(line);
|
||||||
|
|
||||||
|
// 记录开始时间 (第一个有效时间)
|
||||||
|
if (stats.startTime == null && lineTime != null) {
|
||||||
|
stats.startTime = lineTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新结束时间 (最后一个有效时间)
|
||||||
|
if (lineTime != null) {
|
||||||
|
stats.endTime = lineTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测崩溃
|
||||||
|
if (line.contains("Cloud Imperium Games public crash handler")) {
|
||||||
|
stats.hasCrash = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测玩家登录
|
||||||
|
if (line.contains('AccountLoginCharacterStatus_Character')) {
|
||||||
|
final nameMatch = _characterNamePattern.firstMatch(line);
|
||||||
|
if (nameMatch != null) {
|
||||||
|
final playerName = nameMatch.group(1)?.trim();
|
||||||
|
if (playerName != null &&
|
||||||
|
playerName.isNotEmpty &&
|
||||||
|
!playerName.contains(' ') &&
|
||||||
|
!playerName.contains('/') &&
|
||||||
|
!playerName.contains(r'\\') &&
|
||||||
|
!playerName.contains('.')) {
|
||||||
|
stats.currentPlayerName = playerName;
|
||||||
|
// 去重添加到玩家列表 (忽略大小写)
|
||||||
|
if (!stats.playerNames.any((n) => n.toLowerCase() == playerName.toLowerCase())) {
|
||||||
|
stats.playerNames.add(playerName);
|
||||||
|
}
|
||||||
|
stats.firstPlayerName ??= playerName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 年度内的统计
|
||||||
|
if (lineTime != null && lineTime.year == targetYear) {
|
||||||
|
// 检测载具损毁
|
||||||
|
final destructionMatch = _vehicleDestructionPattern.firstMatch(line);
|
||||||
|
if (destructionMatch != null) {
|
||||||
|
final vehicleModel = destructionMatch.group(1);
|
||||||
|
final causedBy = destructionMatch.group(4)?.trim();
|
||||||
|
|
||||||
|
if (vehicleModel != null &&
|
||||||
|
causedBy != null &&
|
||||||
|
stats.currentPlayerName != null &&
|
||||||
|
causedBy == stats.currentPlayerName) {
|
||||||
|
final cleanVehicleName = GameLogAnalyzer.removeVehicleId(vehicleModel);
|
||||||
|
stats.vehicleDestruction[cleanVehicleName] = (stats.vehicleDestruction[cleanVehicleName] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测驾驶载具
|
||||||
|
final controlMatch = GameLogAnalyzer.vehicleControlPattern.firstMatch(line);
|
||||||
|
if (controlMatch != null) {
|
||||||
|
final vehicleName = controlMatch.group(1);
|
||||||
|
if (vehicleName != null) {
|
||||||
|
final cleanVehicleName = GameLogAnalyzer.removeVehicleId(vehicleName);
|
||||||
|
// 过滤掉名为 "Default" 的载具
|
||||||
|
if (cleanVehicleName != 'Default') {
|
||||||
|
stats.vehiclePiloted[cleanVehicleName] = (stats.vehiclePiloted[cleanVehicleName] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测死亡 (新版格式)
|
||||||
|
var deathMatch = _actorDeathPattern.firstMatch(line);
|
||||||
|
if (deathMatch != null) {
|
||||||
|
final victimId = deathMatch.group(1)?.trim();
|
||||||
|
if (victimId != null && stats.currentPlayerName != null && victimId == stats.currentPlayerName) {
|
||||||
|
// 防抖去重 (2秒内不重复计数)
|
||||||
|
if (stats._lastDeathTime == null || lineTime.difference(stats._lastDeathTime!).abs().inSeconds > 2) {
|
||||||
|
stats.deathCount++;
|
||||||
|
stats._lastDeathTime = lineTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测死亡 (旧版格式 - Legacy)
|
||||||
|
final legacyDeathMatch = _legacyActorDeathPattern.firstMatch(line);
|
||||||
|
if (legacyDeathMatch != null) {
|
||||||
|
final victimId = legacyDeathMatch.group(1)?.trim();
|
||||||
|
final killerId = legacyDeathMatch.group(3)?.trim();
|
||||||
|
|
||||||
|
if (victimId != null && stats.currentPlayerName != null) {
|
||||||
|
bool isRecent =
|
||||||
|
stats._lastDeathTime != null && lineTime.difference(stats._lastDeathTime!).abs().inSeconds <= 2;
|
||||||
|
|
||||||
|
// 检测自杀
|
||||||
|
// 自杀逻辑:selfKillCount 独立统计自杀次数
|
||||||
|
// deathCount 包含所有死亡(普通死亡+自杀),因此自杀时不再从 deathCount 回退
|
||||||
|
if (victimId == killerId) {
|
||||||
|
if (victimId == stats.currentPlayerName) {
|
||||||
|
if (isRecent) {
|
||||||
|
// 如果最近已经记录过一次死亡 (通用格式记录的),说明已经在 deathCount 中计入
|
||||||
|
// 只需额外标记为自杀
|
||||||
|
stats.selfKillCount++;
|
||||||
|
// 更新时间以保持锁定
|
||||||
|
stats._lastDeathTime = lineTime;
|
||||||
|
} else {
|
||||||
|
// 没有被新版格式记录过,需要同时计入 deathCount 和 selfKillCount
|
||||||
|
stats.deathCount++;
|
||||||
|
stats.selfKillCount++;
|
||||||
|
stats._lastDeathTime = lineTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 检测死亡 (被击杀)
|
||||||
|
if (victimId == stats.currentPlayerName) {
|
||||||
|
// 如果最近已经记录过 (可能是通用格式),则认为是同一事件,忽略
|
||||||
|
if (!isRecent) {
|
||||||
|
stats.deathCount++;
|
||||||
|
stats._lastDeathTime = lineTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 检测击杀 (杀别人)
|
||||||
|
if (killerId == stats.currentPlayerName) {
|
||||||
|
stats.killCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测地点访问 (RequestLocationInventory)
|
||||||
|
final locationMatch = _requestLocationInventoryPattern.firstMatch(line);
|
||||||
|
if (locationMatch != null) {
|
||||||
|
final location = locationMatch.group(2)?.trim();
|
||||||
|
if (location != null && location.isNotEmpty) {
|
||||||
|
// 清理地点名称,移除数字ID后缀
|
||||||
|
final cleanLocation = _cleanLocationName(location);
|
||||||
|
stats.locationVisits[cleanLocation] = (stats.locationVisits[cleanLocation] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录会话信息
|
||||||
|
if (stats.startTime != null && stats.endTime != null && stats.startTime!.year == targetYear) {
|
||||||
|
stats.yearlySessions.add(_SessionInfo(startTime: stats.startTime!, endTime: stats.endTime!));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Error handled silently in isolate
|
||||||
|
}
|
||||||
|
|
||||||
|
return stats;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 清理地点名称,移除数字ID后缀
|
||||||
|
static String _cleanLocationName(String location) {
|
||||||
|
// 移除末尾的数字ID (如 "_12345678")
|
||||||
|
final cleanPattern = RegExp(r'_\d{6,}$');
|
||||||
|
return location.replaceAll(cleanPattern, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 生成年度报告
|
||||||
|
///
|
||||||
|
/// [gameInstallPaths] 游戏安装路径列表 (完整路径,如 ["D:/Games/StarCitizen/LIVE", "D:/Games/StarCitizen/PTU"])
|
||||||
|
/// [targetYear] 目标年份
|
||||||
|
///
|
||||||
|
/// 该方法在独立 Isolate 中运行,避免阻塞 UI
|
||||||
|
static Future<YearlyReportData> generateReport(List<String> gameInstallPaths, int targetYear) async {
|
||||||
|
// 在独立 Isolate 中运行以避免阻塞 UI
|
||||||
|
return await Isolate.run(() async {
|
||||||
|
return await _generateReportInIsolate(gameInstallPaths, targetYear);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 内部方法:在 Isolate 中执行的报告生成逻辑
|
||||||
|
static Future<YearlyReportData> _generateReportInIsolate(List<String> gameInstallPaths, int targetYear) async {
|
||||||
|
final List<File> allLogFiles = [];
|
||||||
|
|
||||||
|
// 从所有安装路径收集日志文件
|
||||||
|
for (final installPath in gameInstallPaths) {
|
||||||
|
try {
|
||||||
|
final installDir = Directory(installPath);
|
||||||
|
|
||||||
|
// 检查安装目录是否存在
|
||||||
|
if (!await installDir.exists()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final gameLogFile = File('$installPath/Game.log');
|
||||||
|
final logBackupsDir = Directory('$installPath/logbackups');
|
||||||
|
|
||||||
|
// 添加当前 Game.log
|
||||||
|
try {
|
||||||
|
if (await gameLogFile.exists()) {
|
||||||
|
allLogFiles.add(gameLogFile);
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// 忽略单个文件检查错误
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加备份日志
|
||||||
|
try {
|
||||||
|
if (await logBackupsDir.exists()) {
|
||||||
|
await for (final entity in logBackupsDir.list()) {
|
||||||
|
if (entity is File && entity.path.endsWith('.log')) {
|
||||||
|
allLogFiles.add(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// 忽略备份目录读取错误
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// 忽略单个安装路径的错误,继续处理其他路径
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 并发分析所有日志文件,使用错误处理确保单个文件失败不影响其他文件
|
||||||
|
final futures = allLogFiles.map((file) async {
|
||||||
|
try {
|
||||||
|
return await _analyzeLogFile(file, targetYear);
|
||||||
|
} catch (_) {
|
||||||
|
// 单个文件分析失败时返回空的统计数据
|
||||||
|
return _LogFileStats();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
final allStatsRaw = await Future.wait(futures);
|
||||||
|
|
||||||
|
// 去重: 使用 uniqueKey (启动时间 + 玩家名) 来过滤重复的日志
|
||||||
|
final seenKeys = <String>{};
|
||||||
|
final allStats = <_LogFileStats>[];
|
||||||
|
|
||||||
|
for (final stats in allStatsRaw) {
|
||||||
|
final key = stats.uniqueKey;
|
||||||
|
if (key == null) {
|
||||||
|
allStats.add(stats);
|
||||||
|
} else if (!seenKeys.contains(key)) {
|
||||||
|
seenKeys.add(key);
|
||||||
|
allStats.add(stats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并统计数据
|
||||||
|
int totalLaunchCount = allStats.length;
|
||||||
|
Duration totalPlayTime = Duration.zero;
|
||||||
|
int yearlyLaunchCount = 0;
|
||||||
|
Duration yearlyPlayTime = Duration.zero;
|
||||||
|
int totalCrashCount = 0;
|
||||||
|
int yearlyCrashCount = 0;
|
||||||
|
DateTime? yearlyFirstLaunchTime;
|
||||||
|
DateTime? earliestPlayDate;
|
||||||
|
DateTime? latestPlayDate;
|
||||||
|
|
||||||
|
// 会话时长统计
|
||||||
|
Duration? longestSession;
|
||||||
|
DateTime? longestSessionDate;
|
||||||
|
Duration? shortestSession;
|
||||||
|
DateTime? shortestSessionDate;
|
||||||
|
List<Duration> allSessionDurations = [];
|
||||||
|
|
||||||
|
// K/D 统计
|
||||||
|
int yearlyKillCount = 0;
|
||||||
|
int yearlyDeathCount = 0;
|
||||||
|
int yearlySelfKillCount = 0;
|
||||||
|
|
||||||
|
final Map<String, int> vehicleDestructionDetails = {};
|
||||||
|
final Map<String, int> vehiclePilotedDetails = {};
|
||||||
|
final Map<String, int> accountSessionDetails = {};
|
||||||
|
final Map<String, int> locationDetails = {};
|
||||||
|
|
||||||
|
for (final stats in allStats) {
|
||||||
|
// 累计游玩时长
|
||||||
|
if (stats.startTime != null && stats.endTime != null) {
|
||||||
|
totalPlayTime += stats.endTime!.difference(stats.startTime!);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 崩溃统计
|
||||||
|
if (stats.hasCrash) {
|
||||||
|
totalCrashCount++;
|
||||||
|
if (stats.endTime != null && stats.endTime!.year == targetYear) {
|
||||||
|
yearlyCrashCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 年度会话统计
|
||||||
|
for (final session in stats.yearlySessions) {
|
||||||
|
yearlyLaunchCount++;
|
||||||
|
final sessionDuration = session.duration;
|
||||||
|
yearlyPlayTime += sessionDuration;
|
||||||
|
allSessionDurations.add(sessionDuration);
|
||||||
|
|
||||||
|
// 年度第一次启动时间
|
||||||
|
if (yearlyFirstLaunchTime == null || session.startTime.isBefore(yearlyFirstLaunchTime)) {
|
||||||
|
yearlyFirstLaunchTime = session.startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最早游玩的一天 (05:00及以后开始游戏)
|
||||||
|
if (session.startTime.hour >= 5) {
|
||||||
|
if (earliestPlayDate == null || _timeOfDayIsEarlier(session.startTime, earliestPlayDate)) {
|
||||||
|
earliestPlayDate = session.startTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最晚游玩的一天 (04:00及以前结束游戏)
|
||||||
|
if (session.endTime.hour <= 4) {
|
||||||
|
if (latestPlayDate == null || _timeOfDayIsLater(session.endTime, latestPlayDate)) {
|
||||||
|
latestPlayDate = session.endTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最长游玩时长
|
||||||
|
if (longestSession == null || sessionDuration > longestSession) {
|
||||||
|
longestSession = sessionDuration;
|
||||||
|
longestSessionDate = session.startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 最短游玩时长 (超过5分钟的)
|
||||||
|
if (sessionDuration.inMinutes >= 5) {
|
||||||
|
if (shortestSession == null || sessionDuration < shortestSession) {
|
||||||
|
shortestSession = sessionDuration;
|
||||||
|
shortestSessionDate = session.startTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并载具损毁详情 (过滤包含 PU 的载具)
|
||||||
|
for (final entry in stats.vehicleDestruction.entries) {
|
||||||
|
if (!entry.key.contains('PU_')) {
|
||||||
|
vehicleDestructionDetails[entry.key] = (vehicleDestructionDetails[entry.key] ?? 0) + entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并驾驶载具详情
|
||||||
|
for (final entry in stats.vehiclePiloted.entries) {
|
||||||
|
vehiclePilotedDetails[entry.key] = (vehiclePilotedDetails[entry.key] ?? 0) + entry.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 累计 K/D
|
||||||
|
yearlyKillCount += stats.killCount;
|
||||||
|
yearlyDeathCount += stats.deathCount;
|
||||||
|
yearlySelfKillCount += stats.selfKillCount;
|
||||||
|
|
||||||
|
// 合并账号会话详情
|
||||||
|
for (final playerName in stats.playerNames) {
|
||||||
|
if (playerName.length > 16) continue;
|
||||||
|
String targetKey = playerName;
|
||||||
|
// 查找是否存在忽略大小写的相同 key
|
||||||
|
for (final key in accountSessionDetails.keys) {
|
||||||
|
if (key.toLowerCase() == playerName.toLowerCase()) {
|
||||||
|
targetKey = key;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
accountSessionDetails[targetKey] = (accountSessionDetails[targetKey] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并地点访问详情
|
||||||
|
for (final entry in stats.locationVisits.entries) {
|
||||||
|
locationDetails[entry.key] = (locationDetails[entry.key] ?? 0) + entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算平均游玩时长
|
||||||
|
Duration? averageSessionTime;
|
||||||
|
if (allSessionDurations.isNotEmpty) {
|
||||||
|
final totalMs = allSessionDurations.fold<int>(0, (sum, d) => sum + d.inMilliseconds);
|
||||||
|
averageSessionTime = Duration(milliseconds: totalMs ~/ allSessionDurations.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算派生统计
|
||||||
|
final yearlyVehicleDestructionCount = vehicleDestructionDetails.values.fold(0, (a, b) => a + b);
|
||||||
|
|
||||||
|
String? mostDestroyedVehicle;
|
||||||
|
int mostDestroyedVehicleCount = 0;
|
||||||
|
for (final entry in vehicleDestructionDetails.entries) {
|
||||||
|
if (entry.value > mostDestroyedVehicleCount) {
|
||||||
|
mostDestroyedVehicle = entry.key;
|
||||||
|
mostDestroyedVehicleCount = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String? mostPilotedVehicle;
|
||||||
|
int mostPilotedVehicleCount = 0;
|
||||||
|
for (final entry in vehiclePilotedDetails.entries) {
|
||||||
|
if (entry.value > mostPilotedVehicleCount) {
|
||||||
|
mostPilotedVehicle = entry.key;
|
||||||
|
mostPilotedVehicleCount = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String? mostPlayedAccount;
|
||||||
|
int mostPlayedAccountSessionCount = 0;
|
||||||
|
for (final entry in accountSessionDetails.entries) {
|
||||||
|
if (entry.value > mostPlayedAccountSessionCount) {
|
||||||
|
mostPlayedAccount = entry.key;
|
||||||
|
mostPlayedAccountSessionCount = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算 Top 10 地点
|
||||||
|
final sortedLocations = locationDetails.entries.toList()..sort((a, b) => b.value.compareTo(a.value));
|
||||||
|
final topLocations = sortedLocations.take(10).toList();
|
||||||
|
|
||||||
|
// 计算月份统计
|
||||||
|
final Map<int, int> monthlyPlayCount = {};
|
||||||
|
final Set<DateTime> playDates = {}; // 所有游玩的日期 (仅日期部分)
|
||||||
|
|
||||||
|
for (final stats in allStats) {
|
||||||
|
for (final session in stats.yearlySessions) {
|
||||||
|
final month = session.startTime.month;
|
||||||
|
monthlyPlayCount[month] = (monthlyPlayCount[month] ?? 0) + 1;
|
||||||
|
// 记录游玩日期 (只保留年月日)
|
||||||
|
playDates.add(DateTime(session.startTime.year, session.startTime.month, session.startTime.day));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int? mostPlayedMonth;
|
||||||
|
int mostPlayedMonthCount = 0;
|
||||||
|
int? leastPlayedMonth;
|
||||||
|
int leastPlayedMonthCount = 0;
|
||||||
|
|
||||||
|
if (monthlyPlayCount.isNotEmpty) {
|
||||||
|
// 最多游玩的月份
|
||||||
|
for (final entry in monthlyPlayCount.entries) {
|
||||||
|
if (entry.value > mostPlayedMonthCount) {
|
||||||
|
mostPlayedMonth = entry.key;
|
||||||
|
mostPlayedMonthCount = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 最少游玩的月份 (不包括完全没上游戏的月份)
|
||||||
|
leastPlayedMonthCount = monthlyPlayCount.values.first;
|
||||||
|
for (final entry in monthlyPlayCount.entries) {
|
||||||
|
if (entry.value <= leastPlayedMonthCount) {
|
||||||
|
leastPlayedMonth = entry.key;
|
||||||
|
leastPlayedMonthCount = entry.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算连续游玩天数和连续离线天数
|
||||||
|
int longestPlayStreak = 0;
|
||||||
|
DateTime? playStreakStartDate;
|
||||||
|
DateTime? playStreakEndDate;
|
||||||
|
int longestOfflineStreak = 0;
|
||||||
|
DateTime? offlineStreakStartDate;
|
||||||
|
DateTime? offlineStreakEndDate;
|
||||||
|
|
||||||
|
if (playDates.isNotEmpty) {
|
||||||
|
// 将日期排序
|
||||||
|
final sortedDates = playDates.toList()..sort();
|
||||||
|
|
||||||
|
// 计算连续游玩天数
|
||||||
|
int currentStreak = 1;
|
||||||
|
DateTime streakStart = sortedDates.first;
|
||||||
|
|
||||||
|
for (int i = 1; i < sortedDates.length; i++) {
|
||||||
|
final diff = sortedDates[i].difference(sortedDates[i - 1]).inDays;
|
||||||
|
if (diff == 1) {
|
||||||
|
currentStreak++;
|
||||||
|
} else {
|
||||||
|
if (currentStreak > longestPlayStreak) {
|
||||||
|
longestPlayStreak = currentStreak;
|
||||||
|
playStreakStartDate = streakStart;
|
||||||
|
playStreakEndDate = sortedDates[i - 1];
|
||||||
|
}
|
||||||
|
currentStreak = 1;
|
||||||
|
streakStart = sortedDates[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 检查最后一段连续
|
||||||
|
if (currentStreak > longestPlayStreak) {
|
||||||
|
longestPlayStreak = currentStreak;
|
||||||
|
playStreakStartDate = streakStart;
|
||||||
|
playStreakEndDate = sortedDates.last;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算连续离线天数 (在游玩日期之间的间隔)
|
||||||
|
for (int i = 1; i < sortedDates.length; i++) {
|
||||||
|
final gapDays = sortedDates[i].difference(sortedDates[i - 1]).inDays - 1;
|
||||||
|
if (gapDays > longestOfflineStreak) {
|
||||||
|
longestOfflineStreak = gapDays;
|
||||||
|
offlineStreakStartDate = sortedDates[i - 1].add(const Duration(days: 1));
|
||||||
|
offlineStreakEndDate = sortedDates[i].subtract(const Duration(days: 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return YearlyReportData(
|
||||||
|
totalLaunchCount: totalLaunchCount,
|
||||||
|
totalPlayTime: totalPlayTime,
|
||||||
|
yearlyLaunchCount: yearlyLaunchCount,
|
||||||
|
yearlyPlayTime: yearlyPlayTime,
|
||||||
|
totalCrashCount: totalCrashCount,
|
||||||
|
yearlyCrashCount: yearlyCrashCount,
|
||||||
|
yearlyFirstLaunchTime: yearlyFirstLaunchTime,
|
||||||
|
earliestPlayDate: earliestPlayDate,
|
||||||
|
latestPlayDate: latestPlayDate,
|
||||||
|
longestSession: longestSession,
|
||||||
|
longestSessionDate: longestSessionDate,
|
||||||
|
shortestSession: shortestSession,
|
||||||
|
shortestSessionDate: shortestSessionDate,
|
||||||
|
averageSessionTime: averageSessionTime,
|
||||||
|
yearlyVehicleDestructionCount: yearlyVehicleDestructionCount,
|
||||||
|
mostDestroyedVehicle: mostDestroyedVehicle,
|
||||||
|
mostDestroyedVehicleCount: mostDestroyedVehicleCount,
|
||||||
|
mostPilotedVehicle: mostPilotedVehicle,
|
||||||
|
mostPilotedVehicleCount: mostPilotedVehicleCount,
|
||||||
|
accountCount: accountSessionDetails.length,
|
||||||
|
mostPlayedAccount: mostPlayedAccount,
|
||||||
|
mostPlayedAccountSessionCount: mostPlayedAccountSessionCount,
|
||||||
|
topLocations: topLocations,
|
||||||
|
yearlyKillCount: yearlyKillCount,
|
||||||
|
yearlyDeathCount: yearlyDeathCount,
|
||||||
|
yearlySelfKillCount: yearlySelfKillCount,
|
||||||
|
mostPlayedMonth: mostPlayedMonth,
|
||||||
|
mostPlayedMonthCount: mostPlayedMonthCount,
|
||||||
|
leastPlayedMonth: leastPlayedMonth,
|
||||||
|
leastPlayedMonthCount: leastPlayedMonthCount,
|
||||||
|
longestPlayStreak: longestPlayStreak,
|
||||||
|
playStreakStartDate: playStreakStartDate,
|
||||||
|
playStreakEndDate: playStreakEndDate,
|
||||||
|
longestOfflineStreak: longestOfflineStreak,
|
||||||
|
offlineStreakStartDate: offlineStreakStartDate,
|
||||||
|
offlineStreakEndDate: offlineStreakEndDate,
|
||||||
|
vehiclePilotedDetails: vehiclePilotedDetails,
|
||||||
|
accountSessionDetails: accountSessionDetails,
|
||||||
|
locationDetails: locationDetails,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 比较两个时间的 时:分 是否更早
|
||||||
|
static bool _timeOfDayIsEarlier(DateTime a, DateTime b) {
|
||||||
|
if (a.hour < b.hour) return true;
|
||||||
|
if (a.hour > b.hour) return false;
|
||||||
|
return a.minute < b.minute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 比较两个时间的 时:分 是否更晚
|
||||||
|
static bool _timeOfDayIsLater(DateTime a, DateTime b) {
|
||||||
|
if (a.hour > b.hour) return true;
|
||||||
|
if (a.hour < b.hour) return false;
|
||||||
|
return a.minute > b.minute;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,7 +7,7 @@ import 'package:starcitizen_doctor/common/rust/api/http_api.dart';
|
|||||||
import 'package:starcitizen_doctor/common/rust/http_package.dart';
|
import 'package:starcitizen_doctor/common/rust/http_package.dart';
|
||||||
|
|
||||||
class RSHttp {
|
class RSHttp {
|
||||||
static init() async {
|
static Future<void> init() async {
|
||||||
await rust_http.setDefaultHeader(headers: {
|
await rust_http.setDefaultHeader(headers: {
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"SCToolBox/${ConstConf.appVersion} (${ConstConf.appVersionCode})${ConstConf.isMSE ? "" : " DEV"} RSHttp"
|
"SCToolBox/${ConstConf.appVersion} (${ConstConf.appVersionCode})${ConstConf.isMSE ? "" : " DEV"} RSHttp"
|
||||||
|
|||||||
68
lib/common/rust/api/applinks_api.dart
Normal file
68
lib/common/rust/api/applinks_api.dart
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// This file is automatically generated, so please do not edit it.
|
||||||
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
|
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`
|
||||||
|
|
||||||
|
/// Check if the URL scheme is already registered with the correct executable path
|
||||||
|
Future<ApplinksRegistrationResult> checkApplinksRegistration({
|
||||||
|
required String scheme,
|
||||||
|
}) => RustLib.instance.api.crateApiApplinksApiCheckApplinksRegistration(
|
||||||
|
scheme: scheme,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Register URL scheme in Windows registry
|
||||||
|
/// This will create or update the registry keys for the custom URL scheme
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `scheme` - The URL scheme to register (e.g., "sctoolbox")
|
||||||
|
/// * `app_name` - Optional application display name (e.g., "SCToolBox"). If provided,
|
||||||
|
/// the registry will show "URL:{app_name} Protocol" as the scheme description.
|
||||||
|
Future<ApplinksRegistrationResult> registerApplinks({
|
||||||
|
required String scheme,
|
||||||
|
String? appName,
|
||||||
|
}) => RustLib.instance.api.crateApiApplinksApiRegisterApplinks(
|
||||||
|
scheme: scheme,
|
||||||
|
appName: appName,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Unregister URL scheme from Windows registry
|
||||||
|
Future<ApplinksRegistrationResult> unregisterApplinks({
|
||||||
|
required String scheme,
|
||||||
|
}) =>
|
||||||
|
RustLib.instance.api.crateApiApplinksApiUnregisterApplinks(scheme: scheme);
|
||||||
|
|
||||||
|
/// Applinks URL scheme registration result
|
||||||
|
class ApplinksRegistrationResult {
|
||||||
|
/// Whether registration was successful
|
||||||
|
final bool success;
|
||||||
|
|
||||||
|
/// Detailed message about the operation
|
||||||
|
final String message;
|
||||||
|
|
||||||
|
/// Whether the registry was modified (false if already configured correctly)
|
||||||
|
final bool wasModified;
|
||||||
|
|
||||||
|
const ApplinksRegistrationResult({
|
||||||
|
required this.success,
|
||||||
|
required this.message,
|
||||||
|
required this.wasModified,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
success.hashCode ^ message.hashCode ^ wasModified.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ApplinksRegistrationResult &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
success == other.success &&
|
||||||
|
message == other.message &&
|
||||||
|
wasModified == other.wasModified;
|
||||||
|
}
|
||||||
@ -1,15 +1,16 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.9.0.
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import '../frb_generated.dart';
|
import '../frb_generated.dart';
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
Future<RsiLauncherAsarData> getRsiLauncherAsarData(
|
Future<RsiLauncherAsarData> getRsiLauncherAsarData({
|
||||||
{required String asarPath}) =>
|
required String asarPath,
|
||||||
RustLib.instance.api
|
}) => RustLib.instance.api.crateApiAsarApiGetRsiLauncherAsarData(
|
||||||
.crateApiAsarApiGetRsiLauncherAsarData(asarPath: asarPath);
|
asarPath: asarPath,
|
||||||
|
);
|
||||||
|
|
||||||
class RsiLauncherAsarData {
|
class RsiLauncherAsarData {
|
||||||
final String asarPath;
|
final String asarPath;
|
||||||
@ -24,7 +25,9 @@ class RsiLauncherAsarData {
|
|||||||
|
|
||||||
Future<void> writeMainJs({required List<int> content}) =>
|
Future<void> writeMainJs({required List<int> content}) =>
|
||||||
RustLib.instance.api.crateApiAsarApiRsiLauncherAsarDataWriteMainJs(
|
RustLib.instance.api.crateApiAsarApiRsiLauncherAsarDataWriteMainJs(
|
||||||
that: this, content: content);
|
that: this,
|
||||||
|
content: content,
|
||||||
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
|
|||||||
284
lib/common/rust/api/downloader_api.dart
Normal file
284
lib/common/rust/api/downloader_api.dart
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
// This file is automatically generated, so please do not edit it.
|
||||||
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
|
// These functions are ignored because they are not marked as `pub`: `get_session`, `get_task_status`
|
||||||
|
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `eq`, `fmt`, `fmt`, `fmt`
|
||||||
|
|
||||||
|
/// Initialize the download manager session with persistence enabled
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
/// - working_dir: The directory to store session data (persistence, DHT, etc.)
|
||||||
|
/// - default_download_dir: The default directory to store downloads
|
||||||
|
/// - upload_limit_bps: Upload speed limit in bytes per second (0 = unlimited)
|
||||||
|
/// - download_limit_bps: Download speed limit in bytes per second (0 = unlimited)
|
||||||
|
Future<void> downloaderInit({
|
||||||
|
required String workingDir,
|
||||||
|
required String defaultDownloadDir,
|
||||||
|
int? uploadLimitBps,
|
||||||
|
int? downloadLimitBps,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderInit(
|
||||||
|
workingDir: workingDir,
|
||||||
|
defaultDownloadDir: defaultDownloadDir,
|
||||||
|
uploadLimitBps: uploadLimitBps,
|
||||||
|
downloadLimitBps: downloadLimitBps,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Check if the downloader is initialized
|
||||||
|
bool downloaderIsInitialized() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderIsInitialized();
|
||||||
|
|
||||||
|
/// Check if there are pending tasks to restore from session file (without starting the downloader)
|
||||||
|
/// This reads the session.json file directly to check if there are any torrents saved.
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
/// - working_dir: The directory where session data is stored (same as passed to downloader_init)
|
||||||
|
///
|
||||||
|
/// Returns: true if there are tasks to restore, false otherwise
|
||||||
|
bool downloaderHasPendingSessionTasks({required String workingDir}) =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderHasPendingSessionTasks(
|
||||||
|
workingDir: workingDir,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Add a torrent from bytes (e.g., .torrent file content)
|
||||||
|
Future<BigInt> downloaderAddTorrent({
|
||||||
|
required List<int> torrentBytes,
|
||||||
|
String? outputFolder,
|
||||||
|
List<String>? trackers,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddTorrent(
|
||||||
|
torrentBytes: torrentBytes,
|
||||||
|
outputFolder: outputFolder,
|
||||||
|
trackers: trackers,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Add a torrent from a magnet link
|
||||||
|
Future<BigInt> downloaderAddMagnet({
|
||||||
|
required String magnetLink,
|
||||||
|
String? outputFolder,
|
||||||
|
List<String>? trackers,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddMagnet(
|
||||||
|
magnetLink: magnetLink,
|
||||||
|
outputFolder: outputFolder,
|
||||||
|
trackers: trackers,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Add a torrent from URL (HTTP download not supported, only torrent file URLs)
|
||||||
|
Future<BigInt> downloaderAddUrl({
|
||||||
|
required String url,
|
||||||
|
String? outputFolder,
|
||||||
|
List<String>? trackers,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderAddUrl(
|
||||||
|
url: url,
|
||||||
|
outputFolder: outputFolder,
|
||||||
|
trackers: trackers,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Pause a download task
|
||||||
|
Future<void> downloaderPause({required BigInt taskId}) =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderPause(taskId: taskId);
|
||||||
|
|
||||||
|
/// Resume a download task
|
||||||
|
Future<void> downloaderResume({required BigInt taskId}) =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderResume(taskId: taskId);
|
||||||
|
|
||||||
|
/// Remove a download task
|
||||||
|
/// Handles both active tasks (task_id < 10000) and cached completed tasks (task_id >= 10000)
|
||||||
|
Future<void> downloaderRemove({
|
||||||
|
required BigInt taskId,
|
||||||
|
required bool deleteFiles,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderRemove(
|
||||||
|
taskId: taskId,
|
||||||
|
deleteFiles: deleteFiles,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Get information about a specific task
|
||||||
|
Future<DownloadTaskInfo> downloaderGetTaskInfo({required BigInt taskId}) =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderGetTaskInfo(
|
||||||
|
taskId: taskId,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Get all tasks (includes both active and completed tasks from cache)
|
||||||
|
Future<List<DownloadTaskInfo>> downloaderGetAllTasks() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderGetAllTasks();
|
||||||
|
|
||||||
|
/// Get global statistics
|
||||||
|
Future<DownloadGlobalStat> downloaderGetGlobalStats() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderGetGlobalStats();
|
||||||
|
|
||||||
|
/// Check if a task with given name exists
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
/// - name: Task name to search for
|
||||||
|
/// - downloading_only: If true, only search in active/waiting tasks. If false, include completed tasks (default: true)
|
||||||
|
Future<bool> downloaderIsNameInTask({
|
||||||
|
required String name,
|
||||||
|
bool? downloadingOnly,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderIsNameInTask(
|
||||||
|
name: name,
|
||||||
|
downloadingOnly: downloadingOnly,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Pause all tasks
|
||||||
|
Future<void> downloaderPauseAll() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderPauseAll();
|
||||||
|
|
||||||
|
/// Resume all tasks
|
||||||
|
Future<void> downloaderResumeAll() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderResumeAll();
|
||||||
|
|
||||||
|
/// Stop the downloader session (pauses all tasks but keeps session)
|
||||||
|
Future<void> downloaderStop() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderStop();
|
||||||
|
|
||||||
|
/// Shutdown the downloader session completely (allows restart with new settings)
|
||||||
|
Future<void> downloaderShutdown() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderShutdown();
|
||||||
|
|
||||||
|
/// Get all completed tasks from cache (tasks removed by downloader_remove_completed_tasks)
|
||||||
|
/// This cache is cleared when the downloader is shutdown/restarted
|
||||||
|
List<DownloadTaskInfo> downloaderGetCompletedTasksCache() => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiDownloaderApiDownloaderGetCompletedTasksCache();
|
||||||
|
|
||||||
|
/// Clear the completed tasks cache manually
|
||||||
|
void downloaderClearCompletedTasksCache() => RustLib.instance.api
|
||||||
|
.crateApiDownloaderApiDownloaderClearCompletedTasksCache();
|
||||||
|
|
||||||
|
/// Update global speed limits
|
||||||
|
/// Note: rqbit Session doesn't support runtime limit changes,
|
||||||
|
/// this function is a placeholder that returns an error.
|
||||||
|
/// Speed limits should be set during downloader_init.
|
||||||
|
Future<void> downloaderUpdateSpeedLimits({
|
||||||
|
int? uploadLimitBps,
|
||||||
|
int? downloadLimitBps,
|
||||||
|
}) => RustLib.instance.api.crateApiDownloaderApiDownloaderUpdateSpeedLimits(
|
||||||
|
uploadLimitBps: uploadLimitBps,
|
||||||
|
downloadLimitBps: downloadLimitBps,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Remove all completed tasks (equivalent to aria2's --seed-time=0 behavior)
|
||||||
|
/// Removed tasks are cached in memory and can be queried via downloader_get_completed_tasks_cache
|
||||||
|
Future<int> downloaderRemoveCompletedTasks() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderRemoveCompletedTasks();
|
||||||
|
|
||||||
|
/// Check if there are any active (non-completed) tasks
|
||||||
|
Future<bool> downloaderHasActiveTasks() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloaderHasActiveTasks();
|
||||||
|
|
||||||
|
/// Global statistics
|
||||||
|
class DownloadGlobalStat {
|
||||||
|
final BigInt downloadSpeed;
|
||||||
|
final BigInt uploadSpeed;
|
||||||
|
final BigInt numActive;
|
||||||
|
final BigInt numWaiting;
|
||||||
|
|
||||||
|
const DownloadGlobalStat({
|
||||||
|
required this.downloadSpeed,
|
||||||
|
required this.uploadSpeed,
|
||||||
|
required this.numActive,
|
||||||
|
required this.numWaiting,
|
||||||
|
});
|
||||||
|
|
||||||
|
static Future<DownloadGlobalStat> default_() =>
|
||||||
|
RustLib.instance.api.crateApiDownloaderApiDownloadGlobalStatDefault();
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
downloadSpeed.hashCode ^
|
||||||
|
uploadSpeed.hashCode ^
|
||||||
|
numActive.hashCode ^
|
||||||
|
numWaiting.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is DownloadGlobalStat &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
downloadSpeed == other.downloadSpeed &&
|
||||||
|
uploadSpeed == other.uploadSpeed &&
|
||||||
|
numActive == other.numActive &&
|
||||||
|
numWaiting == other.numWaiting;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Download task information
|
||||||
|
class DownloadTaskInfo {
|
||||||
|
final BigInt id;
|
||||||
|
final String name;
|
||||||
|
final DownloadTaskStatus status;
|
||||||
|
final BigInt totalBytes;
|
||||||
|
final BigInt downloadedBytes;
|
||||||
|
final BigInt uploadedBytes;
|
||||||
|
final BigInt downloadSpeed;
|
||||||
|
final BigInt uploadSpeed;
|
||||||
|
final double progress;
|
||||||
|
final BigInt numPeers;
|
||||||
|
final String outputFolder;
|
||||||
|
|
||||||
|
const DownloadTaskInfo({
|
||||||
|
required this.id,
|
||||||
|
required this.name,
|
||||||
|
required this.status,
|
||||||
|
required this.totalBytes,
|
||||||
|
required this.downloadedBytes,
|
||||||
|
required this.uploadedBytes,
|
||||||
|
required this.downloadSpeed,
|
||||||
|
required this.uploadSpeed,
|
||||||
|
required this.progress,
|
||||||
|
required this.numPeers,
|
||||||
|
required this.outputFolder,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
id.hashCode ^
|
||||||
|
name.hashCode ^
|
||||||
|
status.hashCode ^
|
||||||
|
totalBytes.hashCode ^
|
||||||
|
downloadedBytes.hashCode ^
|
||||||
|
uploadedBytes.hashCode ^
|
||||||
|
downloadSpeed.hashCode ^
|
||||||
|
uploadSpeed.hashCode ^
|
||||||
|
progress.hashCode ^
|
||||||
|
numPeers.hashCode ^
|
||||||
|
outputFolder.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is DownloadTaskInfo &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
id == other.id &&
|
||||||
|
name == other.name &&
|
||||||
|
status == other.status &&
|
||||||
|
totalBytes == other.totalBytes &&
|
||||||
|
downloadedBytes == other.downloadedBytes &&
|
||||||
|
uploadedBytes == other.uploadedBytes &&
|
||||||
|
downloadSpeed == other.downloadSpeed &&
|
||||||
|
uploadSpeed == other.uploadSpeed &&
|
||||||
|
progress == other.progress &&
|
||||||
|
numPeers == other.numPeers &&
|
||||||
|
outputFolder == other.outputFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Download task status
|
||||||
|
enum DownloadTaskStatus {
|
||||||
|
/// Checking/verifying existing files
|
||||||
|
checking,
|
||||||
|
|
||||||
|
/// Actively downloading
|
||||||
|
live,
|
||||||
|
|
||||||
|
/// Paused
|
||||||
|
paused,
|
||||||
|
|
||||||
|
/// Error occurred
|
||||||
|
error,
|
||||||
|
|
||||||
|
/// Download completed
|
||||||
|
finished,
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.9.0.
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
@ -12,20 +12,21 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|||||||
Future<void> setDefaultHeader({required Map<String, String> headers}) =>
|
Future<void> setDefaultHeader({required Map<String, String> headers}) =>
|
||||||
RustLib.instance.api.crateApiHttpApiSetDefaultHeader(headers: headers);
|
RustLib.instance.api.crateApiHttpApiSetDefaultHeader(headers: headers);
|
||||||
|
|
||||||
Future<RustHttpResponse> fetch(
|
Future<RustHttpResponse> fetch({
|
||||||
{required MyMethod method,
|
required MyMethod method,
|
||||||
required String url,
|
required String url,
|
||||||
Map<String, String>? headers,
|
Map<String, String>? headers,
|
||||||
Uint8List? inputData,
|
Uint8List? inputData,
|
||||||
String? withIpAddress,
|
String? withIpAddress,
|
||||||
bool? withCustomDns}) =>
|
bool? withCustomDns,
|
||||||
RustLib.instance.api.crateApiHttpApiFetch(
|
}) => RustLib.instance.api.crateApiHttpApiFetch(
|
||||||
method: method,
|
method: method,
|
||||||
url: url,
|
url: url,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
inputData: inputData,
|
inputData: inputData,
|
||||||
withIpAddress: withIpAddress,
|
withIpAddress: withIpAddress,
|
||||||
withCustomDns: withCustomDns);
|
withCustomDns: withCustomDns,
|
||||||
|
);
|
||||||
|
|
||||||
Future<List<String>> dnsLookupTxt({required String host}) =>
|
Future<List<String>> dnsLookupTxt({required String host}) =>
|
||||||
RustLib.instance.api.crateApiHttpApiDnsLookupTxt(host: host);
|
RustLib.instance.api.crateApiHttpApiDnsLookupTxt(host: host);
|
||||||
@ -33,15 +34,19 @@ Future<List<String>> dnsLookupTxt({required String host}) =>
|
|||||||
Future<List<String>> dnsLookupIps({required String host}) =>
|
Future<List<String>> dnsLookupIps({required String host}) =>
|
||||||
RustLib.instance.api.crateApiHttpApiDnsLookupIps(host: host);
|
RustLib.instance.api.crateApiHttpApiDnsLookupIps(host: host);
|
||||||
|
|
||||||
enum MyMethod {
|
/// Get the fastest URL from a list of URLs by testing them concurrently.
|
||||||
options,
|
/// Returns the first URL that responds successfully, canceling other requests.
|
||||||
gets,
|
///
|
||||||
post,
|
/// # Arguments
|
||||||
put,
|
/// * `urls` - List of base URLs to test
|
||||||
delete,
|
/// * `path_suffix` - Optional path suffix to append to each URL (e.g., "/api/version")
|
||||||
head,
|
/// If None, tests the base URL directly
|
||||||
trace,
|
Future<String?> getFasterUrl({
|
||||||
connect,
|
required List<String> urls,
|
||||||
patch,
|
String? pathSuffix,
|
||||||
;
|
}) => RustLib.instance.api.crateApiHttpApiGetFasterUrl(
|
||||||
}
|
urls: urls,
|
||||||
|
pathSuffix: pathSuffix,
|
||||||
|
);
|
||||||
|
|
||||||
|
enum MyMethod { options, gets, post, put, delete, head, trace, connect, patch }
|
||||||
|
|||||||
75
lib/common/rust/api/ort_api.dart
Normal file
75
lib/common/rust/api/ort_api.dart
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// This file is automatically generated, so please do not edit it.
|
||||||
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
|
/// 加载 ONNX 翻译模型
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `model_path` - 模型文件夹路径
|
||||||
|
/// * `model_key` - 模型缓存键(用于标识模型,如 "zh-en")
|
||||||
|
/// * `quantization_suffix` - 量化后缀(如 "_q4", "_q8",空字符串表示使用默认模型)
|
||||||
|
/// * `use_xnnpack` - 是否使用 XNNPACK 加速
|
||||||
|
///
|
||||||
|
Future<void> loadTranslationModel({
|
||||||
|
required String modelPath,
|
||||||
|
required String modelKey,
|
||||||
|
required String quantizationSuffix,
|
||||||
|
required bool useXnnpack,
|
||||||
|
}) => RustLib.instance.api.crateApiOrtApiLoadTranslationModel(
|
||||||
|
modelPath: modelPath,
|
||||||
|
modelKey: modelKey,
|
||||||
|
quantizationSuffix: quantizationSuffix,
|
||||||
|
useXnnpack: useXnnpack,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// 翻译文本
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `model_key` - 模型缓存键(如 "zh-en")
|
||||||
|
/// * `text` - 要翻译的文本
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// * `Result<String>` - 翻译后的文本
|
||||||
|
Future<String> translateText({
|
||||||
|
required String modelKey,
|
||||||
|
required String text,
|
||||||
|
}) => RustLib.instance.api.crateApiOrtApiTranslateText(
|
||||||
|
modelKey: modelKey,
|
||||||
|
text: text,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// 批量翻译文本
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `model_key` - 模型缓存键(如 "zh-en")
|
||||||
|
/// * `texts` - 要翻译的文本列表
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
/// * `Result<Vec<String>>` - 翻译后的文本列表
|
||||||
|
Future<List<String>> translateTextBatch({
|
||||||
|
required String modelKey,
|
||||||
|
required List<String> texts,
|
||||||
|
}) => RustLib.instance.api.crateApiOrtApiTranslateTextBatch(
|
||||||
|
modelKey: modelKey,
|
||||||
|
texts: texts,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// 卸载模型
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `model_key` - 模型缓存键(如 "zh-en")
|
||||||
|
///
|
||||||
|
Future<void> unloadTranslationModel({required String modelKey}) => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiOrtApiUnloadTranslationModel(modelKey: modelKey);
|
||||||
|
|
||||||
|
/// 清空所有已加载的模型
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
Future<void> clearAllModels() =>
|
||||||
|
RustLib.instance.api.crateApiOrtApiClearAllModels();
|
||||||
@ -1,5 +1,5 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.9.0.
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
@ -10,14 +10,15 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|||||||
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `RsProcess`
|
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `RsProcess`
|
||||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`
|
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`
|
||||||
|
|
||||||
Stream<RsProcessStreamData> start(
|
Stream<RsProcessStreamData> start({
|
||||||
{required String executable,
|
required String executable,
|
||||||
required List<String> arguments,
|
required List<String> arguments,
|
||||||
required String workingDirectory}) =>
|
required String workingDirectory,
|
||||||
RustLib.instance.api.crateApiRsProcessStart(
|
}) => RustLib.instance.api.crateApiRsProcessStart(
|
||||||
executable: executable,
|
executable: executable,
|
||||||
arguments: arguments,
|
arguments: arguments,
|
||||||
workingDirectory: workingDirectory);
|
workingDirectory: workingDirectory,
|
||||||
|
);
|
||||||
|
|
||||||
Future<void> write({required int rsPid, required String data}) =>
|
Future<void> write({required int rsPid, required String data}) =>
|
||||||
RustLib.instance.api.crateApiRsProcessWrite(rsPid: rsPid, data: data);
|
RustLib.instance.api.crateApiRsProcessWrite(rsPid: rsPid, data: data);
|
||||||
@ -46,9 +47,4 @@ class RsProcessStreamData {
|
|||||||
rsPid == other.rsPid;
|
rsPid == other.rsPid;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RsProcessStreamDataType {
|
enum RsProcessStreamDataType { output, error, exit }
|
||||||
output,
|
|
||||||
error,
|
|
||||||
exit,
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|||||||
120
lib/common/rust/api/unp4k_api.dart
Normal file
120
lib/common/rust/api/unp4k_api.dart
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
// This file is automatically generated, so please do not edit it.
|
||||||
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
|
||||||
|
part 'unp4k_api.freezed.dart';
|
||||||
|
|
||||||
|
// These functions are ignored because they are not marked as `pub`: `dos_datetime_to_millis`, `ensure_files_loaded`, `p4k_get_entry`
|
||||||
|
|
||||||
|
/// 打开 P4K 文件(仅打开,不读取文件列表)
|
||||||
|
Future<void> p4KOpen({required String p4KPath}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiP4KOpen(p4KPath: p4KPath);
|
||||||
|
|
||||||
|
/// 获取文件数量(会触发文件列表加载)
|
||||||
|
Future<BigInt> p4KGetFileCount() =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiP4KGetFileCount();
|
||||||
|
|
||||||
|
/// 获取所有文件列表
|
||||||
|
Future<List<P4kFileItem>> p4KGetAllFiles() =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiP4KGetAllFiles();
|
||||||
|
|
||||||
|
/// 提取文件到内存
|
||||||
|
Future<Uint8List> p4KExtractToMemory({required String filePath}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiP4KExtractToMemory(filePath: filePath);
|
||||||
|
|
||||||
|
/// 提取文件到磁盘
|
||||||
|
Future<void> p4KExtractToDisk({
|
||||||
|
required String filePath,
|
||||||
|
required String outputPath,
|
||||||
|
}) => RustLib.instance.api.crateApiUnp4KApiP4KExtractToDisk(
|
||||||
|
filePath: filePath,
|
||||||
|
outputPath: outputPath,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// 关闭 P4K 读取器
|
||||||
|
Future<void> p4KClose() => RustLib.instance.api.crateApiUnp4KApiP4KClose();
|
||||||
|
|
||||||
|
/// 检查数据是否为 DataForge/DCB 格式
|
||||||
|
Future<bool> dcbIsDataforge({required List<int> data}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbIsDataforge(data: data);
|
||||||
|
|
||||||
|
/// 从内存数据打开 DCB 文件
|
||||||
|
Future<void> dcbOpen({required List<int> data}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbOpen(data: data);
|
||||||
|
|
||||||
|
/// 获取 DCB 记录数量
|
||||||
|
Future<BigInt> dcbGetRecordCount() =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbGetRecordCount();
|
||||||
|
|
||||||
|
/// 获取所有 DCB 记录路径列表
|
||||||
|
Future<List<DcbRecordItem>> dcbGetRecordList() =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbGetRecordList();
|
||||||
|
|
||||||
|
/// 根据路径获取单条记录的 XML
|
||||||
|
Future<String> dcbRecordToXml({required String path}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbRecordToXml(path: path);
|
||||||
|
|
||||||
|
/// 根据索引获取单条记录的 XML
|
||||||
|
Future<String> dcbRecordToXmlByIndex({required BigInt index}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbRecordToXmlByIndex(index: index);
|
||||||
|
|
||||||
|
/// 全文搜索 DCB 记录
|
||||||
|
Future<List<DcbSearchResult>> dcbSearchAll({required String query}) =>
|
||||||
|
RustLib.instance.api.crateApiUnp4KApiDcbSearchAll(query: query);
|
||||||
|
|
||||||
|
/// 导出 DCB 到磁盘
|
||||||
|
/// merge: true = 合并为单个 XML,false = 分离为多个 XML 文件
|
||||||
|
Future<void> dcbExportToDisk({
|
||||||
|
required String outputPath,
|
||||||
|
required String dcbPath,
|
||||||
|
required bool merge,
|
||||||
|
}) => RustLib.instance.api.crateApiUnp4KApiDcbExportToDisk(
|
||||||
|
outputPath: outputPath,
|
||||||
|
dcbPath: dcbPath,
|
||||||
|
merge: merge,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// 关闭 DCB 读取器
|
||||||
|
Future<void> dcbClose() => RustLib.instance.api.crateApiUnp4KApiDcbClose();
|
||||||
|
|
||||||
|
/// DCB 记录项信息
|
||||||
|
@freezed
|
||||||
|
sealed class DcbRecordItem with _$DcbRecordItem {
|
||||||
|
const factory DcbRecordItem({required String path, required BigInt index}) =
|
||||||
|
_DcbRecordItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
sealed class DcbSearchMatch with _$DcbSearchMatch {
|
||||||
|
const factory DcbSearchMatch({
|
||||||
|
required BigInt lineNumber,
|
||||||
|
required String lineContent,
|
||||||
|
}) = _DcbSearchMatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 全文搜索 DCB 记录
|
||||||
|
/// 返回匹配的记录路径和预览摘要
|
||||||
|
@freezed
|
||||||
|
sealed class DcbSearchResult with _$DcbSearchResult {
|
||||||
|
const factory DcbSearchResult({
|
||||||
|
required String path,
|
||||||
|
required BigInt index,
|
||||||
|
required List<DcbSearchMatch> matches,
|
||||||
|
}) = _DcbSearchResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// P4K 文件项信息
|
||||||
|
@freezed
|
||||||
|
sealed class P4kFileItem with _$P4kFileItem {
|
||||||
|
const factory P4kFileItem({
|
||||||
|
required String name,
|
||||||
|
required bool isDirectory,
|
||||||
|
required BigInt size,
|
||||||
|
required BigInt compressedSize,
|
||||||
|
required PlatformInt64 dateModified,
|
||||||
|
}) = _P4kFileItem;
|
||||||
|
}
|
||||||
1048
lib/common/rust/api/unp4k_api.freezed.dart
Normal file
1048
lib/common/rust/api/unp4k_api.freezed.dart
Normal file
File diff suppressed because it is too large
Load Diff
141
lib/common/rust/api/webview_api.dart
Normal file
141
lib/common/rust/api/webview_api.dart
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
// This file is automatically generated, so please do not edit it.
|
||||||
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
|
||||||
|
part 'webview_api.freezed.dart';
|
||||||
|
|
||||||
|
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `WebViewCommand`
|
||||||
|
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`, `fmt`
|
||||||
|
|
||||||
|
/// Create a new WebView window and return its ID
|
||||||
|
String webviewCreate({required WebViewConfiguration config}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewCreate(config: config);
|
||||||
|
|
||||||
|
/// Navigate to a URL
|
||||||
|
void webviewNavigate({required String id, required String url}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewNavigate(id: id, url: url);
|
||||||
|
|
||||||
|
/// Go back in history
|
||||||
|
void webviewGoBack({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewGoBack(id: id);
|
||||||
|
|
||||||
|
/// Go forward in history
|
||||||
|
void webviewGoForward({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewGoForward(id: id);
|
||||||
|
|
||||||
|
/// Reload the current page
|
||||||
|
void webviewReload({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewReload(id: id);
|
||||||
|
|
||||||
|
/// Stop loading
|
||||||
|
void webviewStop({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewStop(id: id);
|
||||||
|
|
||||||
|
/// Execute JavaScript in the WebView
|
||||||
|
void webviewExecuteScript({required String id, required String script}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewExecuteScript(
|
||||||
|
id: id,
|
||||||
|
script: script,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Set window visibility
|
||||||
|
void webviewSetVisibility({required String id, required bool visible}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewSetVisibility(
|
||||||
|
id: id,
|
||||||
|
visible: visible,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Close the WebView window
|
||||||
|
void webviewClose({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewClose(id: id);
|
||||||
|
|
||||||
|
/// Set window size
|
||||||
|
void webviewSetWindowSize({
|
||||||
|
required String id,
|
||||||
|
required int width,
|
||||||
|
required int height,
|
||||||
|
}) => RustLib.instance.api.crateApiWebviewApiWebviewSetWindowSize(
|
||||||
|
id: id,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Set window position
|
||||||
|
void webviewSetWindowPosition({
|
||||||
|
required String id,
|
||||||
|
required int x,
|
||||||
|
required int y,
|
||||||
|
}) => RustLib.instance.api.crateApiWebviewApiWebviewSetWindowPosition(
|
||||||
|
id: id,
|
||||||
|
x: x,
|
||||||
|
y: y,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Get the current navigation state
|
||||||
|
WebViewNavigationState webviewGetState({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewGetState(id: id);
|
||||||
|
|
||||||
|
/// Check if the WebView is closed
|
||||||
|
bool webviewIsClosed({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewIsClosed(id: id);
|
||||||
|
|
||||||
|
/// Poll for events from the WebView (non-blocking)
|
||||||
|
List<WebViewEvent> webviewPollEvents({required String id}) =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewPollEvents(id: id);
|
||||||
|
|
||||||
|
/// Get a list of all active WebView IDs
|
||||||
|
List<String> webviewListAll() =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebviewListAll();
|
||||||
|
|
||||||
|
/// WebView window configuration
|
||||||
|
@freezed
|
||||||
|
sealed class WebViewConfiguration with _$WebViewConfiguration {
|
||||||
|
const WebViewConfiguration._();
|
||||||
|
const factory WebViewConfiguration({
|
||||||
|
required String title,
|
||||||
|
required int width,
|
||||||
|
required int height,
|
||||||
|
String? userDataFolder,
|
||||||
|
required bool enableDevtools,
|
||||||
|
required bool transparent,
|
||||||
|
String? userAgent,
|
||||||
|
}) = _WebViewConfiguration;
|
||||||
|
static Future<WebViewConfiguration> default_() =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebViewConfigurationDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
sealed class WebViewEvent with _$WebViewEvent {
|
||||||
|
const WebViewEvent._();
|
||||||
|
|
||||||
|
const factory WebViewEvent.navigationStarted({required String url}) =
|
||||||
|
WebViewEvent_NavigationStarted;
|
||||||
|
const factory WebViewEvent.navigationCompleted({required String url}) =
|
||||||
|
WebViewEvent_NavigationCompleted;
|
||||||
|
const factory WebViewEvent.titleChanged({required String title}) =
|
||||||
|
WebViewEvent_TitleChanged;
|
||||||
|
const factory WebViewEvent.webMessage({required String message}) =
|
||||||
|
WebViewEvent_WebMessage;
|
||||||
|
const factory WebViewEvent.windowClosed() = WebViewEvent_WindowClosed;
|
||||||
|
const factory WebViewEvent.error({required String message}) =
|
||||||
|
WebViewEvent_Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Navigation state of the WebView
|
||||||
|
@freezed
|
||||||
|
sealed class WebViewNavigationState with _$WebViewNavigationState {
|
||||||
|
const WebViewNavigationState._();
|
||||||
|
const factory WebViewNavigationState({
|
||||||
|
required String url,
|
||||||
|
required String title,
|
||||||
|
required bool canGoBack,
|
||||||
|
required bool canGoForward,
|
||||||
|
required bool isLoading,
|
||||||
|
}) = _WebViewNavigationState;
|
||||||
|
static Future<WebViewNavigationState> default_() =>
|
||||||
|
RustLib.instance.api.crateApiWebviewApiWebViewNavigationStateDefault();
|
||||||
|
}
|
||||||
1092
lib/common/rust/api/webview_api.freezed.dart
Normal file
1092
lib/common/rust/api/webview_api.freezed.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,168 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.9.0.
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import '../frb_generated.dart';
|
import '../frb_generated.dart';
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
Future<void> sendNotify(
|
// These functions are ignored because they are not marked as `pub`: `get_process_path`
|
||||||
{String? summary, String? body, String? appName, String? appId}) =>
|
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `fmt`, `fmt`
|
||||||
RustLib.instance.api.crateApiWin32ApiSendNotify(
|
|
||||||
summary: summary, body: body, appName: appName, appId: appId);
|
|
||||||
|
|
||||||
Future<bool> setForegroundWindow({required String windowName}) =>
|
Future<void> sendNotify({
|
||||||
RustLib.instance.api
|
String? summary,
|
||||||
.crateApiWin32ApiSetForegroundWindow(windowName: windowName);
|
String? body,
|
||||||
|
String? appName,
|
||||||
|
String? appId,
|
||||||
|
}) => RustLib.instance.api.crateApiWin32ApiSendNotify(
|
||||||
|
summary: summary,
|
||||||
|
body: body,
|
||||||
|
appName: appName,
|
||||||
|
appId: appId,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Get system memory size in GB
|
||||||
|
Future<BigInt> getSystemMemorySizeGb() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiGetSystemMemorySizeGb();
|
||||||
|
|
||||||
|
/// Get number of logical processors
|
||||||
|
Future<int> getNumberOfLogicalProcessors() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiGetNumberOfLogicalProcessors();
|
||||||
|
|
||||||
|
/// Get all system information at once
|
||||||
|
Future<SystemInfo> getSystemInfo() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiGetSystemInfo();
|
||||||
|
|
||||||
|
/// Get GPU info from registry (more accurate VRAM)
|
||||||
|
Future<String> getGpuInfoFromRegistry() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiGetGpuInfoFromRegistry();
|
||||||
|
|
||||||
|
/// Resolve shortcut (.lnk) file to get target path
|
||||||
|
Future<String> resolveShortcut({required String lnkPath}) =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiResolveShortcut(lnkPath: lnkPath);
|
||||||
|
|
||||||
|
/// Open file explorer and select file/folder
|
||||||
|
Future<void> openDirWithExplorer({
|
||||||
|
required String path,
|
||||||
|
required bool isFile,
|
||||||
|
}) => RustLib.instance.api.crateApiWin32ApiOpenDirWithExplorer(
|
||||||
|
path: path,
|
||||||
|
isFile: isFile,
|
||||||
|
);
|
||||||
|
|
||||||
|
Future<bool> setForegroundWindow({required String windowName}) => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiWin32ApiSetForegroundWindow(windowName: windowName);
|
||||||
|
|
||||||
|
Future<int> getProcessPidByName({required String processName}) => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiWin32ApiGetProcessPidByName(processName: processName);
|
||||||
|
|
||||||
|
Future<List<ProcessInfo>> getProcessListByName({required String processName}) =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiGetProcessListByName(
|
||||||
|
processName: processName,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Kill processes by name
|
||||||
|
Future<int> killProcessByName({required String processName}) => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiWin32ApiKillProcessByName(processName: processName);
|
||||||
|
|
||||||
|
/// Get disk physical sector size for performance
|
||||||
|
Future<int> getDiskPhysicalSectorSize({required String driveLetter}) => RustLib
|
||||||
|
.instance
|
||||||
|
.api
|
||||||
|
.crateApiWin32ApiGetDiskPhysicalSectorSize(driveLetter: driveLetter);
|
||||||
|
|
||||||
|
/// Create a desktop shortcut
|
||||||
|
Future<void> createDesktopShortcut({
|
||||||
|
required String targetPath,
|
||||||
|
required String shortcutName,
|
||||||
|
}) => RustLib.instance.api.crateApiWin32ApiCreateDesktopShortcut(
|
||||||
|
targetPath: targetPath,
|
||||||
|
shortcutName: shortcutName,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Run a program with admin privileges (UAC)
|
||||||
|
Future<void> runAsAdmin({required String program, required String args}) =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiRunAsAdmin(
|
||||||
|
program: program,
|
||||||
|
args: args,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Start a program (without waiting)
|
||||||
|
Future<void> startProcess({
|
||||||
|
required String program,
|
||||||
|
required List<String> args,
|
||||||
|
}) => RustLib.instance.api.crateApiWin32ApiStartProcess(
|
||||||
|
program: program,
|
||||||
|
args: args,
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Check if NVME patch is applied
|
||||||
|
Future<bool> checkNvmePatchStatus() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiCheckNvmePatchStatus();
|
||||||
|
|
||||||
|
/// Add NVME patch to registry
|
||||||
|
Future<void> addNvmePatch() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiAddNvmePatch();
|
||||||
|
|
||||||
|
/// Remove NVME patch from registry
|
||||||
|
Future<void> removeNvmePatch() =>
|
||||||
|
RustLib.instance.api.crateApiWin32ApiRemoveNvmePatch();
|
||||||
|
|
||||||
|
class ProcessInfo {
|
||||||
|
final int pid;
|
||||||
|
final String name;
|
||||||
|
final String path;
|
||||||
|
|
||||||
|
const ProcessInfo({
|
||||||
|
required this.pid,
|
||||||
|
required this.name,
|
||||||
|
required this.path,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => pid.hashCode ^ name.hashCode ^ path.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ProcessInfo &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
pid == other.pid &&
|
||||||
|
name == other.name &&
|
||||||
|
path == other.path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// System information struct
|
||||||
|
class SystemInfo {
|
||||||
|
final String osName;
|
||||||
|
final String cpuName;
|
||||||
|
final String gpuInfo;
|
||||||
|
final String diskInfo;
|
||||||
|
|
||||||
|
const SystemInfo({
|
||||||
|
required this.osName,
|
||||||
|
required this.cpuName,
|
||||||
|
required this.gpuInfo,
|
||||||
|
required this.diskInfo,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
osName.hashCode ^ cpuName.hashCode ^ gpuInfo.hashCode ^ diskInfo.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SystemInfo &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
osName == other.osName &&
|
||||||
|
cpuName == other.cpuName &&
|
||||||
|
gpuInfo == other.gpuInfo &&
|
||||||
|
diskInfo == other.diskInfo;
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,12 @@
|
|||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.9.0.
|
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import 'frb_generated.dart';
|
import 'frb_generated.dart';
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
enum MyHttpVersion {
|
enum MyHttpVersion { http09, http10, http11, http2, http3, httpUnknown }
|
||||||
http09,
|
|
||||||
http10,
|
|
||||||
http11,
|
|
||||||
http2,
|
|
||||||
http3,
|
|
||||||
httpUnknown,
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
class RustHttpResponse {
|
class RustHttpResponse {
|
||||||
final int statusCode;
|
final int statusCode;
|
||||||
|
|||||||
340
lib/common/rust/rust_webview_controller.dart
Normal file
340
lib/common/rust/rust_webview_controller.dart
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
// Rust WebView 管理器
|
||||||
|
// 使用 wry + tao 实现的 WebView 窗口管理
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/rust/api/webview_api.dart'
|
||||||
|
as rust_webview;
|
||||||
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
|
||||||
|
typedef OnWebMessageCallback = void Function(String message);
|
||||||
|
typedef OnNavigationCallback = void Function(String url);
|
||||||
|
typedef OnNavigationCompletedCallback = void Function(String url);
|
||||||
|
typedef OnWindowClosedCallback = void Function();
|
||||||
|
|
||||||
|
/// Rust WebView 控制器
|
||||||
|
/// 封装 Rust wry + tao WebView 的业务逻辑
|
||||||
|
class RustWebViewController {
|
||||||
|
final String id;
|
||||||
|
final List<OnWebMessageCallback> _messageCallbacks = [];
|
||||||
|
final List<OnNavigationCallback> _navigationCallbacks = [];
|
||||||
|
final List<OnNavigationCompletedCallback> _navigationCompletedCallbacks = [];
|
||||||
|
final List<OnWindowClosedCallback> _closeCallbacks = [];
|
||||||
|
|
||||||
|
Timer? _pollTimer;
|
||||||
|
bool _isDisposed = false;
|
||||||
|
|
||||||
|
/// 本地化脚本(从 assets 加载)
|
||||||
|
String _localizationScript = "";
|
||||||
|
|
||||||
|
/// 当前 URL
|
||||||
|
String _currentUrl = "";
|
||||||
|
String get currentUrl => _currentUrl;
|
||||||
|
|
||||||
|
RustWebViewController._(this.id);
|
||||||
|
|
||||||
|
/// 创建新的 WebView 窗口
|
||||||
|
static Future<RustWebViewController> create({
|
||||||
|
String title = "WebView",
|
||||||
|
int width = 1280,
|
||||||
|
int height = 720,
|
||||||
|
String? userDataFolder,
|
||||||
|
bool enableDevtools = false,
|
||||||
|
bool transparent = false,
|
||||||
|
String? userAgent,
|
||||||
|
}) async {
|
||||||
|
try {
|
||||||
|
final config = rust_webview.WebViewConfiguration(
|
||||||
|
title: title,
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
userDataFolder: userDataFolder,
|
||||||
|
enableDevtools: enableDevtools,
|
||||||
|
transparent: transparent,
|
||||||
|
userAgent: userAgent,
|
||||||
|
);
|
||||||
|
|
||||||
|
final id = rust_webview.webviewCreate(config: config);
|
||||||
|
final controller = RustWebViewController._(id);
|
||||||
|
|
||||||
|
// 加载脚本资源
|
||||||
|
await controller._loadScripts();
|
||||||
|
|
||||||
|
// 启动事件轮询
|
||||||
|
controller._startEventPolling();
|
||||||
|
|
||||||
|
return controller;
|
||||||
|
} catch (e) {
|
||||||
|
throw Exception("Failed to create WebView: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 加载本地化和拦截器脚本
|
||||||
|
Future<void> _loadScripts() async {
|
||||||
|
try {
|
||||||
|
_localizationScript = await rootBundle.loadString('assets/web_script.js');
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("Failed to load scripts: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 启动事件轮询
|
||||||
|
void _startEventPolling() {
|
||||||
|
_pollTimer = Timer.periodic(const Duration(milliseconds: 50), (_) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
_pollEvents();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 轮询事件
|
||||||
|
void _pollEvents() {
|
||||||
|
try {
|
||||||
|
final events = rust_webview.webviewPollEvents(id: id);
|
||||||
|
for (final event in events) {
|
||||||
|
_handleEvent(event);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// WebView 可能已关闭
|
||||||
|
if (!_isDisposed) {
|
||||||
|
dPrint("Error polling events: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 处理事件
|
||||||
|
void _handleEvent(rust_webview.WebViewEvent event) {
|
||||||
|
switch (event) {
|
||||||
|
case rust_webview.WebViewEvent_NavigationStarted(:final url):
|
||||||
|
dPrint("Navigation started: $url");
|
||||||
|
_currentUrl = url;
|
||||||
|
// 导航开始时通知
|
||||||
|
for (final callback in _navigationCallbacks) {
|
||||||
|
callback(url);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rust_webview.WebViewEvent_NavigationCompleted(:final url):
|
||||||
|
dPrint("Navigation completed: $url");
|
||||||
|
_currentUrl = url;
|
||||||
|
// 导航完成回调(用于注入脚本)
|
||||||
|
for (final callback in _navigationCompletedCallbacks) {
|
||||||
|
callback(url);
|
||||||
|
}
|
||||||
|
for (final callback in _navigationCallbacks) {
|
||||||
|
callback(url);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rust_webview.WebViewEvent_TitleChanged(:final title):
|
||||||
|
dPrint("Title changed: $title");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rust_webview.WebViewEvent_WebMessage(:final message):
|
||||||
|
_handleWebMessage(message);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rust_webview.WebViewEvent_WindowClosed():
|
||||||
|
dPrint("Window closed");
|
||||||
|
for (final callback in _closeCallbacks) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
dispose();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case rust_webview.WebViewEvent_Error(:final message):
|
||||||
|
dPrint("WebView error: $message");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 处理来自 WebView 的消息
|
||||||
|
void _handleWebMessage(String message) {
|
||||||
|
dPrint("Web message: $message");
|
||||||
|
try {
|
||||||
|
final data = json.decode(message);
|
||||||
|
final action = data["action"];
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case "navigation_state":
|
||||||
|
// 从 JS 获取导航状态更新
|
||||||
|
final url = data["url"] ?? "";
|
||||||
|
final isLoading = data["isLoading"] ?? false;
|
||||||
|
_currentUrl = url;
|
||||||
|
if (!isLoading) {
|
||||||
|
for (final callback in _navigationCallbacks) {
|
||||||
|
callback(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "close_window":
|
||||||
|
// 处理来自导航栏的关闭请求
|
||||||
|
close();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 转发其他消息给回调
|
||||||
|
for (final callback in _messageCallbacks) {
|
||||||
|
callback(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 非 JSON 消息,直接转发
|
||||||
|
for (final callback in _messageCallbacks) {
|
||||||
|
callback(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 导航到 URL
|
||||||
|
void navigate(String url) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
_currentUrl = url;
|
||||||
|
rust_webview.webviewNavigate(id: id, url: url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 后退
|
||||||
|
void goBack() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewGoBack(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 前进
|
||||||
|
void goForward() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewGoForward(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 刷新
|
||||||
|
void reload() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewReload(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 停止加载
|
||||||
|
void stop() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewStop(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 执行 JavaScript
|
||||||
|
void executeScript(String script) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewExecuteScript(id: id, script: script);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 设置窗口可见性
|
||||||
|
void setVisible(bool visible) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewSetVisibility(id: id, visible: visible);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 关闭窗口
|
||||||
|
void close() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewClose(id: id);
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 设置窗口大小
|
||||||
|
void setWindowSize(int width, int height) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewSetWindowSize(id: id, width: width, height: height);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 设置窗口位置
|
||||||
|
void setWindowPosition(int x, int y) {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
rust_webview.webviewSetWindowPosition(id: id, x: x, y: y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取当前导航状态
|
||||||
|
rust_webview.WebViewNavigationState getState() {
|
||||||
|
return rust_webview.webviewGetState(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 检查窗口是否已关闭
|
||||||
|
bool get isClosed {
|
||||||
|
if (_isDisposed) return true;
|
||||||
|
return rust_webview.webviewIsClosed(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 添加消息回调
|
||||||
|
void addOnWebMessageCallback(OnWebMessageCallback callback) {
|
||||||
|
_messageCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移除消息回调
|
||||||
|
void removeOnWebMessageCallback(OnWebMessageCallback callback) {
|
||||||
|
_messageCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 添加导航回调
|
||||||
|
void addOnNavigationCallback(OnNavigationCallback callback) {
|
||||||
|
_navigationCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移除导航回调
|
||||||
|
void removeOnNavigationCallback(OnNavigationCallback callback) {
|
||||||
|
_navigationCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 添加导航完成回调(用于在页面加载完成后注入脚本)
|
||||||
|
void addOnNavigationCompletedCallback(
|
||||||
|
OnNavigationCompletedCallback callback,
|
||||||
|
) {
|
||||||
|
_navigationCompletedCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移除导航完成回调
|
||||||
|
void removeOnNavigationCompletedCallback(
|
||||||
|
OnNavigationCompletedCallback callback,
|
||||||
|
) {
|
||||||
|
_navigationCompletedCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 添加关闭回调
|
||||||
|
void addOnCloseCallback(OnWindowClosedCallback callback) {
|
||||||
|
_closeCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移除关闭回调
|
||||||
|
void removeOnCloseCallback(OnWindowClosedCallback callback) {
|
||||||
|
_closeCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 注入本地化脚本
|
||||||
|
void injectLocalizationScript() {
|
||||||
|
if (_localizationScript.isNotEmpty) {
|
||||||
|
executeScript(_localizationScript);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 初始化网页本地化
|
||||||
|
void initWebLocalization() {
|
||||||
|
executeScript("InitWebLocalization()");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 更新翻译词典
|
||||||
|
void updateReplaceWords(List<Map<String, String>> words, bool enableCapture) {
|
||||||
|
final jsonWords = json.encode(words);
|
||||||
|
executeScript(
|
||||||
|
"WebLocalizationUpdateReplaceWords($jsonWords, $enableCapture)",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 执行 RSI 登录脚本
|
||||||
|
void executeRsiLogin(String channel) {
|
||||||
|
executeScript('getRSILauncherToken("$channel");');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 释放资源
|
||||||
|
void dispose() {
|
||||||
|
if (_isDisposed) return;
|
||||||
|
_isDisposed = true;
|
||||||
|
_pollTimer?.cancel();
|
||||||
|
_messageCallbacks.clear();
|
||||||
|
_navigationCallbacks.clear();
|
||||||
|
_navigationCompletedCallbacks.clear();
|
||||||
|
_closeCallbacks.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
@ -7,105 +8,118 @@ import 'dart:ui' as ui;
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:starcitizen_doctor/generated/l10n.dart';
|
import 'package:starcitizen_doctor/generated/l10n.dart';
|
||||||
|
|
||||||
Future showToast(BuildContext context, String msg, {BoxConstraints? constraints, String? title}) async {
|
/// String extension for cross-platform path compatibility
|
||||||
return showBaseDialog(context,
|
extension PathStringExtension on String {
|
||||||
title: title ?? S.current.app_common_tip,
|
/// Converts path separators to the current platform's format.
|
||||||
content: Text(msg),
|
/// On Windows: / -> \
|
||||||
actions: [
|
/// On Linux/macOS: \ -> /
|
||||||
FilledButton(
|
String get platformPath {
|
||||||
child: Padding(
|
if (Platform.isWindows) {
|
||||||
padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8),
|
return replaceAll('/', '\\');
|
||||||
child: Text(S.current.app_common_tip_i_know),
|
}
|
||||||
),
|
return replaceAll('\\', '/');
|
||||||
onPressed: () => Navigator.pop(context),
|
}
|
||||||
),
|
|
||||||
],
|
|
||||||
constraints: constraints);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> showConfirmDialogs(BuildContext context, String title, Widget content,
|
Future showToast(BuildContext context, String msg, {BoxConstraints? constraints, String? title}) async {
|
||||||
{String confirm = "", String cancel = "", BoxConstraints? constraints}) async {
|
return showBaseDialog(
|
||||||
|
context,
|
||||||
|
title: title ?? S.current.app_common_tip,
|
||||||
|
content: Text(msg),
|
||||||
|
actions: [
|
||||||
|
FilledButton(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8),
|
||||||
|
child: Text(S.current.app_common_tip_i_know),
|
||||||
|
),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
constraints: constraints,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> showConfirmDialogs(
|
||||||
|
BuildContext context,
|
||||||
|
String title,
|
||||||
|
Widget content, {
|
||||||
|
String confirm = "",
|
||||||
|
String cancel = "",
|
||||||
|
BoxConstraints? constraints,
|
||||||
|
}) async {
|
||||||
if (confirm.isEmpty) confirm = S.current.app_common_tip_confirm;
|
if (confirm.isEmpty) confirm = S.current.app_common_tip_confirm;
|
||||||
if (cancel.isEmpty) cancel = S.current.app_common_tip_cancel;
|
if (cancel.isEmpty) cancel = S.current.app_common_tip_cancel;
|
||||||
|
|
||||||
final r = await showBaseDialog(context,
|
final r = await showBaseDialog(
|
||||||
title: title,
|
context,
|
||||||
content: content,
|
title: title,
|
||||||
actions: [
|
content: content,
|
||||||
if (confirm.isNotEmpty)
|
actions: [
|
||||||
FilledButton(
|
if (confirm.isNotEmpty)
|
||||||
child: Padding(
|
FilledButton(
|
||||||
padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8),
|
child: Padding(padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8), child: Text(confirm)),
|
||||||
child: Text(confirm),
|
onPressed: () => Navigator.pop(context, true),
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.pop(context, true),
|
if (cancel.isNotEmpty)
|
||||||
),
|
Button(
|
||||||
if (cancel.isNotEmpty)
|
child: Padding(padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8), child: Text(cancel)),
|
||||||
Button(
|
onPressed: () => Navigator.pop(context, false),
|
||||||
child: Padding(
|
),
|
||||||
padding: const EdgeInsets.only(top: 2, bottom: 2, left: 8, right: 8),
|
],
|
||||||
child: Text(cancel),
|
constraints: constraints,
|
||||||
),
|
);
|
||||||
onPressed: () => Navigator.pop(context, false),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
constraints: constraints);
|
|
||||||
return r == true;
|
return r == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> showInputDialogs(BuildContext context,
|
Future<String?> showInputDialogs(
|
||||||
{required String title,
|
BuildContext context, {
|
||||||
required String content,
|
required String title,
|
||||||
BoxConstraints? constraints,
|
required String content,
|
||||||
String? initialValue,
|
BoxConstraints? constraints,
|
||||||
List<TextInputFormatter>? inputFormatters}) async {
|
String? initialValue,
|
||||||
|
List<TextInputFormatter>? inputFormatters,
|
||||||
|
}) async {
|
||||||
String? userInput;
|
String? userInput;
|
||||||
constraints ??= BoxConstraints(maxWidth: MediaQuery
|
constraints ??= BoxConstraints(maxWidth: MediaQuery.of(context).size.width * .38);
|
||||||
.of(context)
|
|
||||||
.size
|
|
||||||
.width * .38);
|
|
||||||
final ok = await showConfirmDialogs(
|
final ok = await showConfirmDialogs(
|
||||||
context,
|
context,
|
||||||
title,
|
title,
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (content.isNotEmpty)
|
if (content.isNotEmpty) Text(content, style: TextStyle(color: Colors.white.withValues(alpha: .6))),
|
||||||
Text(
|
const SizedBox(height: 8),
|
||||||
content,
|
TextFormBox(
|
||||||
style: TextStyle(color: Colors.white.withValues(alpha: .6)),
|
initialValue: initialValue,
|
||||||
),
|
onChanged: (str) {
|
||||||
const SizedBox(height: 8),
|
userInput = str;
|
||||||
TextFormBox(
|
},
|
||||||
initialValue: initialValue,
|
inputFormatters: inputFormatters,
|
||||||
onChanged: (str) {
|
),
|
||||||
userInput = str;
|
],
|
||||||
},
|
),
|
||||||
inputFormatters: inputFormatters,
|
constraints: constraints,
|
||||||
),
|
);
|
||||||
],
|
|
||||||
),
|
|
||||||
constraints: constraints);
|
|
||||||
if (ok == true) return userInput;
|
if (ok == true) return userInput;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future showBaseDialog(BuildContext context,
|
Future showBaseDialog(
|
||||||
{required String title, required Widget content, List<Widget>? actions, BoxConstraints? constraints}) async {
|
BuildContext context, {
|
||||||
|
required String title,
|
||||||
|
required Widget content,
|
||||||
|
List<Widget>? actions,
|
||||||
|
BoxConstraints? constraints,
|
||||||
|
}) async {
|
||||||
return await showDialog(
|
return await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) => ContentDialog(
|
||||||
ContentDialog(
|
title: Text(title),
|
||||||
title: Text(title),
|
content: content,
|
||||||
content: content,
|
constraints: constraints ?? const BoxConstraints(maxWidth: 512, maxHeight: 756.0),
|
||||||
constraints: constraints ??
|
actions: actions,
|
||||||
const BoxConstraints(
|
),
|
||||||
maxWidth: 512,
|
|
||||||
maxHeight: 756.0,
|
|
||||||
),
|
|
||||||
actions: actions,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ export 'package:starcitizen_doctor/generated/l10n.dart';
|
|||||||
var _logLock = Lock();
|
var _logLock = Lock();
|
||||||
File? _logFile;
|
File? _logFile;
|
||||||
|
|
||||||
void dPrint(src) async {
|
void dPrint(dynamic src) async {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print(src);
|
print(src);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1,15 +1,20 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:hexcolor/hexcolor.dart';
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
import 'package:starcitizen_doctor/app.dart';
|
import 'package:starcitizen_doctor/app.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/conf/conf.dart';
|
||||||
import 'package:starcitizen_doctor/common/helper/log_helper.dart';
|
import 'package:starcitizen_doctor/common/helper/log_helper.dart';
|
||||||
import 'package:starcitizen_doctor/generated/l10n.dart';
|
import 'package:starcitizen_doctor/generated/l10n.dart';
|
||||||
import 'package:starcitizen_doctor/ui/tools/log_analyze_ui/log_analyze_ui.dart';
|
import 'package:starcitizen_doctor/ui/tools/log_analyze_ui/log_analyze_ui.dart';
|
||||||
|
import 'package:window_manager/window_manager.dart';
|
||||||
|
|
||||||
import 'base_utils.dart';
|
import 'base_utils.dart';
|
||||||
|
|
||||||
@ -17,8 +22,17 @@ part 'multi_window_manager.freezed.dart';
|
|||||||
|
|
||||||
part 'multi_window_manager.g.dart';
|
part 'multi_window_manager.g.dart';
|
||||||
|
|
||||||
|
/// Window type definitions for multi-window support
|
||||||
|
class WindowTypes {
|
||||||
|
/// Main application window
|
||||||
|
static const String main = 'main';
|
||||||
|
|
||||||
|
/// Log analyzer window
|
||||||
|
static const String logAnalyze = 'log_analyze';
|
||||||
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class MultiWindowAppState with _$MultiWindowAppState {
|
abstract class MultiWindowAppState with _$MultiWindowAppState {
|
||||||
const factory MultiWindowAppState({
|
const factory MultiWindowAppState({
|
||||||
required String backgroundColor,
|
required String backgroundColor,
|
||||||
required String menuColor,
|
required String menuColor,
|
||||||
@ -26,34 +40,49 @@ class MultiWindowAppState with _$MultiWindowAppState {
|
|||||||
required List<String> gameInstallPaths,
|
required List<String> gameInstallPaths,
|
||||||
String? languageCode,
|
String? languageCode,
|
||||||
String? countryCode,
|
String? countryCode,
|
||||||
|
@Default(10) windowsVersion,
|
||||||
}) = _MultiWindowAppState;
|
}) = _MultiWindowAppState;
|
||||||
|
|
||||||
factory MultiWindowAppState.fromJson(Map<String, dynamic> json) => _$MultiWindowAppStateFromJson(json);
|
factory MultiWindowAppState.fromJson(Map<String, dynamic> json) => _$MultiWindowAppStateFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MultiWindowManager {
|
class MultiWindowManager {
|
||||||
static Future<void> launchSubWindow(String type, String title, AppGlobalState appGlobalState) async {
|
/// Parse window type from arguments string
|
||||||
final gameInstallPaths = await SCLoggerHelper.getGameInstallPath(await SCLoggerHelper.getLauncherLogList() ?? []);
|
static String parseWindowType(String arguments) {
|
||||||
final window = await DesktopMultiWindow.createWindow(jsonEncode({
|
if (arguments.isEmpty) {
|
||||||
'window_type': type,
|
return WindowTypes.main;
|
||||||
'app_state': _appStateToWindowState(
|
}
|
||||||
appGlobalState,
|
try {
|
||||||
gameInstallPaths: gameInstallPaths,
|
final Map<String, dynamic> argument = jsonDecode(arguments);
|
||||||
).toJson(),
|
return argument['window_type'] ?? WindowTypes.main;
|
||||||
}));
|
} catch (e) {
|
||||||
window.setFrame(const Rect.fromLTWH(0, 0, 900, 1200));
|
return WindowTypes.main;
|
||||||
window.setTitle(title);
|
}
|
||||||
await window.center();
|
|
||||||
await window.show();
|
|
||||||
// sendAppStateBroadcast(appGlobalState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static sendAppStateBroadcast(AppGlobalState appGlobalState) {
|
/// Launch a sub-window with specified type and title
|
||||||
DesktopMultiWindow.invokeMethod(
|
static Future<void> launchSubWindow(String type, String title, AppGlobalState appGlobalState) async {
|
||||||
0,
|
final gameInstallPaths = await SCLoggerHelper.getGameInstallPath(
|
||||||
'app_state_broadcast',
|
await SCLoggerHelper.getLauncherLogList() ?? [],
|
||||||
_appStateToWindowState(appGlobalState).toJson(),
|
checkExists: true,
|
||||||
|
withVersion: AppConf.gameChannels,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final controller = await WindowController.create(
|
||||||
|
WindowConfiguration(
|
||||||
|
hiddenAtLaunch: true,
|
||||||
|
arguments: jsonEncode({
|
||||||
|
'window_type': type,
|
||||||
|
'app_state': _appStateToWindowState(appGlobalState, gameInstallPaths: gameInstallPaths).toJson(),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await Future.delayed(Duration(milliseconds: 500)).then((_) async {
|
||||||
|
await controller.setFrame(const Rect.fromLTWH(0, 0, 720, 800));
|
||||||
|
await controller.setTitle(title);
|
||||||
|
await controller.center();
|
||||||
|
await controller.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static MultiWindowAppState _appStateToWindowState(AppGlobalState appGlobalState, {List<String>? gameInstallPaths}) {
|
static MultiWindowAppState _appStateToWindowState(AppGlobalState appGlobalState, {List<String>? gameInstallPaths}) {
|
||||||
@ -64,53 +93,147 @@ class MultiWindowManager {
|
|||||||
languageCode: appGlobalState.appLocale?.languageCode,
|
languageCode: appGlobalState.appLocale?.languageCode,
|
||||||
countryCode: appGlobalState.appLocale?.countryCode,
|
countryCode: appGlobalState.appLocale?.countryCode,
|
||||||
gameInstallPaths: gameInstallPaths ?? [],
|
gameInstallPaths: gameInstallPaths ?? [],
|
||||||
|
windowsVersion: appGlobalState.windowsVersion,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void runSubWindowApp(List<String> args) {
|
/// Run sub-window app with parsed arguments
|
||||||
final argument = args[2].isEmpty ? const {} : jsonDecode(args[2]) as Map<String, dynamic>;
|
static Future<void> runSubWindowApp(String arguments, String windowType) async {
|
||||||
|
final Map<String, dynamic> argument = arguments.isEmpty ? const {} : jsonDecode(arguments);
|
||||||
final windowAppState = MultiWindowAppState.fromJson(argument['app_state'] ?? {});
|
final windowAppState = MultiWindowAppState.fromJson(argument['app_state'] ?? {});
|
||||||
Widget? windowWidget;
|
Widget? windowWidget;
|
||||||
switch (argument["window_type"]) {
|
|
||||||
case "log_analyze":
|
switch (windowType) {
|
||||||
|
case WindowTypes.logAnalyze:
|
||||||
windowWidget = ToolsLogAnalyzeDialogUI(appState: windowAppState);
|
windowWidget = ToolsLogAnalyzeDialogUI(appState: windowAppState);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Exception('Unknown window type');
|
throw Exception('Unknown window type: $windowType');
|
||||||
}
|
}
|
||||||
return runApp(ProviderScope(
|
|
||||||
child: FluentApp(
|
await Window.initialize();
|
||||||
title: "StarCitizenToolBox",
|
|
||||||
restorationScopeId: "StarCitizenToolBox",
|
if (Platform.isWindows && windowAppState.windowsVersion >= 10) {
|
||||||
themeMode: ThemeMode.dark,
|
await Window.setEffect(effect: WindowEffect.acrylic);
|
||||||
localizationsDelegates: const [
|
}
|
||||||
GlobalMaterialLocalizations.delegate,
|
|
||||||
GlobalWidgetsLocalizations.delegate,
|
final backgroundColor = HexColor(windowAppState.backgroundColor).withValues(alpha: .1);
|
||||||
GlobalCupertinoLocalizations.delegate,
|
|
||||||
FluentLocalizations.delegate,
|
return runApp(
|
||||||
S.delegate,
|
ProviderScope(
|
||||||
],
|
child: FluentApp(
|
||||||
supportedLocales: S.delegate.supportedLocales,
|
title: "StarCitizenToolBox",
|
||||||
home: windowWidget,
|
restorationScopeId: "StarCitizenToolBox",
|
||||||
theme: FluentThemeData(
|
themeMode: ThemeMode.dark,
|
||||||
|
localizationsDelegates: const [
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
FluentLocalizations.delegate,
|
||||||
|
S.delegate,
|
||||||
|
],
|
||||||
|
supportedLocales: S.delegate.supportedLocales,
|
||||||
|
home: windowWidget,
|
||||||
|
theme: FluentThemeData(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
fontFamily: "SourceHanSansCN-Regular",
|
fontFamily: "SourceHanSansCN-Regular",
|
||||||
navigationPaneTheme: NavigationPaneThemeData(
|
navigationPaneTheme: NavigationPaneThemeData(backgroundColor: backgroundColor),
|
||||||
backgroundColor: HexColor(windowAppState.backgroundColor),
|
|
||||||
),
|
|
||||||
menuColor: HexColor(windowAppState.menuColor),
|
menuColor: HexColor(windowAppState.menuColor),
|
||||||
micaBackgroundColor: HexColor(windowAppState.micaColor),
|
micaBackgroundColor: HexColor(windowAppState.micaColor),
|
||||||
|
scaffoldBackgroundColor: backgroundColor,
|
||||||
buttonTheme: ButtonThemeData(
|
buttonTheme: ButtonThemeData(
|
||||||
defaultButtonStyle: ButtonStyle(
|
defaultButtonStyle: ButtonStyle(
|
||||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
shape: WidgetStateProperty.all(
|
||||||
borderRadius: BorderRadius.circular(4),
|
RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Colors.white.withValues(alpha: .01)))),
|
borderRadius: BorderRadius.circular(4),
|
||||||
))),
|
side: BorderSide(color: Colors.white.withValues(alpha: .01)),
|
||||||
locale: windowAppState.languageCode != null
|
),
|
||||||
? Locale(windowAppState.languageCode!, windowAppState.countryCode)
|
),
|
||||||
: null,
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
),
|
||||||
|
),
|
||||||
|
locale: windowAppState.languageCode != null
|
||||||
|
? Locale(windowAppState.languageCode!, windowAppState.countryCode)
|
||||||
|
: null,
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Extension methods for WindowController to add custom functionality
|
||||||
|
extension WindowControllerExtension on WindowController {
|
||||||
|
/// Initialize custom window method handlers
|
||||||
|
Future<void> doCustomInitialize() async {
|
||||||
|
windowManager.ensureInitialized();
|
||||||
|
return await setWindowMethodHandler((call) async {
|
||||||
|
switch (call.method) {
|
||||||
|
case 'window_center':
|
||||||
|
return await windowManager.center();
|
||||||
|
case 'window_close':
|
||||||
|
return await windowManager.close();
|
||||||
|
case 'window_show':
|
||||||
|
return await windowManager.show();
|
||||||
|
case 'window_hide':
|
||||||
|
return await windowManager.hide();
|
||||||
|
case 'window_focus':
|
||||||
|
return await windowManager.focus();
|
||||||
|
case 'window_set_frame':
|
||||||
|
final args = call.arguments as Map;
|
||||||
|
return await windowManager.setBounds(
|
||||||
|
Rect.fromLTWH(
|
||||||
|
args['left'] as double,
|
||||||
|
args['top'] as double,
|
||||||
|
args['width'] as double,
|
||||||
|
args['height'] as double,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
case 'window_set_title':
|
||||||
|
return await windowManager.setTitle(call.arguments as String);
|
||||||
|
default:
|
||||||
|
throw MissingPluginException('Not implemented: ${call.method}');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Center the window
|
||||||
|
Future<void> center() {
|
||||||
|
return invokeMethod('window_center');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Close the window
|
||||||
|
void close() async {
|
||||||
|
await invokeMethod('window_close');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Show the window
|
||||||
|
Future<void> show() {
|
||||||
|
return invokeMethod('window_show');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Hide the window
|
||||||
|
Future<void> hide() {
|
||||||
|
return invokeMethod('window_hide');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Focus the window
|
||||||
|
Future<void> focus() {
|
||||||
|
return invokeMethod('window_focus');
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set window frame (position and size)
|
||||||
|
Future<void> setFrame(Rect frame) {
|
||||||
|
return invokeMethod('window_set_frame', {
|
||||||
|
'left': frame.left,
|
||||||
|
'top': frame.top,
|
||||||
|
'width': frame.width,
|
||||||
|
'height': frame.height,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Set window title
|
||||||
|
Future<void> setTitle(String title) {
|
||||||
|
return invokeMethod('window_set_title', title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
// ignore_for_file: type=lint
|
// 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
|
// 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
|
||||||
|
|
||||||
@ -9,282 +9,293 @@ part of 'multi_window_manager.dart';
|
|||||||
// FreezedGenerator
|
// FreezedGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
T _$identity<T>(T value) => value;
|
T _$identity<T>(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');
|
|
||||||
|
|
||||||
MultiWindowAppState _$MultiWindowAppStateFromJson(Map<String, dynamic> json) {
|
|
||||||
return _MultiWindowAppState.fromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$MultiWindowAppState {
|
mixin _$MultiWindowAppState {
|
||||||
String get backgroundColor => throw _privateConstructorUsedError;
|
|
||||||
String get menuColor => throw _privateConstructorUsedError;
|
String get backgroundColor; String get menuColor; String get micaColor; List<String> get gameInstallPaths; String? get languageCode; String? get countryCode; dynamic get windowsVersion;
|
||||||
String get micaColor => throw _privateConstructorUsedError;
|
/// Create a copy of MultiWindowAppState
|
||||||
List<String> get gameInstallPaths => throw _privateConstructorUsedError;
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
String? get languageCode => throw _privateConstructorUsedError;
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
String? get countryCode => throw _privateConstructorUsedError;
|
@pragma('vm:prefer-inline')
|
||||||
|
$MultiWindowAppStateCopyWith<MultiWindowAppState> get copyWith => _$MultiWindowAppStateCopyWithImpl<MultiWindowAppState>(this as MultiWindowAppState, _$identity);
|
||||||
|
|
||||||
/// Serializes this MultiWindowAppState to a JSON map.
|
/// Serializes this MultiWindowAppState to a JSON map.
|
||||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is MultiWindowAppState&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.menuColor, menuColor) || other.menuColor == menuColor)&&(identical(other.micaColor, micaColor) || other.micaColor == micaColor)&&const DeepCollectionEquality().equals(other.gameInstallPaths, gameInstallPaths)&&(identical(other.languageCode, languageCode) || other.languageCode == languageCode)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&const DeepCollectionEquality().equals(other.windowsVersion, windowsVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,backgroundColor,menuColor,micaColor,const DeepCollectionEquality().hash(gameInstallPaths),languageCode,countryCode,const DeepCollectionEquality().hash(windowsVersion));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'MultiWindowAppState(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor, gameInstallPaths: $gameInstallPaths, languageCode: $languageCode, countryCode: $countryCode, windowsVersion: $windowsVersion)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Create a copy of MultiWindowAppState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$MultiWindowAppStateCopyWith<MultiWindowAppState> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
abstract class $MultiWindowAppStateCopyWith<$Res> {
|
abstract mixin class $MultiWindowAppStateCopyWith<$Res> {
|
||||||
factory $MultiWindowAppStateCopyWith(
|
factory $MultiWindowAppStateCopyWith(MultiWindowAppState value, $Res Function(MultiWindowAppState) _then) = _$MultiWindowAppStateCopyWithImpl;
|
||||||
MultiWindowAppState value, $Res Function(MultiWindowAppState) then) =
|
@useResult
|
||||||
_$MultiWindowAppStateCopyWithImpl<$Res, MultiWindowAppState>;
|
$Res call({
|
||||||
@useResult
|
String backgroundColor, String menuColor, String micaColor, List<String> gameInstallPaths, String? languageCode, String? countryCode, dynamic windowsVersion
|
||||||
$Res call(
|
});
|
||||||
{String backgroundColor,
|
|
||||||
String menuColor,
|
|
||||||
String micaColor,
|
|
||||||
List<String> gameInstallPaths,
|
|
||||||
String? languageCode,
|
|
||||||
String? countryCode});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
class _$MultiWindowAppStateCopyWithImpl<$Res, $Val extends MultiWindowAppState>
|
class _$MultiWindowAppStateCopyWithImpl<$Res>
|
||||||
implements $MultiWindowAppStateCopyWith<$Res> {
|
implements $MultiWindowAppStateCopyWith<$Res> {
|
||||||
_$MultiWindowAppStateCopyWithImpl(this._value, this._then);
|
_$MultiWindowAppStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
// ignore: unused_field
|
final MultiWindowAppState _self;
|
||||||
final $Val _value;
|
final $Res Function(MultiWindowAppState) _then;
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of MultiWindowAppState
|
/// Create a copy of MultiWindowAppState
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
@pragma('vm:prefer-inline')
|
@pragma('vm:prefer-inline') @override $Res call({Object? backgroundColor = null,Object? menuColor = null,Object? micaColor = null,Object? gameInstallPaths = null,Object? languageCode = freezed,Object? countryCode = freezed,Object? windowsVersion = freezed,}) {
|
||||||
@override
|
return _then(_self.copyWith(
|
||||||
$Res call({
|
backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? backgroundColor = null,
|
as String,menuColor: null == menuColor ? _self.menuColor : menuColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? menuColor = null,
|
as String,micaColor: null == micaColor ? _self.micaColor : micaColor // ignore: cast_nullable_to_non_nullable
|
||||||
Object? micaColor = null,
|
as String,gameInstallPaths: null == gameInstallPaths ? _self.gameInstallPaths : gameInstallPaths // ignore: cast_nullable_to_non_nullable
|
||||||
Object? gameInstallPaths = null,
|
as List<String>,languageCode: freezed == languageCode ? _self.languageCode : languageCode // ignore: cast_nullable_to_non_nullable
|
||||||
Object? languageCode = freezed,
|
as String?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||||
Object? countryCode = freezed,
|
as String?,windowsVersion: freezed == windowsVersion ? _self.windowsVersion : windowsVersion // ignore: cast_nullable_to_non_nullable
|
||||||
}) {
|
as dynamic,
|
||||||
return _then(_value.copyWith(
|
));
|
||||||
backgroundColor: null == backgroundColor
|
|
||||||
? _value.backgroundColor
|
|
||||||
: backgroundColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
menuColor: null == menuColor
|
|
||||||
? _value.menuColor
|
|
||||||
: menuColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
micaColor: null == micaColor
|
|
||||||
? _value.micaColor
|
|
||||||
: micaColor // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
gameInstallPaths: null == gameInstallPaths
|
|
||||||
? _value.gameInstallPaths
|
|
||||||
: gameInstallPaths // ignore: cast_nullable_to_non_nullable
|
|
||||||
as List<String>,
|
|
||||||
languageCode: freezed == languageCode
|
|
||||||
? _value.languageCode
|
|
||||||
: languageCode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
countryCode: freezed == countryCode
|
|
||||||
? _value.countryCode
|
|
||||||
: countryCode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$MultiWindowAppStateImplCopyWith<$Res>
|
|
||||||
implements $MultiWindowAppStateCopyWith<$Res> {
|
|
||||||
factory _$$MultiWindowAppStateImplCopyWith(_$MultiWindowAppStateImpl value,
|
|
||||||
$Res Function(_$MultiWindowAppStateImpl) then) =
|
|
||||||
__$$MultiWindowAppStateImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String backgroundColor,
|
|
||||||
String menuColor,
|
|
||||||
String micaColor,
|
|
||||||
List<String> gameInstallPaths,
|
|
||||||
String? languageCode,
|
|
||||||
String? countryCode});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$MultiWindowAppStateImplCopyWithImpl<$Res>
|
|
||||||
extends _$MultiWindowAppStateCopyWithImpl<$Res, _$MultiWindowAppStateImpl>
|
|
||||||
implements _$$MultiWindowAppStateImplCopyWith<$Res> {
|
|
||||||
__$$MultiWindowAppStateImplCopyWithImpl(_$MultiWindowAppStateImpl _value,
|
|
||||||
$Res Function(_$MultiWindowAppStateImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of MultiWindowAppState
|
/// Adds pattern-matching-related methods to [MultiWindowAppState].
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
extension MultiWindowAppStatePatterns on MultiWindowAppState {
|
||||||
@pragma('vm:prefer-inline')
|
/// A variant of `map` that fallback to returning `orElse`.
|
||||||
@override
|
///
|
||||||
$Res call({
|
/// It is equivalent to doing:
|
||||||
Object? backgroundColor = null,
|
/// ```dart
|
||||||
Object? menuColor = null,
|
/// switch (sealedClass) {
|
||||||
Object? micaColor = null,
|
/// case final Subclass value:
|
||||||
Object? gameInstallPaths = null,
|
/// return ...;
|
||||||
Object? languageCode = freezed,
|
/// case _:
|
||||||
Object? countryCode = freezed,
|
/// return orElse();
|
||||||
}) {
|
/// }
|
||||||
return _then(_$MultiWindowAppStateImpl(
|
/// ```
|
||||||
backgroundColor: null == backgroundColor
|
|
||||||
? _value.backgroundColor
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _MultiWindowAppState value)? $default,{required TResult orElse(),}){
|
||||||
: backgroundColor // ignore: cast_nullable_to_non_nullable
|
final _that = this;
|
||||||
as String,
|
switch (_that) {
|
||||||
menuColor: null == menuColor
|
case _MultiWindowAppState() when $default != null:
|
||||||
? _value.menuColor
|
return $default(_that);case _:
|
||||||
: menuColor // ignore: cast_nullable_to_non_nullable
|
return orElse();
|
||||||
as String,
|
|
||||||
micaColor: null == micaColor
|
}
|
||||||
? _value.micaColor
|
}
|
||||||
: micaColor // ignore: cast_nullable_to_non_nullable
|
/// A `switch`-like method, using callbacks.
|
||||||
as String,
|
///
|
||||||
gameInstallPaths: null == gameInstallPaths
|
/// Callbacks receives the raw object, upcasted.
|
||||||
? _value._gameInstallPaths
|
/// It is equivalent to doing:
|
||||||
: gameInstallPaths // ignore: cast_nullable_to_non_nullable
|
/// ```dart
|
||||||
as List<String>,
|
/// switch (sealedClass) {
|
||||||
languageCode: freezed == languageCode
|
/// case final Subclass value:
|
||||||
? _value.languageCode
|
/// return ...;
|
||||||
: languageCode // ignore: cast_nullable_to_non_nullable
|
/// case final Subclass2 value:
|
||||||
as String?,
|
/// return ...;
|
||||||
countryCode: freezed == countryCode
|
/// }
|
||||||
? _value.countryCode
|
/// ```
|
||||||
: countryCode // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String?,
|
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _MultiWindowAppState value) $default,){
|
||||||
));
|
final _that = this;
|
||||||
}
|
switch (_that) {
|
||||||
|
case _MultiWindowAppState():
|
||||||
|
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 extends Object?>(TResult? Function( _MultiWindowAppState value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _MultiWindowAppState() 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 extends Object?>(TResult Function( String backgroundColor, String menuColor, String micaColor, List<String> gameInstallPaths, String? languageCode, String? countryCode, dynamic windowsVersion)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _MultiWindowAppState() when $default != null:
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor,_that.gameInstallPaths,_that.languageCode,_that.countryCode,_that.windowsVersion);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 extends Object?>(TResult Function( String backgroundColor, String menuColor, String micaColor, List<String> gameInstallPaths, String? languageCode, String? countryCode, dynamic windowsVersion) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _MultiWindowAppState():
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor,_that.gameInstallPaths,_that.languageCode,_that.countryCode,_that.windowsVersion);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 extends Object?>(TResult? Function( String backgroundColor, String menuColor, String micaColor, List<String> gameInstallPaths, String? languageCode, String? countryCode, dynamic windowsVersion)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _MultiWindowAppState() when $default != null:
|
||||||
|
return $default(_that.backgroundColor,_that.menuColor,_that.micaColor,_that.gameInstallPaths,_that.languageCode,_that.countryCode,_that.windowsVersion);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class _$MultiWindowAppStateImpl implements _MultiWindowAppState {
|
|
||||||
const _$MultiWindowAppStateImpl(
|
|
||||||
{required this.backgroundColor,
|
|
||||||
required this.menuColor,
|
|
||||||
required this.micaColor,
|
|
||||||
required final List<String> gameInstallPaths,
|
|
||||||
this.languageCode,
|
|
||||||
this.countryCode})
|
|
||||||
: _gameInstallPaths = gameInstallPaths;
|
|
||||||
|
|
||||||
factory _$MultiWindowAppStateImpl.fromJson(Map<String, dynamic> json) =>
|
class _MultiWindowAppState implements MultiWindowAppState {
|
||||||
_$$MultiWindowAppStateImplFromJson(json);
|
const _MultiWindowAppState({required this.backgroundColor, required this.menuColor, required this.micaColor, required final List<String> gameInstallPaths, this.languageCode, this.countryCode, this.windowsVersion = 10}): _gameInstallPaths = gameInstallPaths;
|
||||||
|
factory _MultiWindowAppState.fromJson(Map<String, dynamic> json) => _$MultiWindowAppStateFromJson(json);
|
||||||
|
|
||||||
@override
|
@override final String backgroundColor;
|
||||||
final String backgroundColor;
|
@override final String menuColor;
|
||||||
@override
|
@override final String micaColor;
|
||||||
final String menuColor;
|
final List<String> _gameInstallPaths;
|
||||||
@override
|
@override List<String> get gameInstallPaths {
|
||||||
final String micaColor;
|
if (_gameInstallPaths is EqualUnmodifiableListView) return _gameInstallPaths;
|
||||||
final List<String> _gameInstallPaths;
|
// ignore: implicit_dynamic_type
|
||||||
@override
|
return EqualUnmodifiableListView(_gameInstallPaths);
|
||||||
List<String> get gameInstallPaths {
|
|
||||||
if (_gameInstallPaths is EqualUnmodifiableListView)
|
|
||||||
return _gameInstallPaths;
|
|
||||||
// ignore: implicit_dynamic_type
|
|
||||||
return EqualUnmodifiableListView(_gameInstallPaths);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String? languageCode;
|
|
||||||
@override
|
|
||||||
final String? countryCode;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'MultiWindowAppState(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor, gameInstallPaths: $gameInstallPaths, languageCode: $languageCode, countryCode: $countryCode)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$MultiWindowAppStateImpl &&
|
|
||||||
(identical(other.backgroundColor, backgroundColor) ||
|
|
||||||
other.backgroundColor == backgroundColor) &&
|
|
||||||
(identical(other.menuColor, menuColor) ||
|
|
||||||
other.menuColor == menuColor) &&
|
|
||||||
(identical(other.micaColor, micaColor) ||
|
|
||||||
other.micaColor == micaColor) &&
|
|
||||||
const DeepCollectionEquality()
|
|
||||||
.equals(other._gameInstallPaths, _gameInstallPaths) &&
|
|
||||||
(identical(other.languageCode, languageCode) ||
|
|
||||||
other.languageCode == languageCode) &&
|
|
||||||
(identical(other.countryCode, countryCode) ||
|
|
||||||
other.countryCode == countryCode));
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
int get hashCode => Object.hash(
|
|
||||||
runtimeType,
|
|
||||||
backgroundColor,
|
|
||||||
menuColor,
|
|
||||||
micaColor,
|
|
||||||
const DeepCollectionEquality().hash(_gameInstallPaths),
|
|
||||||
languageCode,
|
|
||||||
countryCode);
|
|
||||||
|
|
||||||
/// Create a copy of MultiWindowAppState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$MultiWindowAppStateImplCopyWith<_$MultiWindowAppStateImpl> get copyWith =>
|
|
||||||
__$$MultiWindowAppStateImplCopyWithImpl<_$MultiWindowAppStateImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
return _$$MultiWindowAppStateImplToJson(
|
|
||||||
this,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _MultiWindowAppState implements MultiWindowAppState {
|
@override final String? languageCode;
|
||||||
const factory _MultiWindowAppState(
|
@override final String? countryCode;
|
||||||
{required final String backgroundColor,
|
@override@JsonKey() final dynamic windowsVersion;
|
||||||
required final String menuColor,
|
|
||||||
required final String micaColor,
|
|
||||||
required final List<String> gameInstallPaths,
|
|
||||||
final String? languageCode,
|
|
||||||
final String? countryCode}) = _$MultiWindowAppStateImpl;
|
|
||||||
|
|
||||||
factory _MultiWindowAppState.fromJson(Map<String, dynamic> json) =
|
/// Create a copy of MultiWindowAppState
|
||||||
_$MultiWindowAppStateImpl.fromJson;
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$MultiWindowAppStateCopyWith<_MultiWindowAppState> get copyWith => __$MultiWindowAppStateCopyWithImpl<_MultiWindowAppState>(this, _$identity);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get backgroundColor;
|
Map<String, dynamic> toJson() {
|
||||||
@override
|
return _$MultiWindowAppStateToJson(this, );
|
||||||
String get menuColor;
|
|
||||||
@override
|
|
||||||
String get micaColor;
|
|
||||||
@override
|
|
||||||
List<String> get gameInstallPaths;
|
|
||||||
@override
|
|
||||||
String? get languageCode;
|
|
||||||
@override
|
|
||||||
String? get countryCode;
|
|
||||||
|
|
||||||
/// Create a copy of MultiWindowAppState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$MultiWindowAppStateImplCopyWith<_$MultiWindowAppStateImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MultiWindowAppState&&(identical(other.backgroundColor, backgroundColor) || other.backgroundColor == backgroundColor)&&(identical(other.menuColor, menuColor) || other.menuColor == menuColor)&&(identical(other.micaColor, micaColor) || other.micaColor == micaColor)&&const DeepCollectionEquality().equals(other._gameInstallPaths, _gameInstallPaths)&&(identical(other.languageCode, languageCode) || other.languageCode == languageCode)&&(identical(other.countryCode, countryCode) || other.countryCode == countryCode)&&const DeepCollectionEquality().equals(other.windowsVersion, windowsVersion));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,backgroundColor,menuColor,micaColor,const DeepCollectionEquality().hash(_gameInstallPaths),languageCode,countryCode,const DeepCollectionEquality().hash(windowsVersion));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'MultiWindowAppState(backgroundColor: $backgroundColor, menuColor: $menuColor, micaColor: $micaColor, gameInstallPaths: $gameInstallPaths, languageCode: $languageCode, countryCode: $countryCode, windowsVersion: $windowsVersion)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$MultiWindowAppStateCopyWith<$Res> implements $MultiWindowAppStateCopyWith<$Res> {
|
||||||
|
factory _$MultiWindowAppStateCopyWith(_MultiWindowAppState value, $Res Function(_MultiWindowAppState) _then) = __$MultiWindowAppStateCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
String backgroundColor, String menuColor, String micaColor, List<String> gameInstallPaths, String? languageCode, String? countryCode, dynamic windowsVersion
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$MultiWindowAppStateCopyWithImpl<$Res>
|
||||||
|
implements _$MultiWindowAppStateCopyWith<$Res> {
|
||||||
|
__$MultiWindowAppStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _MultiWindowAppState _self;
|
||||||
|
final $Res Function(_MultiWindowAppState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of MultiWindowAppState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? backgroundColor = null,Object? menuColor = null,Object? micaColor = null,Object? gameInstallPaths = null,Object? languageCode = freezed,Object? countryCode = freezed,Object? windowsVersion = freezed,}) {
|
||||||
|
return _then(_MultiWindowAppState(
|
||||||
|
backgroundColor: null == backgroundColor ? _self.backgroundColor : backgroundColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,menuColor: null == menuColor ? _self.menuColor : menuColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,micaColor: null == micaColor ? _self.micaColor : micaColor // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,gameInstallPaths: null == gameInstallPaths ? _self._gameInstallPaths : gameInstallPaths // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<String>,languageCode: freezed == languageCode ? _self.languageCode : languageCode // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,countryCode: freezed == countryCode ? _self.countryCode : countryCode // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,windowsVersion: freezed == windowsVersion ? _self.windowsVersion : windowsVersion // ignore: cast_nullable_to_non_nullable
|
||||||
|
as dynamic,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
|
|||||||
@ -6,9 +6,8 @@ part of 'multi_window_manager.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
_$MultiWindowAppStateImpl _$$MultiWindowAppStateImplFromJson(
|
_MultiWindowAppState _$MultiWindowAppStateFromJson(Map<String, dynamic> json) =>
|
||||||
Map<String, dynamic> json) =>
|
_MultiWindowAppState(
|
||||||
_$MultiWindowAppStateImpl(
|
|
||||||
backgroundColor: json['backgroundColor'] as String,
|
backgroundColor: json['backgroundColor'] as String,
|
||||||
menuColor: json['menuColor'] as String,
|
menuColor: json['menuColor'] as String,
|
||||||
micaColor: json['micaColor'] as String,
|
micaColor: json['micaColor'] as String,
|
||||||
@ -17,15 +16,17 @@ _$MultiWindowAppStateImpl _$$MultiWindowAppStateImplFromJson(
|
|||||||
.toList(),
|
.toList(),
|
||||||
languageCode: json['languageCode'] as String?,
|
languageCode: json['languageCode'] as String?,
|
||||||
countryCode: json['countryCode'] as String?,
|
countryCode: json['countryCode'] as String?,
|
||||||
|
windowsVersion: json['windowsVersion'] ?? 10,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$MultiWindowAppStateImplToJson(
|
Map<String, dynamic> _$MultiWindowAppStateToJson(
|
||||||
_$MultiWindowAppStateImpl instance) =>
|
_MultiWindowAppState instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'backgroundColor': instance.backgroundColor,
|
'backgroundColor': instance.backgroundColor,
|
||||||
'menuColor': instance.menuColor,
|
'menuColor': instance.menuColor,
|
||||||
'micaColor': instance.micaColor,
|
'micaColor': instance.micaColor,
|
||||||
'gameInstallPaths': instance.gameInstallPaths,
|
'gameInstallPaths': instance.gameInstallPaths,
|
||||||
'languageCode': instance.languageCode,
|
'languageCode': instance.languageCode,
|
||||||
'countryCode': instance.countryCode,
|
'countryCode': instance.countryCode,
|
||||||
};
|
'windowsVersion': instance.windowsVersion,
|
||||||
|
};
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
// ignore_for_file: invalid_use_of_protected_member
|
||||||
|
|
||||||
import 'package:hive_ce/hive.dart';
|
import 'package:hive_ce/hive.dart';
|
||||||
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:starcitizen_doctor/app.dart';
|
import 'package:starcitizen_doctor/app.dart';
|
||||||
|
|
||||||
extension ProviderExtension on AutoDisposeNotifier {
|
extension ProviderExtension<T> on $Notifier<T> {
|
||||||
AppGlobalModel get appGlobalModel =>
|
AppGlobalModel get appGlobalModel => ref.read(appGlobalModelProvider.notifier);
|
||||||
ref.read(appGlobalModelProvider.notifier);
|
|
||||||
|
|
||||||
AppGlobalState get appGlobalState => ref.read(appGlobalModelProvider);
|
AppGlobalState get appGlobalState => ref.read(appGlobalModelProvider);
|
||||||
|
|
||||||
|
|||||||
121
lib/common/utils/url_scheme_handler.dart
Normal file
121
lib/common/utils/url_scheme_handler.dart
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:app_links/app_links.dart';
|
||||||
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
import 'package:starcitizen_doctor/ui/auth/auth_page.dart';
|
||||||
|
|
||||||
|
/// URL Scheme handler for deep linking
|
||||||
|
/// Handles: sctoolbox://auth?callbackUrl=https://example.com
|
||||||
|
class UrlSchemeHandler {
|
||||||
|
static final UrlSchemeHandler _instance = UrlSchemeHandler._internal();
|
||||||
|
factory UrlSchemeHandler() => _instance;
|
||||||
|
UrlSchemeHandler._internal();
|
||||||
|
|
||||||
|
final _appLinks = AppLinks();
|
||||||
|
StreamSubscription<Uri>? _linkSubscription;
|
||||||
|
BuildContext? _context;
|
||||||
|
|
||||||
|
// Debouncing variables
|
||||||
|
String? _lastHandledUri;
|
||||||
|
DateTime? _lastHandledTime;
|
||||||
|
static const _debounceDuration = Duration(seconds: 2);
|
||||||
|
|
||||||
|
/// Initialize URL scheme handler
|
||||||
|
Future<void> initialize(BuildContext context) async {
|
||||||
|
_context = context;
|
||||||
|
|
||||||
|
// Handle initial link when app is launched via URL scheme
|
||||||
|
try {
|
||||||
|
final initialUri = await _appLinks.getInitialLink();
|
||||||
|
if (initialUri != null) {
|
||||||
|
dPrint('Initial URI: $initialUri');
|
||||||
|
_handleUri(initialUri);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('Failed to get initial URI: $e');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle links while app is running
|
||||||
|
_linkSubscription = _appLinks.uriLinkStream.listen(
|
||||||
|
(uri) {
|
||||||
|
dPrint('Received URI: $uri');
|
||||||
|
_handleUri(uri);
|
||||||
|
},
|
||||||
|
onError: (err) {
|
||||||
|
dPrint('URI link stream error: $err');
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Handle incoming URI with debouncing
|
||||||
|
void _handleUri(Uri uri) {
|
||||||
|
final uriString = uri.toString();
|
||||||
|
final now = DateTime.now();
|
||||||
|
|
||||||
|
// Check if this is a duplicate URI within debounce duration
|
||||||
|
if (_lastHandledUri == uriString && _lastHandledTime != null) {
|
||||||
|
final timeSinceLastHandle = now.difference(_lastHandledTime!);
|
||||||
|
if (timeSinceLastHandle < _debounceDuration) {
|
||||||
|
dPrint('Debounced duplicate URI: $uriString (${timeSinceLastHandle.inMilliseconds}ms since last)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update last handled URI and time
|
||||||
|
_lastHandledUri = uriString;
|
||||||
|
_lastHandledTime = now;
|
||||||
|
|
||||||
|
dPrint('Handling URI: $uri');
|
||||||
|
|
||||||
|
// Check if it's an auth request
|
||||||
|
// Check if it's an auth request
|
||||||
|
// Expected format: sctoolbox://auth?callbackUrl=https://example.com&state=...&nonce=...
|
||||||
|
// Note: old format with domain in path (sctoolbox://auth/domain?...) is also supported but domain is ignored
|
||||||
|
if (uri.scheme == 'sctoolbox' && uri.host == 'auth') {
|
||||||
|
final callbackUrl = uri.queryParameters['callbackUrl'];
|
||||||
|
final state = uri.queryParameters['state'];
|
||||||
|
final nonce = uri.queryParameters['nonce'];
|
||||||
|
|
||||||
|
if (callbackUrl == null || callbackUrl.isEmpty) {
|
||||||
|
dPrint('Invalid auth URI: missing callbackUrl parameter');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == null || state.isEmpty) {
|
||||||
|
dPrint('Invalid auth URI: missing state parameter');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dPrint('Auth request - callbackUrl: $callbackUrl, state: $state');
|
||||||
|
_showAuthDialog(callbackUrl, state, nonce);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Show auth dialog
|
||||||
|
void _showAuthDialog(String callbackUrl, String state, String? nonce) {
|
||||||
|
if (_context == null || !_context!.mounted) {
|
||||||
|
dPrint('Cannot show auth dialog: context not available');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: _context!,
|
||||||
|
builder: (context) => AuthPage(callbackUrl: callbackUrl, stateParameter: state, nonce: nonce),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Dispose the handler
|
||||||
|
void dispose() {
|
||||||
|
_linkSubscription?.cancel();
|
||||||
|
_linkSubscription = null;
|
||||||
|
_context = null;
|
||||||
|
_lastHandledUri = null;
|
||||||
|
_lastHandledTime = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Update context (useful when switching screens)
|
||||||
|
void updateContext(BuildContext context) {
|
||||||
|
_context = context;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,46 +2,25 @@
|
|||||||
/// size : 524288
|
/// size : 524288
|
||||||
/// compressedSize : 169812
|
/// compressedSize : 169812
|
||||||
/// isDirectory : false
|
/// isDirectory : false
|
||||||
/// isFile : true
|
|
||||||
/// isEncrypted : false
|
|
||||||
/// isUnicodeText : false
|
|
||||||
/// dateTime : "2019-12-16T15:11:18"
|
|
||||||
/// version : 45
|
|
||||||
|
|
||||||
class AppUnp4kP4kItemData {
|
class AppUnp4kP4kItemData {
|
||||||
AppUnp4kP4kItemData({
|
AppUnp4kP4kItemData({this.name, this.size, this.compressedSize, this.isDirectory, this.dateModified});
|
||||||
this.name,
|
|
||||||
this.size,
|
|
||||||
this.compressedSize,
|
|
||||||
this.isDirectory,
|
|
||||||
this.isFile,
|
|
||||||
this.isEncrypted,
|
|
||||||
this.isUnicodeText,
|
|
||||||
this.dateTime,
|
|
||||||
this.version,
|
|
||||||
});
|
|
||||||
|
|
||||||
AppUnp4kP4kItemData.fromJson(dynamic json) {
|
AppUnp4kP4kItemData.fromJson(dynamic json) {
|
||||||
name = json['name'];
|
name = json['name'];
|
||||||
size = json['size'];
|
size = json['size'];
|
||||||
compressedSize = json['compressedSize'];
|
compressedSize = json['compressedSize'];
|
||||||
isDirectory = json['isDirectory'];
|
isDirectory = json['isDirectory'];
|
||||||
isFile = json['isFile'];
|
dateModified = json['dateModified'];
|
||||||
isEncrypted = json['isEncrypted'];
|
|
||||||
isUnicodeText = json['isUnicodeText'];
|
|
||||||
dateTime = json['dateTime'];
|
|
||||||
version = json['version'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String? name;
|
String? name;
|
||||||
num? size;
|
num? size;
|
||||||
num? compressedSize;
|
num? compressedSize;
|
||||||
bool? isDirectory;
|
bool? isDirectory;
|
||||||
bool? isFile;
|
|
||||||
bool? isEncrypted;
|
/// 文件修改时间(毫秒时间戳)
|
||||||
bool? isUnicodeText;
|
int? dateModified;
|
||||||
String? dateTime;
|
|
||||||
num? version;
|
|
||||||
List<AppUnp4kP4kItemData> children = [];
|
List<AppUnp4kP4kItemData> children = [];
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -50,11 +29,7 @@ class AppUnp4kP4kItemData {
|
|||||||
map['size'] = size;
|
map['size'] = size;
|
||||||
map['compressedSize'] = compressedSize;
|
map['compressedSize'] = compressedSize;
|
||||||
map['isDirectory'] = isDirectory;
|
map['isDirectory'] = isDirectory;
|
||||||
map['isFile'] = isFile;
|
map['dateModified'] = dateModified;
|
||||||
map['isEncrypted'] = isEncrypted;
|
|
||||||
map['isUnicodeText'] = isUnicodeText;
|
|
||||||
map['dateTime'] = dateTime;
|
|
||||||
map['version'] = version;
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
54
lib/data/citizen_news_data.dart
Normal file
54
lib/data/citizen_news_data.dart
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|
||||||
|
part 'citizen_news_data.freezed.dart';
|
||||||
|
|
||||||
|
part 'citizen_news_data.g.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
sealed class CitizenNewsData with _$CitizenNewsData {
|
||||||
|
const factory CitizenNewsData({
|
||||||
|
@Default(<CitizenNewsVideosItemData>[]) @JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos,
|
||||||
|
@Default(<CitizenNewsArticlesItemData>[]) @JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles,
|
||||||
|
}) = _CitizenNewsData;
|
||||||
|
|
||||||
|
const CitizenNewsData._();
|
||||||
|
|
||||||
|
factory CitizenNewsData.fromJson(Map<String, Object?> json) => _$CitizenNewsDataFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
sealed class CitizenNewsVideosItemData with _$CitizenNewsVideosItemData {
|
||||||
|
const factory CitizenNewsVideosItemData({
|
||||||
|
@Default('') @JsonKey(name: 'title') String title,
|
||||||
|
@Default('') @JsonKey(name: 'author') String author,
|
||||||
|
@Default('') @JsonKey(name: 'description') String description,
|
||||||
|
@Default('') @JsonKey(name: 'link') String link,
|
||||||
|
@Default('') @JsonKey(name: 'pubDate') String pubDate,
|
||||||
|
@Default('') @JsonKey(name: 'postId') String postId,
|
||||||
|
@Default(<String>[]) @JsonKey(name: 'detailedDescription') List<String> detailedDescription,
|
||||||
|
@Default('') @JsonKey(name: 'tag') String tag,
|
||||||
|
}) = _CitizenNewsVideosItemData;
|
||||||
|
|
||||||
|
const CitizenNewsVideosItemData._();
|
||||||
|
|
||||||
|
factory CitizenNewsVideosItemData.fromJson(Map<String, Object?> json) => _$CitizenNewsVideosItemDataFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
sealed class CitizenNewsArticlesItemData with _$CitizenNewsArticlesItemData {
|
||||||
|
const factory CitizenNewsArticlesItemData({
|
||||||
|
@Default('') @JsonKey(name: 'title') String title,
|
||||||
|
@Default('') @JsonKey(name: 'author') String author,
|
||||||
|
@Default('') @JsonKey(name: 'description') String description,
|
||||||
|
@Default('') @JsonKey(name: 'link') String link,
|
||||||
|
@Default('') @JsonKey(name: 'pubDate') String pubDate,
|
||||||
|
@Default('') @JsonKey(name: 'postId') String postId,
|
||||||
|
@Default(<String>[]) @JsonKey(name: 'detailedDescription') List<String> detailedDescription,
|
||||||
|
@Default('') @JsonKey(name: 'tag') String tag,
|
||||||
|
}) = _CitizenNewsArticlesItemData;
|
||||||
|
|
||||||
|
const CitizenNewsArticlesItemData._();
|
||||||
|
|
||||||
|
factory CitizenNewsArticlesItemData.fromJson(Map<String, Object?> json) =>
|
||||||
|
_$CitizenNewsArticlesItemDataFromJson(json);
|
||||||
|
}
|
||||||
854
lib/data/citizen_news_data.freezed.dart
Normal file
854
lib/data/citizen_news_data.freezed.dart
Normal file
@ -0,0 +1,854 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
|
// 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 'citizen_news_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$CitizenNewsData {
|
||||||
|
|
||||||
|
@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> get videos;@JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> get articles;
|
||||||
|
/// Create a copy of CitizenNewsData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$CitizenNewsDataCopyWith<CitizenNewsData> get copyWith => _$CitizenNewsDataCopyWithImpl<CitizenNewsData>(this as CitizenNewsData, _$identity);
|
||||||
|
|
||||||
|
/// Serializes this CitizenNewsData to a JSON map.
|
||||||
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CitizenNewsData&&const DeepCollectionEquality().equals(other.videos, videos)&&const DeepCollectionEquality().equals(other.articles, articles));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(videos),const DeepCollectionEquality().hash(articles));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsData(videos: $videos, articles: $articles)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $CitizenNewsDataCopyWith<$Res> {
|
||||||
|
factory $CitizenNewsDataCopyWith(CitizenNewsData value, $Res Function(CitizenNewsData) _then) = _$CitizenNewsDataCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos,@JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$CitizenNewsDataCopyWithImpl<$Res>
|
||||||
|
implements $CitizenNewsDataCopyWith<$Res> {
|
||||||
|
_$CitizenNewsDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final CitizenNewsData _self;
|
||||||
|
final $Res Function(CitizenNewsData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? videos = null,Object? articles = null,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
videos: null == videos ? _self.videos : videos // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<CitizenNewsVideosItemData>,articles: null == articles ? _self.articles : articles // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<CitizenNewsArticlesItemData>,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [CitizenNewsData].
|
||||||
|
extension CitizenNewsDataPatterns on CitizenNewsData {
|
||||||
|
/// 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 extends Object?>(TResult Function( _CitizenNewsData value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData() 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 extends Object?>(TResult Function( _CitizenNewsData value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData():
|
||||||
|
return $default(_that);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function( _CitizenNewsData value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData() 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 extends Object?>(TResult Function(@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos, @JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData() when $default != null:
|
||||||
|
return $default(_that.videos,_that.articles);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 extends Object?>(TResult Function(@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos, @JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData():
|
||||||
|
return $default(_that.videos,_that.articles);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function(@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos, @JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsData() when $default != null:
|
||||||
|
return $default(_that.videos,_that.articles);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
|
||||||
|
class _CitizenNewsData extends CitizenNewsData {
|
||||||
|
const _CitizenNewsData({@JsonKey(name: 'videos') final List<CitizenNewsVideosItemData> videos = const <CitizenNewsVideosItemData>[], @JsonKey(name: 'articles') final List<CitizenNewsArticlesItemData> articles = const <CitizenNewsArticlesItemData>[]}): _videos = videos,_articles = articles,super._();
|
||||||
|
factory _CitizenNewsData.fromJson(Map<String, dynamic> json) => _$CitizenNewsDataFromJson(json);
|
||||||
|
|
||||||
|
final List<CitizenNewsVideosItemData> _videos;
|
||||||
|
@override@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> get videos {
|
||||||
|
if (_videos is EqualUnmodifiableListView) return _videos;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_videos);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<CitizenNewsArticlesItemData> _articles;
|
||||||
|
@override@JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> get articles {
|
||||||
|
if (_articles is EqualUnmodifiableListView) return _articles;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_articles);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$CitizenNewsDataCopyWith<_CitizenNewsData> get copyWith => __$CitizenNewsDataCopyWithImpl<_CitizenNewsData>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$CitizenNewsDataToJson(this, );
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CitizenNewsData&&const DeepCollectionEquality().equals(other._videos, _videos)&&const DeepCollectionEquality().equals(other._articles, _articles));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_videos),const DeepCollectionEquality().hash(_articles));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsData(videos: $videos, articles: $articles)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$CitizenNewsDataCopyWith<$Res> implements $CitizenNewsDataCopyWith<$Res> {
|
||||||
|
factory _$CitizenNewsDataCopyWith(_CitizenNewsData value, $Res Function(_CitizenNewsData) _then) = __$CitizenNewsDataCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'videos') List<CitizenNewsVideosItemData> videos,@JsonKey(name: 'articles') List<CitizenNewsArticlesItemData> articles
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$CitizenNewsDataCopyWithImpl<$Res>
|
||||||
|
implements _$CitizenNewsDataCopyWith<$Res> {
|
||||||
|
__$CitizenNewsDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _CitizenNewsData _self;
|
||||||
|
final $Res Function(_CitizenNewsData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? videos = null,Object? articles = null,}) {
|
||||||
|
return _then(_CitizenNewsData(
|
||||||
|
videos: null == videos ? _self._videos : videos // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<CitizenNewsVideosItemData>,articles: null == articles ? _self._articles : articles // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<CitizenNewsArticlesItemData>,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$CitizenNewsVideosItemData {
|
||||||
|
|
||||||
|
@JsonKey(name: 'title') String get title;@JsonKey(name: 'author') String get author;@JsonKey(name: 'description') String get description;@JsonKey(name: 'link') String get link;@JsonKey(name: 'pubDate') String get pubDate;@JsonKey(name: 'postId') String get postId;@JsonKey(name: 'detailedDescription') List<String> get detailedDescription;@JsonKey(name: 'tag') String get tag;
|
||||||
|
/// Create a copy of CitizenNewsVideosItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$CitizenNewsVideosItemDataCopyWith<CitizenNewsVideosItemData> get copyWith => _$CitizenNewsVideosItemDataCopyWithImpl<CitizenNewsVideosItemData>(this as CitizenNewsVideosItemData, _$identity);
|
||||||
|
|
||||||
|
/// Serializes this CitizenNewsVideosItemData to a JSON map.
|
||||||
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CitizenNewsVideosItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.author, author) || other.author == author)&&(identical(other.description, description) || other.description == description)&&(identical(other.link, link) || other.link == link)&&(identical(other.pubDate, pubDate) || other.pubDate == pubDate)&&(identical(other.postId, postId) || other.postId == postId)&&const DeepCollectionEquality().equals(other.detailedDescription, detailedDescription)&&(identical(other.tag, tag) || other.tag == tag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,title,author,description,link,pubDate,postId,const DeepCollectionEquality().hash(detailedDescription),tag);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsVideosItemData(title: $title, author: $author, description: $description, link: $link, pubDate: $pubDate, postId: $postId, detailedDescription: $detailedDescription, tag: $tag)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $CitizenNewsVideosItemDataCopyWith<$Res> {
|
||||||
|
factory $CitizenNewsVideosItemDataCopyWith(CitizenNewsVideosItemData value, $Res Function(CitizenNewsVideosItemData) _then) = _$CitizenNewsVideosItemDataCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'title') String title,@JsonKey(name: 'author') String author,@JsonKey(name: 'description') String description,@JsonKey(name: 'link') String link,@JsonKey(name: 'pubDate') String pubDate,@JsonKey(name: 'postId') String postId,@JsonKey(name: 'detailedDescription') List<String> detailedDescription,@JsonKey(name: 'tag') String tag
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$CitizenNewsVideosItemDataCopyWithImpl<$Res>
|
||||||
|
implements $CitizenNewsVideosItemDataCopyWith<$Res> {
|
||||||
|
_$CitizenNewsVideosItemDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final CitizenNewsVideosItemData _self;
|
||||||
|
final $Res Function(CitizenNewsVideosItemData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsVideosItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? title = null,Object? author = null,Object? description = null,Object? link = null,Object? pubDate = null,Object? postId = null,Object? detailedDescription = null,Object? tag = null,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,pubDate: null == pubDate ? _self.pubDate : pubDate // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,detailedDescription: null == detailedDescription ? _self.detailedDescription : detailedDescription // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<String>,tag: null == tag ? _self.tag : tag // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [CitizenNewsVideosItemData].
|
||||||
|
extension CitizenNewsVideosItemDataPatterns on CitizenNewsVideosItemData {
|
||||||
|
/// 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 extends Object?>(TResult Function( _CitizenNewsVideosItemData value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData() 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 extends Object?>(TResult Function( _CitizenNewsVideosItemData value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData():
|
||||||
|
return $default(_that);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function( _CitizenNewsVideosItemData value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData() 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 extends Object?>(TResult Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData() when $default != null:
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);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 extends Object?>(TResult Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData():
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsVideosItemData() when $default != null:
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
|
||||||
|
class _CitizenNewsVideosItemData extends CitizenNewsVideosItemData {
|
||||||
|
const _CitizenNewsVideosItemData({@JsonKey(name: 'title') this.title = '', @JsonKey(name: 'author') this.author = '', @JsonKey(name: 'description') this.description = '', @JsonKey(name: 'link') this.link = '', @JsonKey(name: 'pubDate') this.pubDate = '', @JsonKey(name: 'postId') this.postId = '', @JsonKey(name: 'detailedDescription') final List<String> detailedDescription = const <String>[], @JsonKey(name: 'tag') this.tag = ''}): _detailedDescription = detailedDescription,super._();
|
||||||
|
factory _CitizenNewsVideosItemData.fromJson(Map<String, dynamic> json) => _$CitizenNewsVideosItemDataFromJson(json);
|
||||||
|
|
||||||
|
@override@JsonKey(name: 'title') final String title;
|
||||||
|
@override@JsonKey(name: 'author') final String author;
|
||||||
|
@override@JsonKey(name: 'description') final String description;
|
||||||
|
@override@JsonKey(name: 'link') final String link;
|
||||||
|
@override@JsonKey(name: 'pubDate') final String pubDate;
|
||||||
|
@override@JsonKey(name: 'postId') final String postId;
|
||||||
|
final List<String> _detailedDescription;
|
||||||
|
@override@JsonKey(name: 'detailedDescription') List<String> get detailedDescription {
|
||||||
|
if (_detailedDescription is EqualUnmodifiableListView) return _detailedDescription;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_detailedDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override@JsonKey(name: 'tag') final String tag;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsVideosItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$CitizenNewsVideosItemDataCopyWith<_CitizenNewsVideosItemData> get copyWith => __$CitizenNewsVideosItemDataCopyWithImpl<_CitizenNewsVideosItemData>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$CitizenNewsVideosItemDataToJson(this, );
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CitizenNewsVideosItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.author, author) || other.author == author)&&(identical(other.description, description) || other.description == description)&&(identical(other.link, link) || other.link == link)&&(identical(other.pubDate, pubDate) || other.pubDate == pubDate)&&(identical(other.postId, postId) || other.postId == postId)&&const DeepCollectionEquality().equals(other._detailedDescription, _detailedDescription)&&(identical(other.tag, tag) || other.tag == tag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,title,author,description,link,pubDate,postId,const DeepCollectionEquality().hash(_detailedDescription),tag);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsVideosItemData(title: $title, author: $author, description: $description, link: $link, pubDate: $pubDate, postId: $postId, detailedDescription: $detailedDescription, tag: $tag)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$CitizenNewsVideosItemDataCopyWith<$Res> implements $CitizenNewsVideosItemDataCopyWith<$Res> {
|
||||||
|
factory _$CitizenNewsVideosItemDataCopyWith(_CitizenNewsVideosItemData value, $Res Function(_CitizenNewsVideosItemData) _then) = __$CitizenNewsVideosItemDataCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'title') String title,@JsonKey(name: 'author') String author,@JsonKey(name: 'description') String description,@JsonKey(name: 'link') String link,@JsonKey(name: 'pubDate') String pubDate,@JsonKey(name: 'postId') String postId,@JsonKey(name: 'detailedDescription') List<String> detailedDescription,@JsonKey(name: 'tag') String tag
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$CitizenNewsVideosItemDataCopyWithImpl<$Res>
|
||||||
|
implements _$CitizenNewsVideosItemDataCopyWith<$Res> {
|
||||||
|
__$CitizenNewsVideosItemDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _CitizenNewsVideosItemData _self;
|
||||||
|
final $Res Function(_CitizenNewsVideosItemData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsVideosItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? title = null,Object? author = null,Object? description = null,Object? link = null,Object? pubDate = null,Object? postId = null,Object? detailedDescription = null,Object? tag = null,}) {
|
||||||
|
return _then(_CitizenNewsVideosItemData(
|
||||||
|
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,pubDate: null == pubDate ? _self.pubDate : pubDate // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,detailedDescription: null == detailedDescription ? _self._detailedDescription : detailedDescription // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<String>,tag: null == tag ? _self.tag : tag // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$CitizenNewsArticlesItemData {
|
||||||
|
|
||||||
|
@JsonKey(name: 'title') String get title;@JsonKey(name: 'author') String get author;@JsonKey(name: 'description') String get description;@JsonKey(name: 'link') String get link;@JsonKey(name: 'pubDate') String get pubDate;@JsonKey(name: 'postId') String get postId;@JsonKey(name: 'detailedDescription') List<String> get detailedDescription;@JsonKey(name: 'tag') String get tag;
|
||||||
|
/// Create a copy of CitizenNewsArticlesItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$CitizenNewsArticlesItemDataCopyWith<CitizenNewsArticlesItemData> get copyWith => _$CitizenNewsArticlesItemDataCopyWithImpl<CitizenNewsArticlesItemData>(this as CitizenNewsArticlesItemData, _$identity);
|
||||||
|
|
||||||
|
/// Serializes this CitizenNewsArticlesItemData to a JSON map.
|
||||||
|
Map<String, dynamic> toJson();
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CitizenNewsArticlesItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.author, author) || other.author == author)&&(identical(other.description, description) || other.description == description)&&(identical(other.link, link) || other.link == link)&&(identical(other.pubDate, pubDate) || other.pubDate == pubDate)&&(identical(other.postId, postId) || other.postId == postId)&&const DeepCollectionEquality().equals(other.detailedDescription, detailedDescription)&&(identical(other.tag, tag) || other.tag == tag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,title,author,description,link,pubDate,postId,const DeepCollectionEquality().hash(detailedDescription),tag);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsArticlesItemData(title: $title, author: $author, description: $description, link: $link, pubDate: $pubDate, postId: $postId, detailedDescription: $detailedDescription, tag: $tag)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $CitizenNewsArticlesItemDataCopyWith<$Res> {
|
||||||
|
factory $CitizenNewsArticlesItemDataCopyWith(CitizenNewsArticlesItemData value, $Res Function(CitizenNewsArticlesItemData) _then) = _$CitizenNewsArticlesItemDataCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'title') String title,@JsonKey(name: 'author') String author,@JsonKey(name: 'description') String description,@JsonKey(name: 'link') String link,@JsonKey(name: 'pubDate') String pubDate,@JsonKey(name: 'postId') String postId,@JsonKey(name: 'detailedDescription') List<String> detailedDescription,@JsonKey(name: 'tag') String tag
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$CitizenNewsArticlesItemDataCopyWithImpl<$Res>
|
||||||
|
implements $CitizenNewsArticlesItemDataCopyWith<$Res> {
|
||||||
|
_$CitizenNewsArticlesItemDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final CitizenNewsArticlesItemData _self;
|
||||||
|
final $Res Function(CitizenNewsArticlesItemData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsArticlesItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? title = null,Object? author = null,Object? description = null,Object? link = null,Object? pubDate = null,Object? postId = null,Object? detailedDescription = null,Object? tag = null,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,pubDate: null == pubDate ? _self.pubDate : pubDate // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,detailedDescription: null == detailedDescription ? _self.detailedDescription : detailedDescription // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<String>,tag: null == tag ? _self.tag : tag // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [CitizenNewsArticlesItemData].
|
||||||
|
extension CitizenNewsArticlesItemDataPatterns on CitizenNewsArticlesItemData {
|
||||||
|
/// 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 extends Object?>(TResult Function( _CitizenNewsArticlesItemData value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData() 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 extends Object?>(TResult Function( _CitizenNewsArticlesItemData value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData():
|
||||||
|
return $default(_that);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function( _CitizenNewsArticlesItemData value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData() 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 extends Object?>(TResult Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData() when $default != null:
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);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 extends Object?>(TResult Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData():
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);}
|
||||||
|
}
|
||||||
|
/// 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 extends Object?>(TResult? Function(@JsonKey(name: 'title') String title, @JsonKey(name: 'author') String author, @JsonKey(name: 'description') String description, @JsonKey(name: 'link') String link, @JsonKey(name: 'pubDate') String pubDate, @JsonKey(name: 'postId') String postId, @JsonKey(name: 'detailedDescription') List<String> detailedDescription, @JsonKey(name: 'tag') String tag)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _CitizenNewsArticlesItemData() when $default != null:
|
||||||
|
return $default(_that.title,_that.author,_that.description,_that.link,_that.pubDate,_that.postId,_that.detailedDescription,_that.tag);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
@JsonSerializable()
|
||||||
|
|
||||||
|
class _CitizenNewsArticlesItemData extends CitizenNewsArticlesItemData {
|
||||||
|
const _CitizenNewsArticlesItemData({@JsonKey(name: 'title') this.title = '', @JsonKey(name: 'author') this.author = '', @JsonKey(name: 'description') this.description = '', @JsonKey(name: 'link') this.link = '', @JsonKey(name: 'pubDate') this.pubDate = '', @JsonKey(name: 'postId') this.postId = '', @JsonKey(name: 'detailedDescription') final List<String> detailedDescription = const <String>[], @JsonKey(name: 'tag') this.tag = ''}): _detailedDescription = detailedDescription,super._();
|
||||||
|
factory _CitizenNewsArticlesItemData.fromJson(Map<String, dynamic> json) => _$CitizenNewsArticlesItemDataFromJson(json);
|
||||||
|
|
||||||
|
@override@JsonKey(name: 'title') final String title;
|
||||||
|
@override@JsonKey(name: 'author') final String author;
|
||||||
|
@override@JsonKey(name: 'description') final String description;
|
||||||
|
@override@JsonKey(name: 'link') final String link;
|
||||||
|
@override@JsonKey(name: 'pubDate') final String pubDate;
|
||||||
|
@override@JsonKey(name: 'postId') final String postId;
|
||||||
|
final List<String> _detailedDescription;
|
||||||
|
@override@JsonKey(name: 'detailedDescription') List<String> get detailedDescription {
|
||||||
|
if (_detailedDescription is EqualUnmodifiableListView) return _detailedDescription;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_detailedDescription);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override@JsonKey(name: 'tag') final String tag;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsArticlesItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$CitizenNewsArticlesItemDataCopyWith<_CitizenNewsArticlesItemData> get copyWith => __$CitizenNewsArticlesItemDataCopyWithImpl<_CitizenNewsArticlesItemData>(this, _$identity);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return _$CitizenNewsArticlesItemDataToJson(this, );
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CitizenNewsArticlesItemData&&(identical(other.title, title) || other.title == title)&&(identical(other.author, author) || other.author == author)&&(identical(other.description, description) || other.description == description)&&(identical(other.link, link) || other.link == link)&&(identical(other.pubDate, pubDate) || other.pubDate == pubDate)&&(identical(other.postId, postId) || other.postId == postId)&&const DeepCollectionEquality().equals(other._detailedDescription, _detailedDescription)&&(identical(other.tag, tag) || other.tag == tag));
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,title,author,description,link,pubDate,postId,const DeepCollectionEquality().hash(_detailedDescription),tag);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'CitizenNewsArticlesItemData(title: $title, author: $author, description: $description, link: $link, pubDate: $pubDate, postId: $postId, detailedDescription: $detailedDescription, tag: $tag)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$CitizenNewsArticlesItemDataCopyWith<$Res> implements $CitizenNewsArticlesItemDataCopyWith<$Res> {
|
||||||
|
factory _$CitizenNewsArticlesItemDataCopyWith(_CitizenNewsArticlesItemData value, $Res Function(_CitizenNewsArticlesItemData) _then) = __$CitizenNewsArticlesItemDataCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
@JsonKey(name: 'title') String title,@JsonKey(name: 'author') String author,@JsonKey(name: 'description') String description,@JsonKey(name: 'link') String link,@JsonKey(name: 'pubDate') String pubDate,@JsonKey(name: 'postId') String postId,@JsonKey(name: 'detailedDescription') List<String> detailedDescription,@JsonKey(name: 'tag') String tag
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$CitizenNewsArticlesItemDataCopyWithImpl<$Res>
|
||||||
|
implements _$CitizenNewsArticlesItemDataCopyWith<$Res> {
|
||||||
|
__$CitizenNewsArticlesItemDataCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _CitizenNewsArticlesItemData _self;
|
||||||
|
final $Res Function(_CitizenNewsArticlesItemData) _then;
|
||||||
|
|
||||||
|
/// Create a copy of CitizenNewsArticlesItemData
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? title = null,Object? author = null,Object? description = null,Object? link = null,Object? pubDate = null,Object? postId = null,Object? detailedDescription = null,Object? tag = null,}) {
|
||||||
|
return _then(_CitizenNewsArticlesItemData(
|
||||||
|
title: null == title ? _self.title : title // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,author: null == author ? _self.author : author // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,link: null == link ? _self.link : link // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,pubDate: null == pubDate ? _self.pubDate : pubDate // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,detailedDescription: null == detailedDescription ? _self._detailedDescription : detailedDescription // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<String>,tag: null == tag ? _self.tag : tag // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
91
lib/data/citizen_news_data.g.dart
Normal file
91
lib/data/citizen_news_data.g.dart
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'citizen_news_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
_CitizenNewsData _$CitizenNewsDataFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _CitizenNewsData(
|
||||||
|
videos:
|
||||||
|
(json['videos'] as List<dynamic>?)
|
||||||
|
?.map(
|
||||||
|
(e) =>
|
||||||
|
CitizenNewsVideosItemData.fromJson(e as Map<String, dynamic>),
|
||||||
|
)
|
||||||
|
.toList() ??
|
||||||
|
const <CitizenNewsVideosItemData>[],
|
||||||
|
articles:
|
||||||
|
(json['articles'] as List<dynamic>?)
|
||||||
|
?.map(
|
||||||
|
(e) =>
|
||||||
|
CitizenNewsArticlesItemData.fromJson(e as Map<String, dynamic>),
|
||||||
|
)
|
||||||
|
.toList() ??
|
||||||
|
const <CitizenNewsArticlesItemData>[],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$CitizenNewsDataToJson(_CitizenNewsData instance) =>
|
||||||
|
<String, dynamic>{'videos': instance.videos, 'articles': instance.articles};
|
||||||
|
|
||||||
|
_CitizenNewsVideosItemData _$CitizenNewsVideosItemDataFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _CitizenNewsVideosItemData(
|
||||||
|
title: json['title'] as String? ?? '',
|
||||||
|
author: json['author'] as String? ?? '',
|
||||||
|
description: json['description'] as String? ?? '',
|
||||||
|
link: json['link'] as String? ?? '',
|
||||||
|
pubDate: json['pubDate'] as String? ?? '',
|
||||||
|
postId: json['postId'] as String? ?? '',
|
||||||
|
detailedDescription:
|
||||||
|
(json['detailedDescription'] as List<dynamic>?)
|
||||||
|
?.map((e) => e as String)
|
||||||
|
.toList() ??
|
||||||
|
const <String>[],
|
||||||
|
tag: json['tag'] as String? ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$CitizenNewsVideosItemDataToJson(
|
||||||
|
_CitizenNewsVideosItemData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'title': instance.title,
|
||||||
|
'author': instance.author,
|
||||||
|
'description': instance.description,
|
||||||
|
'link': instance.link,
|
||||||
|
'pubDate': instance.pubDate,
|
||||||
|
'postId': instance.postId,
|
||||||
|
'detailedDescription': instance.detailedDescription,
|
||||||
|
'tag': instance.tag,
|
||||||
|
};
|
||||||
|
|
||||||
|
_CitizenNewsArticlesItemData _$CitizenNewsArticlesItemDataFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _CitizenNewsArticlesItemData(
|
||||||
|
title: json['title'] as String? ?? '',
|
||||||
|
author: json['author'] as String? ?? '',
|
||||||
|
description: json['description'] as String? ?? '',
|
||||||
|
link: json['link'] as String? ?? '',
|
||||||
|
pubDate: json['pubDate'] as String? ?? '',
|
||||||
|
postId: json['postId'] as String? ?? '',
|
||||||
|
detailedDescription:
|
||||||
|
(json['detailedDescription'] as List<dynamic>?)
|
||||||
|
?.map((e) => e as String)
|
||||||
|
.toList() ??
|
||||||
|
const <String>[],
|
||||||
|
tag: json['tag'] as String? ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$CitizenNewsArticlesItemDataToJson(
|
||||||
|
_CitizenNewsArticlesItemData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'title': instance.title,
|
||||||
|
'author': instance.author,
|
||||||
|
'description': instance.description,
|
||||||
|
'link': instance.link,
|
||||||
|
'pubDate': instance.pubDate,
|
||||||
|
'postId': instance.postId,
|
||||||
|
'detailedDescription': instance.detailedDescription,
|
||||||
|
'tag': instance.tag,
|
||||||
|
};
|
||||||
24
lib/data/dcb_data.dart
Normal file
24
lib/data/dcb_data.dart
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/// DCB 记录项数据
|
||||||
|
class DcbRecordData {
|
||||||
|
final String path;
|
||||||
|
final int index;
|
||||||
|
|
||||||
|
const DcbRecordData({required this.path, required this.index});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// DCB 搜索匹配数据
|
||||||
|
class DcbSearchMatchData {
|
||||||
|
final int lineNumber;
|
||||||
|
final String lineContent;
|
||||||
|
|
||||||
|
const DcbSearchMatchData({required this.lineNumber, required this.lineContent});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// DCB 搜索结果数据
|
||||||
|
class DcbSearchResultData {
|
||||||
|
final String path;
|
||||||
|
final int index;
|
||||||
|
final List<DcbSearchMatchData> matches;
|
||||||
|
|
||||||
|
const DcbSearchResultData({required this.path, required this.index, required this.matches});
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ class GamePerformanceData {
|
|||||||
this.min,
|
this.min,
|
||||||
this.value,
|
this.value,
|
||||||
this.group,
|
this.group,
|
||||||
|
this.defaultValue,
|
||||||
});
|
});
|
||||||
|
|
||||||
GamePerformanceData.fromJson(dynamic json) {
|
GamePerformanceData.fromJson(dynamic json) {
|
||||||
@ -28,6 +29,8 @@ class GamePerformanceData {
|
|||||||
min = json['min'];
|
min = json['min'];
|
||||||
value = json['value'];
|
value = json['value'];
|
||||||
group = json['group'];
|
group = json['group'];
|
||||||
|
// Store the initial value as default value
|
||||||
|
defaultValue = json['value'];
|
||||||
}
|
}
|
||||||
String? key;
|
String? key;
|
||||||
String? name;
|
String? name;
|
||||||
@ -37,6 +40,7 @@ class GamePerformanceData {
|
|||||||
num? min;
|
num? min;
|
||||||
num? value;
|
num? value;
|
||||||
String? group;
|
String? group;
|
||||||
|
num? defaultValue;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
final map = <String, dynamic>{};
|
||||||
|
|||||||
@ -5,7 +5,7 @@ part 'nav_api_data.freezed.dart';
|
|||||||
part 'nav_api_data.g.dart';
|
part 'nav_api_data.g.dart';
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemData with _$NavApiDocsItemData {
|
abstract class NavApiDocsItemData with _$NavApiDocsItemData {
|
||||||
const factory NavApiDocsItemData({
|
const factory NavApiDocsItemData({
|
||||||
@Default('') @JsonKey(name: 'id') String id,
|
@Default('') @JsonKey(name: 'id') String id,
|
||||||
@Default('') @JsonKey(name: 'name') String name,
|
@Default('') @JsonKey(name: 'name') String name,
|
||||||
@ -31,7 +31,7 @@ class NavApiDocsItemData with _$NavApiDocsItemData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageData with _$NavApiDocsItemImageData {
|
abstract class NavApiDocsItemImageData with _$NavApiDocsItemImageData {
|
||||||
const factory NavApiDocsItemImageData({
|
const factory NavApiDocsItemImageData({
|
||||||
@Default('') @JsonKey(name: 'id') String id,
|
@Default('') @JsonKey(name: 'id') String id,
|
||||||
@Default(NavApiDocsItemImageCreatedByData())
|
@Default(NavApiDocsItemImageCreatedByData())
|
||||||
@ -63,7 +63,7 @@ class NavApiDocsItemImageData with _$NavApiDocsItemImageData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageCreatedByData with _$NavApiDocsItemImageCreatedByData {
|
abstract class NavApiDocsItemImageCreatedByData with _$NavApiDocsItemImageCreatedByData {
|
||||||
const factory NavApiDocsItemImageCreatedByData({
|
const factory NavApiDocsItemImageCreatedByData({
|
||||||
@Default('') @JsonKey(name: 'id') String id,
|
@Default('') @JsonKey(name: 'id') String id,
|
||||||
@Default('') @JsonKey(name: 'sub') String sub,
|
@Default('') @JsonKey(name: 'sub') String sub,
|
||||||
@ -87,7 +87,7 @@ class NavApiDocsItemImageCreatedByData with _$NavApiDocsItemImageCreatedByData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesThumbnailData
|
abstract class NavApiDocsItemImageSizesThumbnailData
|
||||||
with _$NavApiDocsItemImageSizesThumbnailData {
|
with _$NavApiDocsItemImageSizesThumbnailData {
|
||||||
const factory NavApiDocsItemImageSizesThumbnailData({
|
const factory NavApiDocsItemImageSizesThumbnailData({
|
||||||
@Default('') @JsonKey(name: 'url') String url,
|
@Default('') @JsonKey(name: 'url') String url,
|
||||||
@ -106,7 +106,7 @@ class NavApiDocsItemImageSizesThumbnailData
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesData with _$NavApiDocsItemImageSizesData {
|
abstract class NavApiDocsItemImageSizesData with _$NavApiDocsItemImageSizesData {
|
||||||
const factory NavApiDocsItemImageSizesData({
|
const factory NavApiDocsItemImageSizesData({
|
||||||
@Default(NavApiDocsItemImageSizesThumbnailData())
|
@Default(NavApiDocsItemImageSizesThumbnailData())
|
||||||
@JsonKey(name: 'thumbnail')
|
@JsonKey(name: 'thumbnail')
|
||||||
@ -132,7 +132,7 @@ class NavApiDocsItemImageSizesData with _$NavApiDocsItemImageSizesData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesPreloadData
|
abstract class NavApiDocsItemImageSizesPreloadData
|
||||||
with _$NavApiDocsItemImageSizesPreloadData {
|
with _$NavApiDocsItemImageSizesPreloadData {
|
||||||
const factory NavApiDocsItemImageSizesPreloadData({
|
const factory NavApiDocsItemImageSizesPreloadData({
|
||||||
@JsonKey(name: 'url') dynamic url,
|
@JsonKey(name: 'url') dynamic url,
|
||||||
@ -151,7 +151,7 @@ class NavApiDocsItemImageSizesPreloadData
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesCardData with _$NavApiDocsItemImageSizesCardData {
|
abstract class NavApiDocsItemImageSizesCardData with _$NavApiDocsItemImageSizesCardData {
|
||||||
const factory NavApiDocsItemImageSizesCardData({
|
const factory NavApiDocsItemImageSizesCardData({
|
||||||
@Default('') @JsonKey(name: 'url') String url,
|
@Default('') @JsonKey(name: 'url') String url,
|
||||||
@Default(0) @JsonKey(name: 'width') int width,
|
@Default(0) @JsonKey(name: 'width') int width,
|
||||||
@ -169,7 +169,7 @@ class NavApiDocsItemImageSizesCardData with _$NavApiDocsItemImageSizesCardData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesTabletData
|
abstract class NavApiDocsItemImageSizesTabletData
|
||||||
with _$NavApiDocsItemImageSizesTabletData {
|
with _$NavApiDocsItemImageSizesTabletData {
|
||||||
const factory NavApiDocsItemImageSizesTabletData({
|
const factory NavApiDocsItemImageSizesTabletData({
|
||||||
@Default('') @JsonKey(name: 'url') String url,
|
@Default('') @JsonKey(name: 'url') String url,
|
||||||
@ -188,7 +188,7 @@ class NavApiDocsItemImageSizesTabletData
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemImageSizesAvatarData
|
abstract class NavApiDocsItemImageSizesAvatarData
|
||||||
with _$NavApiDocsItemImageSizesAvatarData {
|
with _$NavApiDocsItemImageSizesAvatarData {
|
||||||
const factory NavApiDocsItemImageSizesAvatarData({
|
const factory NavApiDocsItemImageSizesAvatarData({
|
||||||
@Default('') @JsonKey(name: 'url') String url,
|
@Default('') @JsonKey(name: 'url') String url,
|
||||||
@ -207,7 +207,7 @@ class NavApiDocsItemImageSizesAvatarData
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiDocsItemTagsItemData with _$NavApiDocsItemTagsItemData {
|
abstract class NavApiDocsItemTagsItemData with _$NavApiDocsItemTagsItemData {
|
||||||
const factory NavApiDocsItemTagsItemData({
|
const factory NavApiDocsItemTagsItemData({
|
||||||
@Default('') @JsonKey(name: 'id') String id,
|
@Default('') @JsonKey(name: 'id') String id,
|
||||||
@Default('') @JsonKey(name: 'name') String name,
|
@Default('') @JsonKey(name: 'name') String name,
|
||||||
@ -223,7 +223,7 @@ class NavApiDocsItemTagsItemData with _$NavApiDocsItemTagsItemData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class NavApiData with _$NavApiData {
|
abstract class NavApiData with _$NavApiData {
|
||||||
const factory NavApiData({
|
const factory NavApiData({
|
||||||
@Default(<NavApiDocsItemData>[])
|
@Default(<NavApiDocsItemData>[])
|
||||||
@JsonKey(name: 'docs')
|
@JsonKey(name: 'docs')
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -6,31 +6,32 @@ part of 'nav_api_data.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
_$NavApiDocsItemDataImpl _$$NavApiDocsItemDataImplFromJson(
|
_NavApiDocsItemData _$NavApiDocsItemDataFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json,
|
||||||
_$NavApiDocsItemDataImpl(
|
) => _NavApiDocsItemData(
|
||||||
id: json['id'] as String? ?? '',
|
id: json['id'] as String? ?? '',
|
||||||
name: json['name'] as String? ?? '',
|
name: json['name'] as String? ?? '',
|
||||||
slug: json['slug'] as String? ?? '',
|
slug: json['slug'] as String? ?? '',
|
||||||
abstract_: json['abstract'] as String? ?? '',
|
abstract_: json['abstract'] as String? ?? '',
|
||||||
description: json['description'] as String? ?? '',
|
description: json['description'] as String? ?? '',
|
||||||
image: json['image'] == null
|
image: json['image'] == null
|
||||||
? const NavApiDocsItemImageData()
|
? const NavApiDocsItemImageData()
|
||||||
: NavApiDocsItemImageData.fromJson(
|
: NavApiDocsItemImageData.fromJson(json['image'] as Map<String, dynamic>),
|
||||||
json['image'] as Map<String, dynamic>),
|
link: json['link'] as String? ?? '',
|
||||||
link: json['link'] as String? ?? '',
|
isSponsored: json['is_sponsored'] as bool? ?? false,
|
||||||
isSponsored: json['is_sponsored'] as bool? ?? false,
|
tags:
|
||||||
tags: (json['tags'] as List<dynamic>?)
|
(json['tags'] as List<dynamic>?)
|
||||||
?.map((e) => NavApiDocsItemTagsItemData.fromJson(
|
?.map(
|
||||||
e as Map<String, dynamic>))
|
(e) =>
|
||||||
.toList() ??
|
NavApiDocsItemTagsItemData.fromJson(e as Map<String, dynamic>),
|
||||||
const <NavApiDocsItemTagsItemData>[],
|
)
|
||||||
updatedAt: json['updatedAt'] as String? ?? '',
|
.toList() ??
|
||||||
createdAt: json['createdAt'] as String? ?? '',
|
const <NavApiDocsItemTagsItemData>[],
|
||||||
);
|
updatedAt: json['updatedAt'] as String? ?? '',
|
||||||
|
createdAt: json['createdAt'] as String? ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemDataToJson(_NavApiDocsItemData instance) =>
|
||||||
_$NavApiDocsItemDataImpl instance) =>
|
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'id': instance.id,
|
'id': instance.id,
|
||||||
'name': instance.name,
|
'name': instance.name,
|
||||||
@ -45,283 +46,282 @@ Map<String, dynamic> _$$NavApiDocsItemDataImplToJson(
|
|||||||
'createdAt': instance.createdAt,
|
'createdAt': instance.createdAt,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$NavApiDocsItemImageDataImpl _$$NavApiDocsItemImageDataImplFromJson(
|
_NavApiDocsItemImageData _$NavApiDocsItemImageDataFromJson(
|
||||||
Map<String, dynamic> json) =>
|
Map<String, dynamic> json,
|
||||||
_$NavApiDocsItemImageDataImpl(
|
) => _NavApiDocsItemImageData(
|
||||||
id: json['id'] as String? ?? '',
|
id: json['id'] as String? ?? '',
|
||||||
createdBy: json['createdBy'] == null
|
createdBy: json['createdBy'] == null
|
||||||
? const NavApiDocsItemImageCreatedByData()
|
? const NavApiDocsItemImageCreatedByData()
|
||||||
: NavApiDocsItemImageCreatedByData.fromJson(
|
: NavApiDocsItemImageCreatedByData.fromJson(
|
||||||
json['createdBy'] as Map<String, dynamic>),
|
json['createdBy'] as Map<String, dynamic>,
|
||||||
title: json['title'] as String? ?? '',
|
),
|
||||||
original: json['original'] as bool? ?? false,
|
title: json['title'] as String? ?? '',
|
||||||
credit: json['credit'] as String? ?? '',
|
original: json['original'] as bool? ?? false,
|
||||||
source: json['source'] as String? ?? '',
|
credit: json['credit'] as String? ?? '',
|
||||||
license: json['license'] as String? ?? '',
|
source: json['source'] as String? ?? '',
|
||||||
caption: json['caption'],
|
license: json['license'] as String? ?? '',
|
||||||
updatedAt: json['updatedAt'] as String? ?? '',
|
caption: json['caption'],
|
||||||
createdAt: json['createdAt'] as String? ?? '',
|
updatedAt: json['updatedAt'] as String? ?? '',
|
||||||
|
createdAt: json['createdAt'] as String? ?? '',
|
||||||
|
url: json['url'] as String? ?? '',
|
||||||
|
filename: json['filename'] as String? ?? '',
|
||||||
|
mimeType: json['mimeType'] as String? ?? '',
|
||||||
|
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
||||||
|
width: (json['width'] as num?)?.toInt() ?? 0,
|
||||||
|
height: (json['height'] as num?)?.toInt() ?? 0,
|
||||||
|
sizes: json['sizes'] == null
|
||||||
|
? const NavApiDocsItemImageSizesData()
|
||||||
|
: NavApiDocsItemImageSizesData.fromJson(
|
||||||
|
json['sizes'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$NavApiDocsItemImageDataToJson(
|
||||||
|
_NavApiDocsItemImageData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'createdBy': instance.createdBy,
|
||||||
|
'title': instance.title,
|
||||||
|
'original': instance.original,
|
||||||
|
'credit': instance.credit,
|
||||||
|
'source': instance.source,
|
||||||
|
'license': instance.license,
|
||||||
|
'caption': instance.caption,
|
||||||
|
'updatedAt': instance.updatedAt,
|
||||||
|
'createdAt': instance.createdAt,
|
||||||
|
'url': instance.url,
|
||||||
|
'filename': instance.filename,
|
||||||
|
'mimeType': instance.mimeType,
|
||||||
|
'filesize': instance.filesize,
|
||||||
|
'width': instance.width,
|
||||||
|
'height': instance.height,
|
||||||
|
'sizes': instance.sizes,
|
||||||
|
};
|
||||||
|
|
||||||
|
_NavApiDocsItemImageCreatedByData _$NavApiDocsItemImageCreatedByDataFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _NavApiDocsItemImageCreatedByData(
|
||||||
|
id: json['id'] as String? ?? '',
|
||||||
|
sub: json['sub'] as String? ?? '',
|
||||||
|
externalProvider: json['external_provider'] as String? ?? '',
|
||||||
|
username: json['username'] as String? ?? '',
|
||||||
|
name: json['name'] as String? ?? '',
|
||||||
|
roles:
|
||||||
|
(json['roles'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
||||||
|
const <String>[],
|
||||||
|
avatarUrl: json['avatar_url'] as String? ?? '',
|
||||||
|
updatedAt: json['updatedAt'] as String? ?? '',
|
||||||
|
createdAt: json['createdAt'] as String? ?? '',
|
||||||
|
email: json['email'] as String? ?? '',
|
||||||
|
loginAttempts: (json['loginAttempts'] as num?)?.toInt() ?? 0,
|
||||||
|
avatar: json['avatar'] as String? ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$NavApiDocsItemImageCreatedByDataToJson(
|
||||||
|
_NavApiDocsItemImageCreatedByData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'sub': instance.sub,
|
||||||
|
'external_provider': instance.externalProvider,
|
||||||
|
'username': instance.username,
|
||||||
|
'name': instance.name,
|
||||||
|
'roles': instance.roles,
|
||||||
|
'avatar_url': instance.avatarUrl,
|
||||||
|
'updatedAt': instance.updatedAt,
|
||||||
|
'createdAt': instance.createdAt,
|
||||||
|
'email': instance.email,
|
||||||
|
'loginAttempts': instance.loginAttempts,
|
||||||
|
'avatar': instance.avatar,
|
||||||
|
};
|
||||||
|
|
||||||
|
_NavApiDocsItemImageSizesThumbnailData
|
||||||
|
_$NavApiDocsItemImageSizesThumbnailDataFromJson(Map<String, dynamic> json) =>
|
||||||
|
_NavApiDocsItemImageSizesThumbnailData(
|
||||||
url: json['url'] as String? ?? '',
|
url: json['url'] as String? ?? '',
|
||||||
filename: json['filename'] as String? ?? '',
|
|
||||||
mimeType: json['mimeType'] as String? ?? '',
|
|
||||||
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
|
||||||
width: (json['width'] as num?)?.toInt() ?? 0,
|
width: (json['width'] as num?)?.toInt() ?? 0,
|
||||||
height: (json['height'] as num?)?.toInt() ?? 0,
|
height: (json['height'] as num?)?.toInt() ?? 0,
|
||||||
sizes: json['sizes'] == null
|
mimeType: json['mimeType'] as String? ?? '',
|
||||||
? const NavApiDocsItemImageSizesData()
|
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
||||||
: NavApiDocsItemImageSizesData.fromJson(
|
filename: json['filename'] as String? ?? '',
|
||||||
json['sizes'] as Map<String, dynamic>),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemImageSizesThumbnailDataToJson(
|
||||||
_$NavApiDocsItemImageDataImpl instance) =>
|
_NavApiDocsItemImageSizesThumbnailData instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'url': instance.url,
|
||||||
'createdBy': instance.createdBy,
|
'width': instance.width,
|
||||||
'title': instance.title,
|
'height': instance.height,
|
||||||
'original': instance.original,
|
'mimeType': instance.mimeType,
|
||||||
'credit': instance.credit,
|
'filesize': instance.filesize,
|
||||||
'source': instance.source,
|
'filename': instance.filename,
|
||||||
'license': instance.license,
|
};
|
||||||
'caption': instance.caption,
|
|
||||||
'updatedAt': instance.updatedAt,
|
|
||||||
'createdAt': instance.createdAt,
|
|
||||||
'url': instance.url,
|
|
||||||
'filename': instance.filename,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
'filesize': instance.filesize,
|
|
||||||
'width': instance.width,
|
|
||||||
'height': instance.height,
|
|
||||||
'sizes': instance.sizes,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemImageCreatedByDataImpl
|
_NavApiDocsItemImageSizesData _$NavApiDocsItemImageSizesDataFromJson(
|
||||||
_$$NavApiDocsItemImageCreatedByDataImplFromJson(
|
Map<String, dynamic> json,
|
||||||
Map<String, dynamic> json) =>
|
) => _NavApiDocsItemImageSizesData(
|
||||||
_$NavApiDocsItemImageCreatedByDataImpl(
|
thumbnail: json['thumbnail'] == null
|
||||||
id: json['id'] as String? ?? '',
|
? const NavApiDocsItemImageSizesThumbnailData()
|
||||||
sub: json['sub'] as String? ?? '',
|
: NavApiDocsItemImageSizesThumbnailData.fromJson(
|
||||||
externalProvider: json['external_provider'] as String? ?? '',
|
json['thumbnail'] as Map<String, dynamic>,
|
||||||
username: json['username'] as String? ?? '',
|
),
|
||||||
name: json['name'] as String? ?? '',
|
preload: json['preload'] == null
|
||||||
roles: (json['roles'] as List<dynamic>?)
|
? const NavApiDocsItemImageSizesPreloadData()
|
||||||
?.map((e) => e as String)
|
: NavApiDocsItemImageSizesPreloadData.fromJson(
|
||||||
.toList() ??
|
json['preload'] as Map<String, dynamic>,
|
||||||
const <String>[],
|
),
|
||||||
avatarUrl: json['avatar_url'] as String? ?? '',
|
card: json['card'] == null
|
||||||
updatedAt: json['updatedAt'] as String? ?? '',
|
? const NavApiDocsItemImageSizesCardData()
|
||||||
createdAt: json['createdAt'] as String? ?? '',
|
: NavApiDocsItemImageSizesCardData.fromJson(
|
||||||
email: json['email'] as String? ?? '',
|
json['card'] as Map<String, dynamic>,
|
||||||
loginAttempts: (json['loginAttempts'] as num?)?.toInt() ?? 0,
|
),
|
||||||
avatar: json['avatar'] as String? ?? '',
|
tablet: json['tablet'] == null
|
||||||
);
|
? const NavApiDocsItemImageSizesTabletData()
|
||||||
|
: NavApiDocsItemImageSizesTabletData.fromJson(
|
||||||
|
json['tablet'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
|
avatar: json['avatar'] == null
|
||||||
|
? const NavApiDocsItemImageSizesAvatarData()
|
||||||
|
: NavApiDocsItemImageSizesAvatarData.fromJson(
|
||||||
|
json['avatar'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageCreatedByDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemImageSizesDataToJson(
|
||||||
_$NavApiDocsItemImageCreatedByDataImpl instance) =>
|
_NavApiDocsItemImageSizesData instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'thumbnail': instance.thumbnail,
|
||||||
'sub': instance.sub,
|
'preload': instance.preload,
|
||||||
'external_provider': instance.externalProvider,
|
'card': instance.card,
|
||||||
'username': instance.username,
|
'tablet': instance.tablet,
|
||||||
'name': instance.name,
|
'avatar': instance.avatar,
|
||||||
'roles': instance.roles,
|
};
|
||||||
'avatar_url': instance.avatarUrl,
|
|
||||||
'updatedAt': instance.updatedAt,
|
|
||||||
'createdAt': instance.createdAt,
|
|
||||||
'email': instance.email,
|
|
||||||
'loginAttempts': instance.loginAttempts,
|
|
||||||
'avatar': instance.avatar,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesThumbnailDataImpl
|
_NavApiDocsItemImageSizesPreloadData
|
||||||
_$$NavApiDocsItemImageSizesThumbnailDataImplFromJson(
|
_$NavApiDocsItemImageSizesPreloadDataFromJson(Map<String, dynamic> json) =>
|
||||||
Map<String, dynamic> json) =>
|
_NavApiDocsItemImageSizesPreloadData(
|
||||||
_$NavApiDocsItemImageSizesThumbnailDataImpl(
|
url: json['url'],
|
||||||
url: json['url'] as String? ?? '',
|
width: json['width'],
|
||||||
width: (json['width'] as num?)?.toInt() ?? 0,
|
height: json['height'],
|
||||||
height: (json['height'] as num?)?.toInt() ?? 0,
|
mimeType: json['mimeType'],
|
||||||
mimeType: json['mimeType'] as String? ?? '',
|
filesize: json['filesize'],
|
||||||
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
filename: json['filename'],
|
||||||
filename: json['filename'] as String? ?? '',
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesThumbnailDataImplToJson(
|
|
||||||
_$NavApiDocsItemImageSizesThumbnailDataImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'url': instance.url,
|
|
||||||
'width': instance.width,
|
|
||||||
'height': instance.height,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
'filesize': instance.filesize,
|
|
||||||
'filename': instance.filename,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesDataImpl _$$NavApiDocsItemImageSizesDataImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$NavApiDocsItemImageSizesDataImpl(
|
|
||||||
thumbnail: json['thumbnail'] == null
|
|
||||||
? const NavApiDocsItemImageSizesThumbnailData()
|
|
||||||
: NavApiDocsItemImageSizesThumbnailData.fromJson(
|
|
||||||
json['thumbnail'] as Map<String, dynamic>),
|
|
||||||
preload: json['preload'] == null
|
|
||||||
? const NavApiDocsItemImageSizesPreloadData()
|
|
||||||
: NavApiDocsItemImageSizesPreloadData.fromJson(
|
|
||||||
json['preload'] as Map<String, dynamic>),
|
|
||||||
card: json['card'] == null
|
|
||||||
? const NavApiDocsItemImageSizesCardData()
|
|
||||||
: NavApiDocsItemImageSizesCardData.fromJson(
|
|
||||||
json['card'] as Map<String, dynamic>),
|
|
||||||
tablet: json['tablet'] == null
|
|
||||||
? const NavApiDocsItemImageSizesTabletData()
|
|
||||||
: NavApiDocsItemImageSizesTabletData.fromJson(
|
|
||||||
json['tablet'] as Map<String, dynamic>),
|
|
||||||
avatar: json['avatar'] == null
|
|
||||||
? const NavApiDocsItemImageSizesAvatarData()
|
|
||||||
: NavApiDocsItemImageSizesAvatarData.fromJson(
|
|
||||||
json['avatar'] as Map<String, dynamic>),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemImageSizesPreloadDataToJson(
|
||||||
_$NavApiDocsItemImageSizesDataImpl instance) =>
|
_NavApiDocsItemImageSizesPreloadData instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'thumbnail': instance.thumbnail,
|
'url': instance.url,
|
||||||
'preload': instance.preload,
|
'width': instance.width,
|
||||||
'card': instance.card,
|
'height': instance.height,
|
||||||
'tablet': instance.tablet,
|
'mimeType': instance.mimeType,
|
||||||
'avatar': instance.avatar,
|
'filesize': instance.filesize,
|
||||||
};
|
'filename': instance.filename,
|
||||||
|
};
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesPreloadDataImpl
|
_NavApiDocsItemImageSizesCardData _$NavApiDocsItemImageSizesCardDataFromJson(
|
||||||
_$$NavApiDocsItemImageSizesPreloadDataImplFromJson(
|
Map<String, dynamic> json,
|
||||||
Map<String, dynamic> json) =>
|
) => _NavApiDocsItemImageSizesCardData(
|
||||||
_$NavApiDocsItemImageSizesPreloadDataImpl(
|
url: json['url'] as String? ?? '',
|
||||||
url: json['url'],
|
width: (json['width'] as num?)?.toInt() ?? 0,
|
||||||
width: json['width'],
|
height: (json['height'] as num?)?.toInt() ?? 0,
|
||||||
height: json['height'],
|
mimeType: json['mimeType'] as String? ?? '',
|
||||||
mimeType: json['mimeType'],
|
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
||||||
filesize: json['filesize'],
|
filename: json['filename'] as String? ?? '',
|
||||||
filename: json['filename'],
|
);
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesPreloadDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemImageSizesCardDataToJson(
|
||||||
_$NavApiDocsItemImageSizesPreloadDataImpl instance) =>
|
_NavApiDocsItemImageSizesCardData instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'url': instance.url,
|
'url': instance.url,
|
||||||
'width': instance.width,
|
'width': instance.width,
|
||||||
'height': instance.height,
|
'height': instance.height,
|
||||||
'mimeType': instance.mimeType,
|
'mimeType': instance.mimeType,
|
||||||
'filesize': instance.filesize,
|
'filesize': instance.filesize,
|
||||||
'filename': instance.filename,
|
'filename': instance.filename,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesCardDataImpl
|
_NavApiDocsItemImageSizesTabletData
|
||||||
_$$NavApiDocsItemImageSizesCardDataImplFromJson(
|
_$NavApiDocsItemImageSizesTabletDataFromJson(Map<String, dynamic> json) =>
|
||||||
Map<String, dynamic> json) =>
|
_NavApiDocsItemImageSizesTabletData(
|
||||||
_$NavApiDocsItemImageSizesCardDataImpl(
|
url: json['url'] as String? ?? '',
|
||||||
url: json['url'] as String? ?? '',
|
width: (json['width'] as num?)?.toInt() ?? 0,
|
||||||
width: (json['width'] as num?)?.toInt() ?? 0,
|
height: (json['height'] as num?)?.toInt() ?? 0,
|
||||||
height: (json['height'] as num?)?.toInt() ?? 0,
|
mimeType: json['mimeType'] as String? ?? '',
|
||||||
mimeType: json['mimeType'] as String? ?? '',
|
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
||||||
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
filename: json['filename'] as String? ?? '',
|
||||||
filename: json['filename'] as String? ?? '',
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesCardDataImplToJson(
|
|
||||||
_$NavApiDocsItemImageSizesCardDataImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'url': instance.url,
|
|
||||||
'width': instance.width,
|
|
||||||
'height': instance.height,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
'filesize': instance.filesize,
|
|
||||||
'filename': instance.filename,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesTabletDataImpl
|
|
||||||
_$$NavApiDocsItemImageSizesTabletDataImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$NavApiDocsItemImageSizesTabletDataImpl(
|
|
||||||
url: json['url'] as String? ?? '',
|
|
||||||
width: (json['width'] as num?)?.toInt() ?? 0,
|
|
||||||
height: (json['height'] as num?)?.toInt() ?? 0,
|
|
||||||
mimeType: json['mimeType'] as String? ?? '',
|
|
||||||
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
|
||||||
filename: json['filename'] as String? ?? '',
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesTabletDataImplToJson(
|
|
||||||
_$NavApiDocsItemImageSizesTabletDataImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'url': instance.url,
|
|
||||||
'width': instance.width,
|
|
||||||
'height': instance.height,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
'filesize': instance.filesize,
|
|
||||||
'filename': instance.filename,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemImageSizesAvatarDataImpl
|
|
||||||
_$$NavApiDocsItemImageSizesAvatarDataImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$NavApiDocsItemImageSizesAvatarDataImpl(
|
|
||||||
url: json['url'] as String? ?? '',
|
|
||||||
width: (json['width'] as num?)?.toInt() ?? 0,
|
|
||||||
height: (json['height'] as num?)?.toInt() ?? 0,
|
|
||||||
mimeType: json['mimeType'] as String? ?? '',
|
|
||||||
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
|
||||||
filename: json['filename'] as String? ?? '',
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemImageSizesAvatarDataImplToJson(
|
|
||||||
_$NavApiDocsItemImageSizesAvatarDataImpl instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'url': instance.url,
|
|
||||||
'width': instance.width,
|
|
||||||
'height': instance.height,
|
|
||||||
'mimeType': instance.mimeType,
|
|
||||||
'filesize': instance.filesize,
|
|
||||||
'filename': instance.filename,
|
|
||||||
};
|
|
||||||
|
|
||||||
_$NavApiDocsItemTagsItemDataImpl _$$NavApiDocsItemTagsItemDataImplFromJson(
|
|
||||||
Map<String, dynamic> json) =>
|
|
||||||
_$NavApiDocsItemTagsItemDataImpl(
|
|
||||||
id: json['id'] as String? ?? '',
|
|
||||||
name: json['name'] as String? ?? '',
|
|
||||||
slug: json['slug'] as String? ?? '',
|
|
||||||
updatedAt: json['updatedAt'] as String? ?? '',
|
|
||||||
createdAt: json['createdAt'] as String? ?? '',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDocsItemTagsItemDataImplToJson(
|
Map<String, dynamic> _$NavApiDocsItemImageSizesTabletDataToJson(
|
||||||
_$NavApiDocsItemTagsItemDataImpl instance) =>
|
_NavApiDocsItemImageSizesTabletData instance,
|
||||||
<String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'url': instance.url,
|
||||||
'name': instance.name,
|
'width': instance.width,
|
||||||
'slug': instance.slug,
|
'height': instance.height,
|
||||||
'updatedAt': instance.updatedAt,
|
'mimeType': instance.mimeType,
|
||||||
'createdAt': instance.createdAt,
|
'filesize': instance.filesize,
|
||||||
};
|
'filename': instance.filename,
|
||||||
|
};
|
||||||
|
|
||||||
_$NavApiDataImpl _$$NavApiDataImplFromJson(Map<String, dynamic> json) =>
|
_NavApiDocsItemImageSizesAvatarData
|
||||||
_$NavApiDataImpl(
|
_$NavApiDocsItemImageSizesAvatarDataFromJson(Map<String, dynamic> json) =>
|
||||||
docs: (json['docs'] as List<dynamic>?)
|
_NavApiDocsItemImageSizesAvatarData(
|
||||||
?.map(
|
url: json['url'] as String? ?? '',
|
||||||
(e) => NavApiDocsItemData.fromJson(e as Map<String, dynamic>))
|
width: (json['width'] as num?)?.toInt() ?? 0,
|
||||||
.toList() ??
|
height: (json['height'] as num?)?.toInt() ?? 0,
|
||||||
const <NavApiDocsItemData>[],
|
mimeType: json['mimeType'] as String? ?? '',
|
||||||
hasNextPage: json['hasNextPage'] as bool? ?? false,
|
filesize: (json['filesize'] as num?)?.toInt() ?? 0,
|
||||||
hasPrevPage: json['hasPrevPage'] as bool? ?? false,
|
filename: json['filename'] as String? ?? '',
|
||||||
limit: (json['limit'] as num?)?.toInt() ?? 0,
|
|
||||||
nextPage: json['nextPage'],
|
|
||||||
page: (json['page'] as num?)?.toInt() ?? 0,
|
|
||||||
pagingCounter: (json['pagingCounter'] as num?)?.toInt() ?? 0,
|
|
||||||
prevPage: json['prevPage'],
|
|
||||||
totalDocs: (json['totalDocs'] as num?)?.toInt() ?? 0,
|
|
||||||
totalPages: (json['totalPages'] as num?)?.toInt() ?? 0,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$NavApiDataImplToJson(_$NavApiDataImpl instance) =>
|
Map<String, dynamic> _$NavApiDocsItemImageSizesAvatarDataToJson(
|
||||||
|
_NavApiDocsItemImageSizesAvatarData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'url': instance.url,
|
||||||
|
'width': instance.width,
|
||||||
|
'height': instance.height,
|
||||||
|
'mimeType': instance.mimeType,
|
||||||
|
'filesize': instance.filesize,
|
||||||
|
'filename': instance.filename,
|
||||||
|
};
|
||||||
|
|
||||||
|
_NavApiDocsItemTagsItemData _$NavApiDocsItemTagsItemDataFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _NavApiDocsItemTagsItemData(
|
||||||
|
id: json['id'] as String? ?? '',
|
||||||
|
name: json['name'] as String? ?? '',
|
||||||
|
slug: json['slug'] as String? ?? '',
|
||||||
|
updatedAt: json['updatedAt'] as String? ?? '',
|
||||||
|
createdAt: json['createdAt'] as String? ?? '',
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$NavApiDocsItemTagsItemDataToJson(
|
||||||
|
_NavApiDocsItemTagsItemData instance,
|
||||||
|
) => <String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'name': instance.name,
|
||||||
|
'slug': instance.slug,
|
||||||
|
'updatedAt': instance.updatedAt,
|
||||||
|
'createdAt': instance.createdAt,
|
||||||
|
};
|
||||||
|
|
||||||
|
_NavApiData _$NavApiDataFromJson(Map<String, dynamic> json) => _NavApiData(
|
||||||
|
docs:
|
||||||
|
(json['docs'] as List<dynamic>?)
|
||||||
|
?.map((e) => NavApiDocsItemData.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList() ??
|
||||||
|
const <NavApiDocsItemData>[],
|
||||||
|
hasNextPage: json['hasNextPage'] as bool? ?? false,
|
||||||
|
hasPrevPage: json['hasPrevPage'] as bool? ?? false,
|
||||||
|
limit: (json['limit'] as num?)?.toInt() ?? 0,
|
||||||
|
nextPage: json['nextPage'],
|
||||||
|
page: (json['page'] as num?)?.toInt() ?? 0,
|
||||||
|
pagingCounter: (json['pagingCounter'] as num?)?.toInt() ?? 0,
|
||||||
|
prevPage: json['prevPage'],
|
||||||
|
totalDocs: (json['totalDocs'] as num?)?.toInt() ?? 0,
|
||||||
|
totalPages: (json['totalPages'] as num?)?.toInt() ?? 0,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$NavApiDataToJson(_NavApiData instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'docs': instance.docs,
|
'docs': instance.docs,
|
||||||
'hasNextPage': instance.hasNextPage,
|
'hasNextPage': instance.hasNextPage,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -6,4 +6,6 @@ class NoL10n {
|
|||||||
static const String langFR = 'Français';
|
static const String langFR = 'Français';
|
||||||
static const String langRU = 'Русский';
|
static const String langRU = 'Русский';
|
||||||
static const String langCodeZhCn = 'zh_CN';
|
static const String langCodeZhCn = 'zh_CN';
|
||||||
|
|
||||||
|
static const String aniCatTitle = '【寰宇周刊】';
|
||||||
}
|
}
|
||||||
|
|||||||
1418
lib/generated/proto/auth/auth.pb.dart
Normal file
1418
lib/generated/proto/auth/auth.pb.dart
Normal file
File diff suppressed because it is too large
Load Diff
11
lib/generated/proto/auth/auth.pbenum.dart
Normal file
11
lib/generated/proto/auth/auth.pbenum.dart
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/auth/auth.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
341
lib/generated/proto/auth/auth.pbgrpc.dart
Normal file
341
lib/generated/proto/auth/auth.pbgrpc.dart
Normal file
@ -0,0 +1,341 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/auth/auth.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
|
||||||
|
import 'dart:async' as $async;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:grpc/service_api.dart' as $grpc;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
import 'auth.pb.dart' as $0;
|
||||||
|
|
||||||
|
export 'auth.pb.dart';
|
||||||
|
|
||||||
|
/// 认证服务
|
||||||
|
@$pb.GrpcServiceName('auth.AuthService')
|
||||||
|
class AuthServiceClient extends $grpc.Client {
|
||||||
|
/// The hostname for this service.
|
||||||
|
static const $core.String defaultHost = '';
|
||||||
|
|
||||||
|
/// OAuth scopes needed for the client.
|
||||||
|
static const $core.List<$core.String> oauthScopes = [
|
||||||
|
'',
|
||||||
|
];
|
||||||
|
|
||||||
|
AuthServiceClient(super.channel, {super.options, super.interceptors});
|
||||||
|
|
||||||
|
/// 获取服务状态(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.StatusResponse> status(
|
||||||
|
$0.StatusRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$status, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取当前账号状态(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.LoginResponse> login(
|
||||||
|
$0.LoginRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$login, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 请求注册(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.PreRegisterResponse> preRegister(
|
||||||
|
$0.PreRegisterRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$preRegister, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 注册账号(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.RegisterResponse> register(
|
||||||
|
$0.RegisterRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$register, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 注销账号(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.UnregisterResponse> unregister(
|
||||||
|
$0.UnregisterRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$unregister, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 验证 JWT token
|
||||||
|
$grpc.ResponseFuture<$0.ValidateTokenResponse> validateToken(
|
||||||
|
$0.ValidateTokenRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$validateToken, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取公钥信息
|
||||||
|
$grpc.ResponseFuture<$0.GetPublicKeyResponse> getPublicKey(
|
||||||
|
$0.GetPublicKeyRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getPublicKey, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
$grpc.ResponseFuture<$0.GetJWTDomainListResponse> getJWTDomainList(
|
||||||
|
$0.GetJWTDomainListRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getJWTDomainList, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 刷新用户资料(需要认证)
|
||||||
|
$grpc.ResponseFuture<$0.RefreshUserProfileResponse> refreshUserProfile(
|
||||||
|
$0.RefreshUserProfileRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$refreshUserProfile, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 生成 OIDC 授权码(供客户端 App 使用)
|
||||||
|
$grpc.ResponseFuture<$0.GenerateOIDCAuthCodeResponse> generateOIDCAuthCode(
|
||||||
|
$0.GenerateOIDCAuthCodeRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$generateOIDCAuthCode, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// method descriptors
|
||||||
|
|
||||||
|
static final _$status =
|
||||||
|
$grpc.ClientMethod<$0.StatusRequest, $0.StatusResponse>(
|
||||||
|
'/auth.AuthService/Status',
|
||||||
|
($0.StatusRequest value) => value.writeToBuffer(),
|
||||||
|
$0.StatusResponse.fromBuffer);
|
||||||
|
static final _$login = $grpc.ClientMethod<$0.LoginRequest, $0.LoginResponse>(
|
||||||
|
'/auth.AuthService/Login',
|
||||||
|
($0.LoginRequest value) => value.writeToBuffer(),
|
||||||
|
$0.LoginResponse.fromBuffer);
|
||||||
|
static final _$preRegister =
|
||||||
|
$grpc.ClientMethod<$0.PreRegisterRequest, $0.PreRegisterResponse>(
|
||||||
|
'/auth.AuthService/PreRegister',
|
||||||
|
($0.PreRegisterRequest value) => value.writeToBuffer(),
|
||||||
|
$0.PreRegisterResponse.fromBuffer);
|
||||||
|
static final _$register =
|
||||||
|
$grpc.ClientMethod<$0.RegisterRequest, $0.RegisterResponse>(
|
||||||
|
'/auth.AuthService/Register',
|
||||||
|
($0.RegisterRequest value) => value.writeToBuffer(),
|
||||||
|
$0.RegisterResponse.fromBuffer);
|
||||||
|
static final _$unregister =
|
||||||
|
$grpc.ClientMethod<$0.UnregisterRequest, $0.UnregisterResponse>(
|
||||||
|
'/auth.AuthService/Unregister',
|
||||||
|
($0.UnregisterRequest value) => value.writeToBuffer(),
|
||||||
|
$0.UnregisterResponse.fromBuffer);
|
||||||
|
static final _$validateToken =
|
||||||
|
$grpc.ClientMethod<$0.ValidateTokenRequest, $0.ValidateTokenResponse>(
|
||||||
|
'/auth.AuthService/ValidateToken',
|
||||||
|
($0.ValidateTokenRequest value) => value.writeToBuffer(),
|
||||||
|
$0.ValidateTokenResponse.fromBuffer);
|
||||||
|
static final _$getPublicKey =
|
||||||
|
$grpc.ClientMethod<$0.GetPublicKeyRequest, $0.GetPublicKeyResponse>(
|
||||||
|
'/auth.AuthService/GetPublicKey',
|
||||||
|
($0.GetPublicKeyRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetPublicKeyResponse.fromBuffer);
|
||||||
|
static final _$getJWTDomainList = $grpc.ClientMethod<
|
||||||
|
$0.GetJWTDomainListRequest, $0.GetJWTDomainListResponse>(
|
||||||
|
'/auth.AuthService/GetJWTDomainList',
|
||||||
|
($0.GetJWTDomainListRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetJWTDomainListResponse.fromBuffer);
|
||||||
|
static final _$refreshUserProfile = $grpc.ClientMethod<
|
||||||
|
$0.RefreshUserProfileRequest, $0.RefreshUserProfileResponse>(
|
||||||
|
'/auth.AuthService/RefreshUserProfile',
|
||||||
|
($0.RefreshUserProfileRequest value) => value.writeToBuffer(),
|
||||||
|
$0.RefreshUserProfileResponse.fromBuffer);
|
||||||
|
static final _$generateOIDCAuthCode = $grpc.ClientMethod<
|
||||||
|
$0.GenerateOIDCAuthCodeRequest, $0.GenerateOIDCAuthCodeResponse>(
|
||||||
|
'/auth.AuthService/GenerateOIDCAuthCode',
|
||||||
|
($0.GenerateOIDCAuthCodeRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GenerateOIDCAuthCodeResponse.fromBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@$pb.GrpcServiceName('auth.AuthService')
|
||||||
|
abstract class AuthServiceBase extends $grpc.Service {
|
||||||
|
$core.String get $name => 'auth.AuthService';
|
||||||
|
|
||||||
|
AuthServiceBase() {
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.StatusRequest, $0.StatusResponse>(
|
||||||
|
'Status',
|
||||||
|
status_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.StatusRequest.fromBuffer(value),
|
||||||
|
($0.StatusResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.LoginRequest, $0.LoginResponse>(
|
||||||
|
'Login',
|
||||||
|
login_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.LoginRequest.fromBuffer(value),
|
||||||
|
($0.LoginResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.PreRegisterRequest, $0.PreRegisterResponse>(
|
||||||
|
'PreRegister',
|
||||||
|
preRegister_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.PreRegisterRequest.fromBuffer(value),
|
||||||
|
($0.PreRegisterResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.RegisterRequest, $0.RegisterResponse>(
|
||||||
|
'Register',
|
||||||
|
register_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.RegisterRequest.fromBuffer(value),
|
||||||
|
($0.RegisterResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.UnregisterRequest, $0.UnregisterResponse>(
|
||||||
|
'Unregister',
|
||||||
|
unregister_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.UnregisterRequest.fromBuffer(value),
|
||||||
|
($0.UnregisterResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.ValidateTokenRequest, $0.ValidateTokenResponse>(
|
||||||
|
'ValidateToken',
|
||||||
|
validateToken_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.ValidateTokenRequest.fromBuffer(value),
|
||||||
|
($0.ValidateTokenResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.GetPublicKeyRequest, $0.GetPublicKeyResponse>(
|
||||||
|
'GetPublicKey',
|
||||||
|
getPublicKey_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetPublicKeyRequest.fromBuffer(value),
|
||||||
|
($0.GetPublicKeyResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetJWTDomainListRequest,
|
||||||
|
$0.GetJWTDomainListResponse>(
|
||||||
|
'GetJWTDomainList',
|
||||||
|
getJWTDomainList_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetJWTDomainListRequest.fromBuffer(value),
|
||||||
|
($0.GetJWTDomainListResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.RefreshUserProfileRequest,
|
||||||
|
$0.RefreshUserProfileResponse>(
|
||||||
|
'RefreshUserProfile',
|
||||||
|
refreshUserProfile_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.RefreshUserProfileRequest.fromBuffer(value),
|
||||||
|
($0.RefreshUserProfileResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GenerateOIDCAuthCodeRequest,
|
||||||
|
$0.GenerateOIDCAuthCodeResponse>(
|
||||||
|
'GenerateOIDCAuthCode',
|
||||||
|
generateOIDCAuthCode_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GenerateOIDCAuthCodeRequest.fromBuffer(value),
|
||||||
|
($0.GenerateOIDCAuthCodeResponse value) => value.writeToBuffer()));
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.StatusResponse> status_Pre(
|
||||||
|
$grpc.ServiceCall $call, $async.Future<$0.StatusRequest> $request) async {
|
||||||
|
return status($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.StatusResponse> status(
|
||||||
|
$grpc.ServiceCall call, $0.StatusRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.LoginResponse> login_Pre(
|
||||||
|
$grpc.ServiceCall $call, $async.Future<$0.LoginRequest> $request) async {
|
||||||
|
return login($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.LoginResponse> login(
|
||||||
|
$grpc.ServiceCall call, $0.LoginRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.PreRegisterResponse> preRegister_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.PreRegisterRequest> $request) async {
|
||||||
|
return preRegister($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.PreRegisterResponse> preRegister(
|
||||||
|
$grpc.ServiceCall call, $0.PreRegisterRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.RegisterResponse> register_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.RegisterRequest> $request) async {
|
||||||
|
return register($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.RegisterResponse> register(
|
||||||
|
$grpc.ServiceCall call, $0.RegisterRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.UnregisterResponse> unregister_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.UnregisterRequest> $request) async {
|
||||||
|
return unregister($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.UnregisterResponse> unregister(
|
||||||
|
$grpc.ServiceCall call, $0.UnregisterRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.ValidateTokenResponse> validateToken_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.ValidateTokenRequest> $request) async {
|
||||||
|
return validateToken($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.ValidateTokenResponse> validateToken(
|
||||||
|
$grpc.ServiceCall call, $0.ValidateTokenRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetPublicKeyResponse> getPublicKey_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetPublicKeyRequest> $request) async {
|
||||||
|
return getPublicKey($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetPublicKeyResponse> getPublicKey(
|
||||||
|
$grpc.ServiceCall call, $0.GetPublicKeyRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetJWTDomainListResponse> getJWTDomainList_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetJWTDomainListRequest> $request) async {
|
||||||
|
return getJWTDomainList($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetJWTDomainListResponse> getJWTDomainList(
|
||||||
|
$grpc.ServiceCall call, $0.GetJWTDomainListRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.RefreshUserProfileResponse> refreshUserProfile_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.RefreshUserProfileRequest> $request) async {
|
||||||
|
return refreshUserProfile($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.RefreshUserProfileResponse> refreshUserProfile(
|
||||||
|
$grpc.ServiceCall call, $0.RefreshUserProfileRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GenerateOIDCAuthCodeResponse> generateOIDCAuthCode_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GenerateOIDCAuthCodeRequest> $request) async {
|
||||||
|
return generateOIDCAuthCode($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GenerateOIDCAuthCodeResponse> generateOIDCAuthCode(
|
||||||
|
$grpc.ServiceCall call, $0.GenerateOIDCAuthCodeRequest request);
|
||||||
|
}
|
||||||
351
lib/generated/proto/auth/auth.pbjson.dart
Normal file
351
lib/generated/proto/auth/auth.pbjson.dart
Normal file
@ -0,0 +1,351 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/auth/auth.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
// ignore_for_file: unused_import
|
||||||
|
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
|
||||||
|
@$core.Deprecated('Use generateOIDCAuthCodeRequestDescriptor instead')
|
||||||
|
const GenerateOIDCAuthCodeRequest$json = {
|
||||||
|
'1': 'GenerateOIDCAuthCodeRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'nonce', '3': 1, '4': 1, '5': 9, '10': 'nonce'},
|
||||||
|
{'1': 'redirect_uri', '3': 2, '4': 1, '5': 9, '10': 'redirectUri'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GenerateOIDCAuthCodeRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List generateOIDCAuthCodeRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChtHZW5lcmF0ZU9JRENBdXRoQ29kZVJlcXVlc3QSFAoFbm9uY2UYASABKAlSBW5vbmNlEiEKDH'
|
||||||
|
'JlZGlyZWN0X3VyaRgCIAEoCVILcmVkaXJlY3RVcmk=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use generateOIDCAuthCodeResponseDescriptor instead')
|
||||||
|
const GenerateOIDCAuthCodeResponse$json = {
|
||||||
|
'1': 'GenerateOIDCAuthCodeResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'},
|
||||||
|
{'1': 'expires_at', '3': 2, '4': 1, '5': 3, '10': 'expiresAt'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GenerateOIDCAuthCodeResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List generateOIDCAuthCodeResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChxHZW5lcmF0ZU9JRENBdXRoQ29kZVJlc3BvbnNlEhIKBGNvZGUYASABKAlSBGNvZGUSHQoKZX'
|
||||||
|
'hwaXJlc19hdBgCIAEoA1IJZXhwaXJlc0F0');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use refreshUserProfileRequestDescriptor instead')
|
||||||
|
const RefreshUserProfileRequest$json = {
|
||||||
|
'1': 'RefreshUserProfileRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RefreshUserProfileRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List refreshUserProfileRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChlSZWZyZXNoVXNlclByb2ZpbGVSZXF1ZXN0');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use refreshUserProfileResponseDescriptor instead')
|
||||||
|
const RefreshUserProfileResponse$json = {
|
||||||
|
'1': 'RefreshUserProfileResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
{
|
||||||
|
'1': 'user_info',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.auth.GameUserInfo',
|
||||||
|
'10': 'userInfo'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RefreshUserProfileResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List refreshUserProfileResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChpSZWZyZXNoVXNlclByb2ZpbGVSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNzEi'
|
||||||
|
'8KCXVzZXJfaW5mbxgCIAEoCzISLmF1dGguR2FtZVVzZXJJbmZvUgh1c2VySW5mbw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use statusRequestDescriptor instead')
|
||||||
|
const StatusRequest$json = {
|
||||||
|
'1': 'StatusRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `StatusRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List statusRequestDescriptor =
|
||||||
|
$convert.base64Decode('Cg1TdGF0dXNSZXF1ZXN0');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use statusResponseDescriptor instead')
|
||||||
|
const StatusResponse$json = {
|
||||||
|
'1': 'StatusResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'online', '3': 1, '4': 1, '5': 8, '10': 'online'},
|
||||||
|
{'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'},
|
||||||
|
{'1': 'server_time', '3': 3, '4': 1, '5': 3, '10': 'serverTime'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `StatusResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List statusResponseDescriptor = $convert.base64Decode(
|
||||||
|
'Cg5TdGF0dXNSZXNwb25zZRIWCgZvbmxpbmUYASABKAhSBm9ubGluZRIYCgdtZXNzYWdlGAIgAS'
|
||||||
|
'gJUgdtZXNzYWdlEh8KC3NlcnZlcl90aW1lGAMgASgDUgpzZXJ2ZXJUaW1l');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use loginRequestDescriptor instead')
|
||||||
|
const LoginRequest$json = {
|
||||||
|
'1': 'LoginRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `LoginRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List loginRequestDescriptor =
|
||||||
|
$convert.base64Decode('CgxMb2dpblJlcXVlc3Q=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use gameUserInfoDescriptor instead')
|
||||||
|
const GameUserInfo$json = {
|
||||||
|
'1': 'GameUserInfo',
|
||||||
|
'2': [
|
||||||
|
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
|
||||||
|
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
|
||||||
|
{'1': 'citizen_record', '3': 4, '4': 1, '5': 9, '10': 'citizenRecord'},
|
||||||
|
{'1': 'enlisted_date', '3': 5, '4': 1, '5': 3, '10': 'enlistedDate'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GameUserInfo`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List gameUserInfoDescriptor = $convert.base64Decode(
|
||||||
|
'CgxHYW1lVXNlckluZm8SIAoMZ2FtZV91c2VyX2lkGAEgASgJUgpnYW1lVXNlcklkEh8KC2hhbm'
|
||||||
|
'RsZV9uYW1lGAIgASgJUgpoYW5kbGVOYW1lEh0KCmF2YXRhcl91cmwYAyABKAlSCWF2YXRhclVy'
|
||||||
|
'bBIlCg5jaXRpemVuX3JlY29yZBgEIAEoCVINY2l0aXplblJlY29yZBIjCg1lbmxpc3RlZF9kYX'
|
||||||
|
'RlGAUgASgDUgxlbmxpc3RlZERhdGU=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use loginResponseDescriptor instead')
|
||||||
|
const LoginResponse$json = {
|
||||||
|
'1': 'LoginResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
|
||||||
|
{
|
||||||
|
'1': 'user_info',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.auth.GameUserInfo',
|
||||||
|
'10': 'userInfo'
|
||||||
|
},
|
||||||
|
{'1': 'last_login_time', '3': 3, '4': 1, '5': 3, '10': 'lastLoginTime'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `LoginResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List loginResponseDescriptor = $convert.base64Decode(
|
||||||
|
'Cg1Mb2dpblJlc3BvbnNlEhIKBHV1aWQYASABKAlSBHV1aWQSLwoJdXNlcl9pbmZvGAIgASgLMh'
|
||||||
|
'IuYXV0aC5HYW1lVXNlckluZm9SCHVzZXJJbmZvEiYKD2xhc3RfbG9naW5fdGltZRgDIAEoA1IN'
|
||||||
|
'bGFzdExvZ2luVGltZQ==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use preRegisterRequestDescriptor instead')
|
||||||
|
const PreRegisterRequest$json = {
|
||||||
|
'1': 'PreRegisterRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
|
||||||
|
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `PreRegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List preRegisterRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChJQcmVSZWdpc3RlclJlcXVlc3QSEgoEdXVpZBgBIAEoCVIEdXVpZBIgCgxnYW1lX3VzZXJfaW'
|
||||||
|
'QYAiABKAlSCmdhbWVVc2VySWQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use preRegisterResponseDescriptor instead')
|
||||||
|
const PreRegisterResponse$json = {
|
||||||
|
'1': 'PreRegisterResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'verification_code',
|
||||||
|
'3': 1,
|
||||||
|
'4': 1,
|
||||||
|
'5': 9,
|
||||||
|
'10': 'verificationCode'
|
||||||
|
},
|
||||||
|
{'1': 'expire_time', '3': 2, '4': 1, '5': 3, '10': 'expireTime'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `PreRegisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List preRegisterResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChNQcmVSZWdpc3RlclJlc3BvbnNlEisKEXZlcmlmaWNhdGlvbl9jb2RlGAEgASgJUhB2ZXJpZm'
|
||||||
|
'ljYXRpb25Db2RlEh8KC2V4cGlyZV90aW1lGAIgASgDUgpleHBpcmVUaW1l');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use registerRequestDescriptor instead')
|
||||||
|
const RegisterRequest$json = {
|
||||||
|
'1': 'RegisterRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'uuid', '3': 1, '4': 1, '5': 9, '10': 'uuid'},
|
||||||
|
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RegisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List registerRequestDescriptor = $convert.base64Decode(
|
||||||
|
'Cg9SZWdpc3RlclJlcXVlc3QSEgoEdXVpZBgBIAEoCVIEdXVpZBIgCgxnYW1lX3VzZXJfaWQYAi'
|
||||||
|
'ABKAlSCmdhbWVVc2VySWQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use registerResponseDescriptor instead')
|
||||||
|
const RegisterResponse$json = {
|
||||||
|
'1': 'RegisterResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'party_room_secret_key',
|
||||||
|
'3': 1,
|
||||||
|
'4': 1,
|
||||||
|
'5': 9,
|
||||||
|
'10': 'partyRoomSecretKey'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'1': 'user_info',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.auth.GameUserInfo',
|
||||||
|
'10': 'userInfo'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RegisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List registerResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChBSZWdpc3RlclJlc3BvbnNlEjEKFXBhcnR5X3Jvb21fc2VjcmV0X2tleRgBIAEoCVIScGFydH'
|
||||||
|
'lSb29tU2VjcmV0S2V5Ei8KCXVzZXJfaW5mbxgCIAEoCzISLmF1dGguR2FtZVVzZXJJbmZvUgh1'
|
||||||
|
'c2VySW5mbw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use unregisterRequestDescriptor instead')
|
||||||
|
const UnregisterRequest$json = {
|
||||||
|
'1': 'UnregisterRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `UnregisterRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List unregisterRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChFVbnJlZ2lzdGVyUmVxdWVzdA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use unregisterResponseDescriptor instead')
|
||||||
|
const UnregisterResponse$json = {
|
||||||
|
'1': 'UnregisterResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `UnregisterResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List unregisterResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJVbnJlZ2lzdGVyUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use validateTokenRequestDescriptor instead')
|
||||||
|
const ValidateTokenRequest$json = {
|
||||||
|
'1': 'ValidateTokenRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'token', '3': 1, '4': 1, '5': 9, '10': 'token'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `ValidateTokenRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List validateTokenRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChRWYWxpZGF0ZVRva2VuUmVxdWVzdBIUCgV0b2tlbhgBIAEoCVIFdG9rZW4=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use validateTokenResponseDescriptor instead')
|
||||||
|
const ValidateTokenResponse$json = {
|
||||||
|
'1': 'ValidateTokenResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'valid', '3': 1, '4': 1, '5': 8, '10': 'valid'},
|
||||||
|
{'1': 'domain', '3': 2, '4': 1, '5': 9, '10': 'domain'},
|
||||||
|
{'1': 'issued_at', '3': 3, '4': 1, '5': 3, '10': 'issuedAt'},
|
||||||
|
{'1': 'expires_at', '3': 4, '4': 1, '5': 3, '10': 'expiresAt'},
|
||||||
|
{'1': 'error_message', '3': 5, '4': 1, '5': 9, '10': 'errorMessage'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `ValidateTokenResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List validateTokenResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChVWYWxpZGF0ZVRva2VuUmVzcG9uc2USFAoFdmFsaWQYASABKAhSBXZhbGlkEhYKBmRvbWFpbh'
|
||||||
|
'gCIAEoCVIGZG9tYWluEhsKCWlzc3VlZF9hdBgDIAEoA1IIaXNzdWVkQXQSHQoKZXhwaXJlc19h'
|
||||||
|
'dBgEIAEoA1IJZXhwaXJlc0F0EiMKDWVycm9yX21lc3NhZ2UYBSABKAlSDGVycm9yTWVzc2FnZQ'
|
||||||
|
'==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getPublicKeyRequestDescriptor instead')
|
||||||
|
const GetPublicKeyRequest$json = {
|
||||||
|
'1': 'GetPublicKeyRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetPublicKeyRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getPublicKeyRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChNHZXRQdWJsaWNLZXlSZXF1ZXN0');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getPublicKeyResponseDescriptor instead')
|
||||||
|
const GetPublicKeyResponse$json = {
|
||||||
|
'1': 'GetPublicKeyResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'public_key_pem', '3': 1, '4': 1, '5': 9, '10': 'publicKeyPem'},
|
||||||
|
{'1': 'key_id', '3': 2, '4': 1, '5': 9, '10': 'keyId'},
|
||||||
|
{'1': 'algorithm', '3': 3, '4': 1, '5': 9, '10': 'algorithm'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetPublicKeyResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getPublicKeyResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChRHZXRQdWJsaWNLZXlSZXNwb25zZRIkCg5wdWJsaWNfa2V5X3BlbRgBIAEoCVIMcHVibGljS2'
|
||||||
|
'V5UGVtEhUKBmtleV9pZBgCIAEoCVIFa2V5SWQSHAoJYWxnb3JpdGhtGAMgASgJUglhbGdvcml0'
|
||||||
|
'aG0=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use jWTDomainInfoDescriptor instead')
|
||||||
|
const JWTDomainInfo$json = {
|
||||||
|
'1': 'JWTDomainInfo',
|
||||||
|
'2': [
|
||||||
|
{'1': 'domain', '3': 1, '4': 1, '5': 9, '10': 'domain'},
|
||||||
|
{'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `JWTDomainInfo`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List jWTDomainInfoDescriptor = $convert.base64Decode(
|
||||||
|
'Cg1KV1REb21haW5JbmZvEhYKBmRvbWFpbhgBIAEoCVIGZG9tYWluEhIKBG5hbWUYAiABKAlSBG'
|
||||||
|
'5hbWU=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getJWTDomainListRequestDescriptor instead')
|
||||||
|
const GetJWTDomainListRequest$json = {
|
||||||
|
'1': 'GetJWTDomainListRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetJWTDomainListRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getJWTDomainListRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChdHZXRKV1REb21haW5MaXN0UmVxdWVzdA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getJWTDomainListResponseDescriptor instead')
|
||||||
|
const GetJWTDomainListResponse$json = {
|
||||||
|
'1': 'GetJWTDomainListResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'domains',
|
||||||
|
'3': 1,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.auth.JWTDomainInfo',
|
||||||
|
'10': 'domains'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetJWTDomainListResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getJWTDomainListResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChhHZXRKV1REb21haW5MaXN0UmVzcG9uc2USLQoHZG9tYWlucxgBIAMoCzITLmF1dGguSldURG'
|
||||||
|
'9tYWluSW5mb1IHZG9tYWlucw==');
|
||||||
601
lib/generated/proto/common/common.pb.dart
Normal file
601
lib/generated/proto/common/common.pb.dart
Normal file
@ -0,0 +1,601 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/common/common.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
|
||||||
|
|
||||||
|
/// 获取服务器时间请求
|
||||||
|
class GetServerTimeRequest extends $pb.GeneratedMessage {
|
||||||
|
factory GetServerTimeRequest() => create();
|
||||||
|
|
||||||
|
GetServerTimeRequest._();
|
||||||
|
|
||||||
|
factory GetServerTimeRequest.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetServerTimeRequest.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetServerTimeRequest',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetServerTimeRequest clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetServerTimeRequest copyWith(void Function(GetServerTimeRequest) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetServerTimeRequest))
|
||||||
|
as GetServerTimeRequest;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetServerTimeRequest create() => GetServerTimeRequest._();
|
||||||
|
@$core.override
|
||||||
|
GetServerTimeRequest createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetServerTimeRequest getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetServerTimeRequest>(create);
|
||||||
|
static GetServerTimeRequest? _defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取服务器时间响应
|
||||||
|
class GetServerTimeResponse extends $pb.GeneratedMessage {
|
||||||
|
factory GetServerTimeResponse({
|
||||||
|
$fixnum.Int64? timestamp,
|
||||||
|
$core.String? timezone,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (timestamp != null) result.timestamp = timestamp;
|
||||||
|
if (timezone != null) result.timezone = timezone;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetServerTimeResponse._();
|
||||||
|
|
||||||
|
factory GetServerTimeResponse.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetServerTimeResponse.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetServerTimeResponse',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..aInt64(1, _omitFieldNames ? '' : 'timestamp')
|
||||||
|
..aOS(2, _omitFieldNames ? '' : 'timezone')
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetServerTimeResponse clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetServerTimeResponse copyWith(
|
||||||
|
void Function(GetServerTimeResponse) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetServerTimeResponse))
|
||||||
|
as GetServerTimeResponse;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetServerTimeResponse create() => GetServerTimeResponse._();
|
||||||
|
@$core.override
|
||||||
|
GetServerTimeResponse createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetServerTimeResponse getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetServerTimeResponse>(create);
|
||||||
|
static GetServerTimeResponse? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$fixnum.Int64 get timestamp => $_getI64(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set timestamp($fixnum.Int64 value) => $_setInt64(0, value);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasTimestamp() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearTimestamp() => $_clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get timezone => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set timezone($core.String value) => $_setString(1, value);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasTimezone() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearTimezone() => $_clearField(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取版本请求
|
||||||
|
class GetVersionRequest extends $pb.GeneratedMessage {
|
||||||
|
factory GetVersionRequest() => create();
|
||||||
|
|
||||||
|
GetVersionRequest._();
|
||||||
|
|
||||||
|
factory GetVersionRequest.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetVersionRequest.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetVersionRequest',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetVersionRequest clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetVersionRequest copyWith(void Function(GetVersionRequest) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetVersionRequest))
|
||||||
|
as GetVersionRequest;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetVersionRequest create() => GetVersionRequest._();
|
||||||
|
@$core.override
|
||||||
|
GetVersionRequest createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetVersionRequest getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetVersionRequest>(create);
|
||||||
|
static GetVersionRequest? _defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取版本响应
|
||||||
|
class GetVersionResponse extends $pb.GeneratedMessage {
|
||||||
|
factory GetVersionResponse({
|
||||||
|
$core.int? version,
|
||||||
|
$core.int? latestVersion,
|
||||||
|
$core.int? minClientVersion,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (version != null) result.version = version;
|
||||||
|
if (latestVersion != null) result.latestVersion = latestVersion;
|
||||||
|
if (minClientVersion != null) result.minClientVersion = minClientVersion;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetVersionResponse._();
|
||||||
|
|
||||||
|
factory GetVersionResponse.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetVersionResponse.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetVersionResponse',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..aI(1, _omitFieldNames ? '' : 'version')
|
||||||
|
..aI(2, _omitFieldNames ? '' : 'latestVersion')
|
||||||
|
..aI(3, _omitFieldNames ? '' : 'minClientVersion')
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetVersionResponse clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetVersionResponse copyWith(void Function(GetVersionResponse) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetVersionResponse))
|
||||||
|
as GetVersionResponse;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetVersionResponse create() => GetVersionResponse._();
|
||||||
|
@$core.override
|
||||||
|
GetVersionResponse createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetVersionResponse getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetVersionResponse>(create);
|
||||||
|
static GetVersionResponse? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.int get version => $_getIZ(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set version($core.int value) => $_setSignedInt32(0, value);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasVersion() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearVersion() => $_clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.int get latestVersion => $_getIZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set latestVersion($core.int value) => $_setSignedInt32(1, value);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasLatestVersion() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearLatestVersion() => $_clearField(2);
|
||||||
|
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.int get minClientVersion => $_getIZ(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
set minClientVersion($core.int value) => $_setSignedInt32(2, value);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.bool hasMinClientVersion() => $_has(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
void clearMinClientVersion() => $_clearField(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 信号类型
|
||||||
|
class SignalType extends $pb.GeneratedMessage {
|
||||||
|
factory SignalType({
|
||||||
|
$core.String? id,
|
||||||
|
$core.String? name,
|
||||||
|
$core.bool? isSpecial,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (id != null) result.id = id;
|
||||||
|
if (name != null) result.name = name;
|
||||||
|
if (isSpecial != null) result.isSpecial = isSpecial;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
SignalType._();
|
||||||
|
|
||||||
|
factory SignalType.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory SignalType.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'SignalType',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..aOS(1, _omitFieldNames ? '' : 'id')
|
||||||
|
..aOS(2, _omitFieldNames ? '' : 'name')
|
||||||
|
..aOB(3, _omitFieldNames ? '' : 'isSpecial')
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
SignalType clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
SignalType copyWith(void Function(SignalType) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as SignalType)) as SignalType;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static SignalType create() => SignalType._();
|
||||||
|
@$core.override
|
||||||
|
SignalType createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static SignalType getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<SignalType>(create);
|
||||||
|
static SignalType? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.String get id => $_getSZ(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set id($core.String value) => $_setString(0, value);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasId() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearId() => $_clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get name => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set name($core.String value) => $_setString(1, value);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasName() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearName() => $_clearField(2);
|
||||||
|
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.bool get isSpecial => $_getBF(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
set isSpecial($core.bool value) => $_setBool(2, value);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.bool hasIsSpecial() => $_has(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
void clearIsSpecial() => $_clearField(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取信号类型请求
|
||||||
|
class GetSignalTypesRequest extends $pb.GeneratedMessage {
|
||||||
|
factory GetSignalTypesRequest() => create();
|
||||||
|
|
||||||
|
GetSignalTypesRequest._();
|
||||||
|
|
||||||
|
factory GetSignalTypesRequest.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetSignalTypesRequest.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetSignalTypesRequest',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetSignalTypesRequest clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetSignalTypesRequest copyWith(
|
||||||
|
void Function(GetSignalTypesRequest) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetSignalTypesRequest))
|
||||||
|
as GetSignalTypesRequest;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetSignalTypesRequest create() => GetSignalTypesRequest._();
|
||||||
|
@$core.override
|
||||||
|
GetSignalTypesRequest createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetSignalTypesRequest getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetSignalTypesRequest>(create);
|
||||||
|
static GetSignalTypesRequest? _defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取信号类型响应
|
||||||
|
class GetSignalTypesResponse extends $pb.GeneratedMessage {
|
||||||
|
factory GetSignalTypesResponse({
|
||||||
|
$core.Iterable<SignalType>? signals,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (signals != null) result.signals.addAll(signals);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSignalTypesResponse._();
|
||||||
|
|
||||||
|
factory GetSignalTypesResponse.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetSignalTypesResponse.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetSignalTypesResponse',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..pPM<SignalType>(1, _omitFieldNames ? '' : 'signals',
|
||||||
|
subBuilder: SignalType.create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetSignalTypesResponse clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetSignalTypesResponse copyWith(
|
||||||
|
void Function(GetSignalTypesResponse) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetSignalTypesResponse))
|
||||||
|
as GetSignalTypesResponse;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetSignalTypesResponse create() => GetSignalTypesResponse._();
|
||||||
|
@$core.override
|
||||||
|
GetSignalTypesResponse createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetSignalTypesResponse getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetSignalTypesResponse>(create);
|
||||||
|
static GetSignalTypesResponse? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$pb.PbList<SignalType> get signals => $_getList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 标签
|
||||||
|
class Tag extends $pb.GeneratedMessage {
|
||||||
|
factory Tag({
|
||||||
|
$core.String? id,
|
||||||
|
$core.String? name,
|
||||||
|
$core.String? info,
|
||||||
|
$core.String? color,
|
||||||
|
$core.Iterable<Tag>? subTags,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (id != null) result.id = id;
|
||||||
|
if (name != null) result.name = name;
|
||||||
|
if (info != null) result.info = info;
|
||||||
|
if (color != null) result.color = color;
|
||||||
|
if (subTags != null) result.subTags.addAll(subTags);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Tag._();
|
||||||
|
|
||||||
|
factory Tag.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory Tag.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'Tag',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..aOS(1, _omitFieldNames ? '' : 'id')
|
||||||
|
..aOS(2, _omitFieldNames ? '' : 'name')
|
||||||
|
..aOS(3, _omitFieldNames ? '' : 'info')
|
||||||
|
..aOS(4, _omitFieldNames ? '' : 'color')
|
||||||
|
..pPM<Tag>(5, _omitFieldNames ? '' : 'subTags', subBuilder: Tag.create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
Tag clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
Tag copyWith(void Function(Tag) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as Tag)) as Tag;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Tag create() => Tag._();
|
||||||
|
@$core.override
|
||||||
|
Tag createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static Tag getDefault() =>
|
||||||
|
_defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<Tag>(create);
|
||||||
|
static Tag? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.String get id => $_getSZ(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
set id($core.String value) => $_setString(0, value);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$core.bool hasId() => $_has(0);
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
void clearId() => $_clearField(1);
|
||||||
|
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.String get name => $_getSZ(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
set name($core.String value) => $_setString(1, value);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
$core.bool hasName() => $_has(1);
|
||||||
|
@$pb.TagNumber(2)
|
||||||
|
void clearName() => $_clearField(2);
|
||||||
|
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.String get info => $_getSZ(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
set info($core.String value) => $_setString(2, value);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
$core.bool hasInfo() => $_has(2);
|
||||||
|
@$pb.TagNumber(3)
|
||||||
|
void clearInfo() => $_clearField(3);
|
||||||
|
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$core.String get color => $_getSZ(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
set color($core.String value) => $_setString(3, value);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
$core.bool hasColor() => $_has(3);
|
||||||
|
@$pb.TagNumber(4)
|
||||||
|
void clearColor() => $_clearField(4);
|
||||||
|
|
||||||
|
@$pb.TagNumber(5)
|
||||||
|
$pb.PbList<Tag> get subTags => $_getList(4);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取标签请求
|
||||||
|
class GetTagsRequest extends $pb.GeneratedMessage {
|
||||||
|
factory GetTagsRequest() => create();
|
||||||
|
|
||||||
|
GetTagsRequest._();
|
||||||
|
|
||||||
|
factory GetTagsRequest.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetTagsRequest.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetTagsRequest',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetTagsRequest clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetTagsRequest copyWith(void Function(GetTagsRequest) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetTagsRequest))
|
||||||
|
as GetTagsRequest;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetTagsRequest create() => GetTagsRequest._();
|
||||||
|
@$core.override
|
||||||
|
GetTagsRequest createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetTagsRequest getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetTagsRequest>(create);
|
||||||
|
static GetTagsRequest? _defaultInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取标签响应
|
||||||
|
class GetTagsResponse extends $pb.GeneratedMessage {
|
||||||
|
factory GetTagsResponse({
|
||||||
|
$core.Iterable<Tag>? tags,
|
||||||
|
}) {
|
||||||
|
final result = create();
|
||||||
|
if (tags != null) result.tags.addAll(tags);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetTagsResponse._();
|
||||||
|
|
||||||
|
factory GetTagsResponse.fromBuffer($core.List<$core.int> data,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromBuffer(data, registry);
|
||||||
|
factory GetTagsResponse.fromJson($core.String json,
|
||||||
|
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
|
||||||
|
create()..mergeFromJson(json, registry);
|
||||||
|
|
||||||
|
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||||
|
_omitMessageNames ? '' : 'GetTagsResponse',
|
||||||
|
package: const $pb.PackageName(_omitMessageNames ? '' : 'common'),
|
||||||
|
createEmptyInstance: create)
|
||||||
|
..pPM<Tag>(1, _omitFieldNames ? '' : 'tags', subBuilder: Tag.create)
|
||||||
|
..hasRequiredFields = false;
|
||||||
|
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetTagsResponse clone() => deepCopy();
|
||||||
|
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
|
||||||
|
GetTagsResponse copyWith(void Function(GetTagsResponse) updates) =>
|
||||||
|
super.copyWith((message) => updates(message as GetTagsResponse))
|
||||||
|
as GetTagsResponse;
|
||||||
|
|
||||||
|
@$core.override
|
||||||
|
$pb.BuilderInfo get info_ => _i;
|
||||||
|
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetTagsResponse create() => GetTagsResponse._();
|
||||||
|
@$core.override
|
||||||
|
GetTagsResponse createEmptyInstance() => create();
|
||||||
|
@$core.pragma('dart2js:noInline')
|
||||||
|
static GetTagsResponse getDefault() => _defaultInstance ??=
|
||||||
|
$pb.GeneratedMessage.$_defaultFor<GetTagsResponse>(create);
|
||||||
|
static GetTagsResponse? _defaultInstance;
|
||||||
|
|
||||||
|
@$pb.TagNumber(1)
|
||||||
|
$pb.PbList<Tag> get tags => $_getList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const $core.bool _omitFieldNames =
|
||||||
|
$core.bool.fromEnvironment('protobuf.omit_field_names');
|
||||||
|
const $core.bool _omitMessageNames =
|
||||||
|
$core.bool.fromEnvironment('protobuf.omit_message_names');
|
||||||
11
lib/generated/proto/common/common.pbenum.dart
Normal file
11
lib/generated/proto/common/common.pbenum.dart
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/common/common.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
164
lib/generated/proto/common/common.pbgrpc.dart
Normal file
164
lib/generated/proto/common/common.pbgrpc.dart
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/common/common.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
|
||||||
|
import 'dart:async' as $async;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:grpc/service_api.dart' as $grpc;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
import 'common.pb.dart' as $0;
|
||||||
|
|
||||||
|
export 'common.pb.dart';
|
||||||
|
|
||||||
|
/// 通用服务
|
||||||
|
@$pb.GrpcServiceName('common.CommonService')
|
||||||
|
class CommonServiceClient extends $grpc.Client {
|
||||||
|
/// The hostname for this service.
|
||||||
|
static const $core.String defaultHost = '';
|
||||||
|
|
||||||
|
/// OAuth scopes needed for the client.
|
||||||
|
static const $core.List<$core.String> oauthScopes = [
|
||||||
|
'',
|
||||||
|
];
|
||||||
|
|
||||||
|
CommonServiceClient(super.channel, {super.options, super.interceptors});
|
||||||
|
|
||||||
|
/// 获取服务器时间(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.GetServerTimeResponse> getServerTime(
|
||||||
|
$0.GetServerTimeRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getServerTime, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取版本信息(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.GetVersionResponse> getVersion(
|
||||||
|
$0.GetVersionRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getVersion, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取信号类型列表(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.GetSignalTypesResponse> getSignalTypes(
|
||||||
|
$0.GetSignalTypesRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getSignalTypes, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取房间标签(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.GetTagsResponse> getTags(
|
||||||
|
$0.GetTagsRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getTags, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// method descriptors
|
||||||
|
|
||||||
|
static final _$getServerTime =
|
||||||
|
$grpc.ClientMethod<$0.GetServerTimeRequest, $0.GetServerTimeResponse>(
|
||||||
|
'/common.CommonService/GetServerTime',
|
||||||
|
($0.GetServerTimeRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetServerTimeResponse.fromBuffer);
|
||||||
|
static final _$getVersion =
|
||||||
|
$grpc.ClientMethod<$0.GetVersionRequest, $0.GetVersionResponse>(
|
||||||
|
'/common.CommonService/GetVersion',
|
||||||
|
($0.GetVersionRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetVersionResponse.fromBuffer);
|
||||||
|
static final _$getSignalTypes =
|
||||||
|
$grpc.ClientMethod<$0.GetSignalTypesRequest, $0.GetSignalTypesResponse>(
|
||||||
|
'/common.CommonService/GetSignalTypes',
|
||||||
|
($0.GetSignalTypesRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetSignalTypesResponse.fromBuffer);
|
||||||
|
static final _$getTags =
|
||||||
|
$grpc.ClientMethod<$0.GetTagsRequest, $0.GetTagsResponse>(
|
||||||
|
'/common.CommonService/GetTags',
|
||||||
|
($0.GetTagsRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetTagsResponse.fromBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@$pb.GrpcServiceName('common.CommonService')
|
||||||
|
abstract class CommonServiceBase extends $grpc.Service {
|
||||||
|
$core.String get $name => 'common.CommonService';
|
||||||
|
|
||||||
|
CommonServiceBase() {
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.GetServerTimeRequest, $0.GetServerTimeResponse>(
|
||||||
|
'GetServerTime',
|
||||||
|
getServerTime_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetServerTimeRequest.fromBuffer(value),
|
||||||
|
($0.GetServerTimeResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetVersionRequest, $0.GetVersionResponse>(
|
||||||
|
'GetVersion',
|
||||||
|
getVersion_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.GetVersionRequest.fromBuffer(value),
|
||||||
|
($0.GetVersionResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetSignalTypesRequest,
|
||||||
|
$0.GetSignalTypesResponse>(
|
||||||
|
'GetSignalTypes',
|
||||||
|
getSignalTypes_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetSignalTypesRequest.fromBuffer(value),
|
||||||
|
($0.GetSignalTypesResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetTagsRequest, $0.GetTagsResponse>(
|
||||||
|
'GetTags',
|
||||||
|
getTags_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.GetTagsRequest.fromBuffer(value),
|
||||||
|
($0.GetTagsResponse value) => value.writeToBuffer()));
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetServerTimeResponse> getServerTime_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetServerTimeRequest> $request) async {
|
||||||
|
return getServerTime($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetServerTimeResponse> getServerTime(
|
||||||
|
$grpc.ServiceCall call, $0.GetServerTimeRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetVersionResponse> getVersion_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetVersionRequest> $request) async {
|
||||||
|
return getVersion($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetVersionResponse> getVersion(
|
||||||
|
$grpc.ServiceCall call, $0.GetVersionRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetSignalTypesResponse> getSignalTypes_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetSignalTypesRequest> $request) async {
|
||||||
|
return getSignalTypes($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetSignalTypesResponse> getSignalTypes(
|
||||||
|
$grpc.ServiceCall call, $0.GetSignalTypesRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetTagsResponse> getTags_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetTagsRequest> $request) async {
|
||||||
|
return getTags($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetTagsResponse> getTags(
|
||||||
|
$grpc.ServiceCall call, $0.GetTagsRequest request);
|
||||||
|
}
|
||||||
161
lib/generated/proto/common/common.pbjson.dart
Normal file
161
lib/generated/proto/common/common.pbjson.dart
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/common/common.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
// ignore_for_file: unused_import
|
||||||
|
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getServerTimeRequestDescriptor instead')
|
||||||
|
const GetServerTimeRequest$json = {
|
||||||
|
'1': 'GetServerTimeRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetServerTimeRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getServerTimeRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChRHZXRTZXJ2ZXJUaW1lUmVxdWVzdA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getServerTimeResponseDescriptor instead')
|
||||||
|
const GetServerTimeResponse$json = {
|
||||||
|
'1': 'GetServerTimeResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'timestamp', '3': 1, '4': 1, '5': 3, '10': 'timestamp'},
|
||||||
|
{'1': 'timezone', '3': 2, '4': 1, '5': 9, '10': 'timezone'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetServerTimeResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getServerTimeResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChVHZXRTZXJ2ZXJUaW1lUmVzcG9uc2USHAoJdGltZXN0YW1wGAEgASgDUgl0aW1lc3RhbXASGg'
|
||||||
|
'oIdGltZXpvbmUYAiABKAlSCHRpbWV6b25l');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getVersionRequestDescriptor instead')
|
||||||
|
const GetVersionRequest$json = {
|
||||||
|
'1': 'GetVersionRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetVersionRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getVersionRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChFHZXRWZXJzaW9uUmVxdWVzdA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getVersionResponseDescriptor instead')
|
||||||
|
const GetVersionResponse$json = {
|
||||||
|
'1': 'GetVersionResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'version', '3': 1, '4': 1, '5': 5, '10': 'version'},
|
||||||
|
{'1': 'latest_version', '3': 2, '4': 1, '5': 5, '10': 'latestVersion'},
|
||||||
|
{
|
||||||
|
'1': 'min_client_version',
|
||||||
|
'3': 3,
|
||||||
|
'4': 1,
|
||||||
|
'5': 5,
|
||||||
|
'10': 'minClientVersion'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetVersionResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getVersionResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChJHZXRWZXJzaW9uUmVzcG9uc2USGAoHdmVyc2lvbhgBIAEoBVIHdmVyc2lvbhIlCg5sYXRlc3'
|
||||||
|
'RfdmVyc2lvbhgCIAEoBVINbGF0ZXN0VmVyc2lvbhIsChJtaW5fY2xpZW50X3ZlcnNpb24YAyAB'
|
||||||
|
'KAVSEG1pbkNsaWVudFZlcnNpb24=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use signalTypeDescriptor instead')
|
||||||
|
const SignalType$json = {
|
||||||
|
'1': 'SignalType',
|
||||||
|
'2': [
|
||||||
|
{'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||||
|
{'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||||
|
{'1': 'is_special', '3': 3, '4': 1, '5': 8, '10': 'isSpecial'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `SignalType`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List signalTypeDescriptor = $convert.base64Decode(
|
||||||
|
'CgpTaWduYWxUeXBlEg4KAmlkGAEgASgJUgJpZBISCgRuYW1lGAIgASgJUgRuYW1lEh0KCmlzX3'
|
||||||
|
'NwZWNpYWwYAyABKAhSCWlzU3BlY2lhbA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getSignalTypesRequestDescriptor instead')
|
||||||
|
const GetSignalTypesRequest$json = {
|
||||||
|
'1': 'GetSignalTypesRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetSignalTypesRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getSignalTypesRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChVHZXRTaWduYWxUeXBlc1JlcXVlc3Q=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getSignalTypesResponseDescriptor instead')
|
||||||
|
const GetSignalTypesResponse$json = {
|
||||||
|
'1': 'GetSignalTypesResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'signals',
|
||||||
|
'3': 1,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.common.SignalType',
|
||||||
|
'10': 'signals'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetSignalTypesResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getSignalTypesResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChZHZXRTaWduYWxUeXBlc1Jlc3BvbnNlEiwKB3NpZ25hbHMYASADKAsyEi5jb21tb24uU2lnbm'
|
||||||
|
'FsVHlwZVIHc2lnbmFscw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use tagDescriptor instead')
|
||||||
|
const Tag$json = {
|
||||||
|
'1': 'Tag',
|
||||||
|
'2': [
|
||||||
|
{'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
|
||||||
|
{'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||||
|
{'1': 'info', '3': 3, '4': 1, '5': 9, '10': 'info'},
|
||||||
|
{'1': 'color', '3': 4, '4': 1, '5': 9, '10': 'color'},
|
||||||
|
{
|
||||||
|
'1': 'sub_tags',
|
||||||
|
'3': 5,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.common.Tag',
|
||||||
|
'10': 'subTags'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `Tag`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List tagDescriptor = $convert.base64Decode(
|
||||||
|
'CgNUYWcSDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSEgoEaW5mbxgDIAEoCV'
|
||||||
|
'IEaW5mbxIUCgVjb2xvchgEIAEoCVIFY29sb3ISJgoIc3ViX3RhZ3MYBSADKAsyCy5jb21tb24u'
|
||||||
|
'VGFnUgdzdWJUYWdz');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getTagsRequestDescriptor instead')
|
||||||
|
const GetTagsRequest$json = {
|
||||||
|
'1': 'GetTagsRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetTagsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getTagsRequestDescriptor =
|
||||||
|
$convert.base64Decode('Cg5HZXRUYWdzUmVxdWVzdA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getTagsResponseDescriptor instead')
|
||||||
|
const GetTagsResponse$json = {
|
||||||
|
'1': 'GetTagsResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'tags', '3': 1, '4': 3, '5': 11, '6': '.common.Tag', '10': 'tags'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetTagsResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getTagsResponseDescriptor = $convert.base64Decode(
|
||||||
|
'Cg9HZXRUYWdzUmVzcG9uc2USHwoEdGFncxgBIAMoCzILLmNvbW1vbi5UYWdSBHRhZ3M=');
|
||||||
2980
lib/generated/proto/partroom/partroom.pb.dart
Normal file
2980
lib/generated/proto/partroom/partroom.pb.dart
Normal file
File diff suppressed because it is too large
Load Diff
56
lib/generated/proto/partroom/partroom.pbenum.dart
Normal file
56
lib/generated/proto/partroom/partroom.pbenum.dart
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/partroom/partroom.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
/// 房间事件类型
|
||||||
|
class RoomEventType extends $pb.ProtobufEnum {
|
||||||
|
static const RoomEventType MEMBER_JOINED =
|
||||||
|
RoomEventType._(0, _omitEnumNames ? '' : 'MEMBER_JOINED');
|
||||||
|
static const RoomEventType MEMBER_LEFT =
|
||||||
|
RoomEventType._(1, _omitEnumNames ? '' : 'MEMBER_LEFT');
|
||||||
|
static const RoomEventType OWNER_CHANGED =
|
||||||
|
RoomEventType._(2, _omitEnumNames ? '' : 'OWNER_CHANGED');
|
||||||
|
static const RoomEventType ROOM_UPDATED =
|
||||||
|
RoomEventType._(3, _omitEnumNames ? '' : 'ROOM_UPDATED');
|
||||||
|
static const RoomEventType MEMBER_STATUS_UPDATED =
|
||||||
|
RoomEventType._(4, _omitEnumNames ? '' : 'MEMBER_STATUS_UPDATED');
|
||||||
|
static const RoomEventType SIGNAL_BROADCAST =
|
||||||
|
RoomEventType._(5, _omitEnumNames ? '' : 'SIGNAL_BROADCAST');
|
||||||
|
static const RoomEventType ROOM_DISMISSED =
|
||||||
|
RoomEventType._(6, _omitEnumNames ? '' : 'ROOM_DISMISSED');
|
||||||
|
static const RoomEventType MEMBER_KICKED =
|
||||||
|
RoomEventType._(7, _omitEnumNames ? '' : 'MEMBER_KICKED');
|
||||||
|
|
||||||
|
static const $core.List<RoomEventType> values = <RoomEventType>[
|
||||||
|
MEMBER_JOINED,
|
||||||
|
MEMBER_LEFT,
|
||||||
|
OWNER_CHANGED,
|
||||||
|
ROOM_UPDATED,
|
||||||
|
MEMBER_STATUS_UPDATED,
|
||||||
|
SIGNAL_BROADCAST,
|
||||||
|
ROOM_DISMISSED,
|
||||||
|
MEMBER_KICKED,
|
||||||
|
];
|
||||||
|
|
||||||
|
static final $core.List<RoomEventType?> _byValue =
|
||||||
|
$pb.ProtobufEnum.$_initByValueList(values, 7);
|
||||||
|
static RoomEventType? valueOf($core.int value) =>
|
||||||
|
value < 0 || value >= _byValue.length ? null : _byValue[value];
|
||||||
|
|
||||||
|
const RoomEventType._(super.value, super.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
const $core.bool _omitEnumNames =
|
||||||
|
$core.bool.fromEnvironment('protobuf.omit_enum_names');
|
||||||
543
lib/generated/proto/partroom/partroom.pbgrpc.dart
Normal file
543
lib/generated/proto/partroom/partroom.pbgrpc.dart
Normal file
@ -0,0 +1,543 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/partroom/partroom.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
|
||||||
|
import 'dart:async' as $async;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
|
||||||
|
import 'package:grpc/service_api.dart' as $grpc;
|
||||||
|
import 'package:protobuf/protobuf.dart' as $pb;
|
||||||
|
|
||||||
|
import 'partroom.pb.dart' as $0;
|
||||||
|
|
||||||
|
export 'partroom.pb.dart';
|
||||||
|
|
||||||
|
/// 房间服务
|
||||||
|
@$pb.GrpcServiceName('partroom.PartRoomService')
|
||||||
|
class PartRoomServiceClient extends $grpc.Client {
|
||||||
|
/// The hostname for this service.
|
||||||
|
static const $core.String defaultHost = '';
|
||||||
|
|
||||||
|
/// OAuth scopes needed for the client.
|
||||||
|
static const $core.List<$core.String> oauthScopes = [
|
||||||
|
'',
|
||||||
|
];
|
||||||
|
|
||||||
|
PartRoomServiceClient(super.channel, {super.options, super.interceptors});
|
||||||
|
|
||||||
|
/// 获取房间列表(匿名接口)
|
||||||
|
$grpc.ResponseFuture<$0.GetRoomListResponse> getRoomList(
|
||||||
|
$0.GetRoomListRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getRoomList, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 创建房间(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.CreateRoomResponse> createRoom(
|
||||||
|
$0.CreateRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$createRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 加入房间(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.JoinRoomResponse> joinRoom(
|
||||||
|
$0.JoinRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$joinRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 离开房间(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.LeaveRoomResponse> leaveRoom(
|
||||||
|
$0.LeaveRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$leaveRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 解散房间(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.DismissRoomResponse> dismissRoom(
|
||||||
|
$0.DismissRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$dismissRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取房间详情(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.GetRoomInfoResponse> getRoomInfo(
|
||||||
|
$0.GetRoomInfoRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getRoomInfo, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取房间成员列表(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.GetRoomMembersResponse> getRoomMembers(
|
||||||
|
$0.GetRoomMembersRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getRoomMembers, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 心跳(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.HeartbeatResponse> heartbeat(
|
||||||
|
$0.HeartbeatRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$heartbeat, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取当前用户所在房间(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.GetMyRoomResponse> getMyRoom(
|
||||||
|
$0.GetMyRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getMyRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 更新房间信息(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.UpdateRoomResponse> updateRoom(
|
||||||
|
$0.UpdateRoomRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$updateRoom, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 踢出成员(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.KickMemberResponse> kickMember(
|
||||||
|
$0.KickMemberRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$kickMember, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 设置状态(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.SetStatusResponse> setStatus(
|
||||||
|
$0.SetStatusRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$setStatus, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 发送信号(需认证)
|
||||||
|
$grpc.ResponseFuture<$0.SendSignalResponse> sendSignal(
|
||||||
|
$0.SendSignalRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$sendSignal, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 监听房间事件流(需认证)
|
||||||
|
$grpc.ResponseStream<$0.RoomEvent> listenRoomEvents(
|
||||||
|
$0.ListenRoomEventsRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createStreamingCall(
|
||||||
|
_$listenRoomEvents, $async.Stream.fromIterable([request]),
|
||||||
|
options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 转移房主(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.TransferOwnershipResponse> transferOwnership(
|
||||||
|
$0.TransferOwnershipRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$transferOwnership, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取被踢出成员列表(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.GetKickedMembersResponse> getKickedMembers(
|
||||||
|
$0.GetKickedMembersRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$getKickedMembers, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移除被踢出成员(需认证,仅房主)
|
||||||
|
$grpc.ResponseFuture<$0.RemoveKickedMemberResponse> removeKickedMember(
|
||||||
|
$0.RemoveKickedMemberRequest request, {
|
||||||
|
$grpc.CallOptions? options,
|
||||||
|
}) {
|
||||||
|
return $createUnaryCall(_$removeKickedMember, request, options: options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// method descriptors
|
||||||
|
|
||||||
|
static final _$getRoomList =
|
||||||
|
$grpc.ClientMethod<$0.GetRoomListRequest, $0.GetRoomListResponse>(
|
||||||
|
'/partroom.PartRoomService/GetRoomList',
|
||||||
|
($0.GetRoomListRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetRoomListResponse.fromBuffer);
|
||||||
|
static final _$createRoom =
|
||||||
|
$grpc.ClientMethod<$0.CreateRoomRequest, $0.CreateRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/CreateRoom',
|
||||||
|
($0.CreateRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.CreateRoomResponse.fromBuffer);
|
||||||
|
static final _$joinRoom =
|
||||||
|
$grpc.ClientMethod<$0.JoinRoomRequest, $0.JoinRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/JoinRoom',
|
||||||
|
($0.JoinRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.JoinRoomResponse.fromBuffer);
|
||||||
|
static final _$leaveRoom =
|
||||||
|
$grpc.ClientMethod<$0.LeaveRoomRequest, $0.LeaveRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/LeaveRoom',
|
||||||
|
($0.LeaveRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.LeaveRoomResponse.fromBuffer);
|
||||||
|
static final _$dismissRoom =
|
||||||
|
$grpc.ClientMethod<$0.DismissRoomRequest, $0.DismissRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/DismissRoom',
|
||||||
|
($0.DismissRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.DismissRoomResponse.fromBuffer);
|
||||||
|
static final _$getRoomInfo =
|
||||||
|
$grpc.ClientMethod<$0.GetRoomInfoRequest, $0.GetRoomInfoResponse>(
|
||||||
|
'/partroom.PartRoomService/GetRoomInfo',
|
||||||
|
($0.GetRoomInfoRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetRoomInfoResponse.fromBuffer);
|
||||||
|
static final _$getRoomMembers =
|
||||||
|
$grpc.ClientMethod<$0.GetRoomMembersRequest, $0.GetRoomMembersResponse>(
|
||||||
|
'/partroom.PartRoomService/GetRoomMembers',
|
||||||
|
($0.GetRoomMembersRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetRoomMembersResponse.fromBuffer);
|
||||||
|
static final _$heartbeat =
|
||||||
|
$grpc.ClientMethod<$0.HeartbeatRequest, $0.HeartbeatResponse>(
|
||||||
|
'/partroom.PartRoomService/Heartbeat',
|
||||||
|
($0.HeartbeatRequest value) => value.writeToBuffer(),
|
||||||
|
$0.HeartbeatResponse.fromBuffer);
|
||||||
|
static final _$getMyRoom =
|
||||||
|
$grpc.ClientMethod<$0.GetMyRoomRequest, $0.GetMyRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/GetMyRoom',
|
||||||
|
($0.GetMyRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetMyRoomResponse.fromBuffer);
|
||||||
|
static final _$updateRoom =
|
||||||
|
$grpc.ClientMethod<$0.UpdateRoomRequest, $0.UpdateRoomResponse>(
|
||||||
|
'/partroom.PartRoomService/UpdateRoom',
|
||||||
|
($0.UpdateRoomRequest value) => value.writeToBuffer(),
|
||||||
|
$0.UpdateRoomResponse.fromBuffer);
|
||||||
|
static final _$kickMember =
|
||||||
|
$grpc.ClientMethod<$0.KickMemberRequest, $0.KickMemberResponse>(
|
||||||
|
'/partroom.PartRoomService/KickMember',
|
||||||
|
($0.KickMemberRequest value) => value.writeToBuffer(),
|
||||||
|
$0.KickMemberResponse.fromBuffer);
|
||||||
|
static final _$setStatus =
|
||||||
|
$grpc.ClientMethod<$0.SetStatusRequest, $0.SetStatusResponse>(
|
||||||
|
'/partroom.PartRoomService/SetStatus',
|
||||||
|
($0.SetStatusRequest value) => value.writeToBuffer(),
|
||||||
|
$0.SetStatusResponse.fromBuffer);
|
||||||
|
static final _$sendSignal =
|
||||||
|
$grpc.ClientMethod<$0.SendSignalRequest, $0.SendSignalResponse>(
|
||||||
|
'/partroom.PartRoomService/SendSignal',
|
||||||
|
($0.SendSignalRequest value) => value.writeToBuffer(),
|
||||||
|
$0.SendSignalResponse.fromBuffer);
|
||||||
|
static final _$listenRoomEvents =
|
||||||
|
$grpc.ClientMethod<$0.ListenRoomEventsRequest, $0.RoomEvent>(
|
||||||
|
'/partroom.PartRoomService/ListenRoomEvents',
|
||||||
|
($0.ListenRoomEventsRequest value) => value.writeToBuffer(),
|
||||||
|
$0.RoomEvent.fromBuffer);
|
||||||
|
static final _$transferOwnership = $grpc.ClientMethod<
|
||||||
|
$0.TransferOwnershipRequest, $0.TransferOwnershipResponse>(
|
||||||
|
'/partroom.PartRoomService/TransferOwnership',
|
||||||
|
($0.TransferOwnershipRequest value) => value.writeToBuffer(),
|
||||||
|
$0.TransferOwnershipResponse.fromBuffer);
|
||||||
|
static final _$getKickedMembers = $grpc.ClientMethod<
|
||||||
|
$0.GetKickedMembersRequest, $0.GetKickedMembersResponse>(
|
||||||
|
'/partroom.PartRoomService/GetKickedMembers',
|
||||||
|
($0.GetKickedMembersRequest value) => value.writeToBuffer(),
|
||||||
|
$0.GetKickedMembersResponse.fromBuffer);
|
||||||
|
static final _$removeKickedMember = $grpc.ClientMethod<
|
||||||
|
$0.RemoveKickedMemberRequest, $0.RemoveKickedMemberResponse>(
|
||||||
|
'/partroom.PartRoomService/RemoveKickedMember',
|
||||||
|
($0.RemoveKickedMemberRequest value) => value.writeToBuffer(),
|
||||||
|
$0.RemoveKickedMemberResponse.fromBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@$pb.GrpcServiceName('partroom.PartRoomService')
|
||||||
|
abstract class PartRoomServiceBase extends $grpc.Service {
|
||||||
|
$core.String get $name => 'partroom.PartRoomService';
|
||||||
|
|
||||||
|
PartRoomServiceBase() {
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.GetRoomListRequest, $0.GetRoomListResponse>(
|
||||||
|
'GetRoomList',
|
||||||
|
getRoomList_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetRoomListRequest.fromBuffer(value),
|
||||||
|
($0.GetRoomListResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.CreateRoomRequest, $0.CreateRoomResponse>(
|
||||||
|
'CreateRoom',
|
||||||
|
createRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.CreateRoomRequest.fromBuffer(value),
|
||||||
|
($0.CreateRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.JoinRoomRequest, $0.JoinRoomResponse>(
|
||||||
|
'JoinRoom',
|
||||||
|
joinRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.JoinRoomRequest.fromBuffer(value),
|
||||||
|
($0.JoinRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.LeaveRoomRequest, $0.LeaveRoomResponse>(
|
||||||
|
'LeaveRoom',
|
||||||
|
leaveRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.LeaveRoomRequest.fromBuffer(value),
|
||||||
|
($0.LeaveRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.DismissRoomRequest, $0.DismissRoomResponse>(
|
||||||
|
'DismissRoom',
|
||||||
|
dismissRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.DismissRoomRequest.fromBuffer(value),
|
||||||
|
($0.DismissRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod(
|
||||||
|
$grpc.ServiceMethod<$0.GetRoomInfoRequest, $0.GetRoomInfoResponse>(
|
||||||
|
'GetRoomInfo',
|
||||||
|
getRoomInfo_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetRoomInfoRequest.fromBuffer(value),
|
||||||
|
($0.GetRoomInfoResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetRoomMembersRequest,
|
||||||
|
$0.GetRoomMembersResponse>(
|
||||||
|
'GetRoomMembers',
|
||||||
|
getRoomMembers_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetRoomMembersRequest.fromBuffer(value),
|
||||||
|
($0.GetRoomMembersResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.HeartbeatRequest, $0.HeartbeatResponse>(
|
||||||
|
'Heartbeat',
|
||||||
|
heartbeat_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.HeartbeatRequest.fromBuffer(value),
|
||||||
|
($0.HeartbeatResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetMyRoomRequest, $0.GetMyRoomResponse>(
|
||||||
|
'GetMyRoom',
|
||||||
|
getMyRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.GetMyRoomRequest.fromBuffer(value),
|
||||||
|
($0.GetMyRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.UpdateRoomRequest, $0.UpdateRoomResponse>(
|
||||||
|
'UpdateRoom',
|
||||||
|
updateRoom_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.UpdateRoomRequest.fromBuffer(value),
|
||||||
|
($0.UpdateRoomResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.KickMemberRequest, $0.KickMemberResponse>(
|
||||||
|
'KickMember',
|
||||||
|
kickMember_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.KickMemberRequest.fromBuffer(value),
|
||||||
|
($0.KickMemberResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.SetStatusRequest, $0.SetStatusResponse>(
|
||||||
|
'SetStatus',
|
||||||
|
setStatus_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.SetStatusRequest.fromBuffer(value),
|
||||||
|
($0.SetStatusResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.SendSignalRequest, $0.SendSignalResponse>(
|
||||||
|
'SendSignal',
|
||||||
|
sendSignal_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) => $0.SendSignalRequest.fromBuffer(value),
|
||||||
|
($0.SendSignalResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.ListenRoomEventsRequest, $0.RoomEvent>(
|
||||||
|
'ListenRoomEvents',
|
||||||
|
listenRoomEvents_Pre,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.ListenRoomEventsRequest.fromBuffer(value),
|
||||||
|
($0.RoomEvent value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.TransferOwnershipRequest,
|
||||||
|
$0.TransferOwnershipResponse>(
|
||||||
|
'TransferOwnership',
|
||||||
|
transferOwnership_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.TransferOwnershipRequest.fromBuffer(value),
|
||||||
|
($0.TransferOwnershipResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.GetKickedMembersRequest,
|
||||||
|
$0.GetKickedMembersResponse>(
|
||||||
|
'GetKickedMembers',
|
||||||
|
getKickedMembers_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.GetKickedMembersRequest.fromBuffer(value),
|
||||||
|
($0.GetKickedMembersResponse value) => value.writeToBuffer()));
|
||||||
|
$addMethod($grpc.ServiceMethod<$0.RemoveKickedMemberRequest,
|
||||||
|
$0.RemoveKickedMemberResponse>(
|
||||||
|
'RemoveKickedMember',
|
||||||
|
removeKickedMember_Pre,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
($core.List<$core.int> value) =>
|
||||||
|
$0.RemoveKickedMemberRequest.fromBuffer(value),
|
||||||
|
($0.RemoveKickedMemberResponse value) => value.writeToBuffer()));
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomListResponse> getRoomList_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetRoomListRequest> $request) async {
|
||||||
|
return getRoomList($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomListResponse> getRoomList(
|
||||||
|
$grpc.ServiceCall call, $0.GetRoomListRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.CreateRoomResponse> createRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.CreateRoomRequest> $request) async {
|
||||||
|
return createRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.CreateRoomResponse> createRoom(
|
||||||
|
$grpc.ServiceCall call, $0.CreateRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.JoinRoomResponse> joinRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.JoinRoomRequest> $request) async {
|
||||||
|
return joinRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.JoinRoomResponse> joinRoom(
|
||||||
|
$grpc.ServiceCall call, $0.JoinRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.LeaveRoomResponse> leaveRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.LeaveRoomRequest> $request) async {
|
||||||
|
return leaveRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.LeaveRoomResponse> leaveRoom(
|
||||||
|
$grpc.ServiceCall call, $0.LeaveRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.DismissRoomResponse> dismissRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.DismissRoomRequest> $request) async {
|
||||||
|
return dismissRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.DismissRoomResponse> dismissRoom(
|
||||||
|
$grpc.ServiceCall call, $0.DismissRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomInfoResponse> getRoomInfo_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetRoomInfoRequest> $request) async {
|
||||||
|
return getRoomInfo($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomInfoResponse> getRoomInfo(
|
||||||
|
$grpc.ServiceCall call, $0.GetRoomInfoRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomMembersResponse> getRoomMembers_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetRoomMembersRequest> $request) async {
|
||||||
|
return getRoomMembers($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetRoomMembersResponse> getRoomMembers(
|
||||||
|
$grpc.ServiceCall call, $0.GetRoomMembersRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.HeartbeatResponse> heartbeat_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.HeartbeatRequest> $request) async {
|
||||||
|
return heartbeat($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.HeartbeatResponse> heartbeat(
|
||||||
|
$grpc.ServiceCall call, $0.HeartbeatRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetMyRoomResponse> getMyRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetMyRoomRequest> $request) async {
|
||||||
|
return getMyRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetMyRoomResponse> getMyRoom(
|
||||||
|
$grpc.ServiceCall call, $0.GetMyRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.UpdateRoomResponse> updateRoom_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.UpdateRoomRequest> $request) async {
|
||||||
|
return updateRoom($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.UpdateRoomResponse> updateRoom(
|
||||||
|
$grpc.ServiceCall call, $0.UpdateRoomRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.KickMemberResponse> kickMember_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.KickMemberRequest> $request) async {
|
||||||
|
return kickMember($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.KickMemberResponse> kickMember(
|
||||||
|
$grpc.ServiceCall call, $0.KickMemberRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.SetStatusResponse> setStatus_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.SetStatusRequest> $request) async {
|
||||||
|
return setStatus($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.SetStatusResponse> setStatus(
|
||||||
|
$grpc.ServiceCall call, $0.SetStatusRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.SendSignalResponse> sendSignal_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.SendSignalRequest> $request) async {
|
||||||
|
return sendSignal($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.SendSignalResponse> sendSignal(
|
||||||
|
$grpc.ServiceCall call, $0.SendSignalRequest request);
|
||||||
|
|
||||||
|
$async.Stream<$0.RoomEvent> listenRoomEvents_Pre($grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.ListenRoomEventsRequest> $request) async* {
|
||||||
|
yield* listenRoomEvents($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Stream<$0.RoomEvent> listenRoomEvents(
|
||||||
|
$grpc.ServiceCall call, $0.ListenRoomEventsRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.TransferOwnershipResponse> transferOwnership_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.TransferOwnershipRequest> $request) async {
|
||||||
|
return transferOwnership($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.TransferOwnershipResponse> transferOwnership(
|
||||||
|
$grpc.ServiceCall call, $0.TransferOwnershipRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.GetKickedMembersResponse> getKickedMembers_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.GetKickedMembersRequest> $request) async {
|
||||||
|
return getKickedMembers($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.GetKickedMembersResponse> getKickedMembers(
|
||||||
|
$grpc.ServiceCall call, $0.GetKickedMembersRequest request);
|
||||||
|
|
||||||
|
$async.Future<$0.RemoveKickedMemberResponse> removeKickedMember_Pre(
|
||||||
|
$grpc.ServiceCall $call,
|
||||||
|
$async.Future<$0.RemoveKickedMemberRequest> $request) async {
|
||||||
|
return removeKickedMember($call, await $request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$async.Future<$0.RemoveKickedMemberResponse> removeKickedMember(
|
||||||
|
$grpc.ServiceCall call, $0.RemoveKickedMemberRequest request);
|
||||||
|
}
|
||||||
760
lib/generated/proto/partroom/partroom.pbjson.dart
Normal file
760
lib/generated/proto/partroom/partroom.pbjson.dart
Normal file
@ -0,0 +1,760 @@
|
|||||||
|
// This is a generated file - do not edit.
|
||||||
|
//
|
||||||
|
// Generated from proto/partroom/partroom.proto.
|
||||||
|
|
||||||
|
// @dart = 3.3
|
||||||
|
|
||||||
|
// ignore_for_file: annotate_overrides, camel_case_types, comment_references
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: curly_braces_in_flow_control_structures
|
||||||
|
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
|
||||||
|
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
|
||||||
|
// ignore_for_file: unused_import
|
||||||
|
|
||||||
|
import 'dart:convert' as $convert;
|
||||||
|
import 'dart:core' as $core;
|
||||||
|
import 'dart:typed_data' as $typed_data;
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomEventTypeDescriptor instead')
|
||||||
|
const RoomEventType$json = {
|
||||||
|
'1': 'RoomEventType',
|
||||||
|
'2': [
|
||||||
|
{'1': 'MEMBER_JOINED', '2': 0},
|
||||||
|
{'1': 'MEMBER_LEFT', '2': 1},
|
||||||
|
{'1': 'OWNER_CHANGED', '2': 2},
|
||||||
|
{'1': 'ROOM_UPDATED', '2': 3},
|
||||||
|
{'1': 'MEMBER_STATUS_UPDATED', '2': 4},
|
||||||
|
{'1': 'SIGNAL_BROADCAST', '2': 5},
|
||||||
|
{'1': 'ROOM_DISMISSED', '2': 6},
|
||||||
|
{'1': 'MEMBER_KICKED', '2': 7},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RoomEventType`. Decode as a `google.protobuf.EnumDescriptorProto`.
|
||||||
|
final $typed_data.Uint8List roomEventTypeDescriptor = $convert.base64Decode(
|
||||||
|
'Cg1Sb29tRXZlbnRUeXBlEhEKDU1FTUJFUl9KT0lORUQQABIPCgtNRU1CRVJfTEVGVBABEhEKDU'
|
||||||
|
'9XTkVSX0NIQU5HRUQQAhIQCgxST09NX1VQREFURUQQAxIZChVNRU1CRVJfU1RBVFVTX1VQREFU'
|
||||||
|
'RUQQBBIUChBTSUdOQUxfQlJPQURDQVNUEAUSEgoOUk9PTV9ESVNNSVNTRUQQBhIRCg1NRU1CRV'
|
||||||
|
'JfS0lDS0VEEAc=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomListItemDescriptor instead')
|
||||||
|
const RoomListItem$json = {
|
||||||
|
'1': 'RoomListItem',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'owner_game_id', '3': 2, '4': 1, '5': 9, '10': 'ownerGameId'},
|
||||||
|
{'1': 'owner_handle_name', '3': 3, '4': 1, '5': 9, '10': 'ownerHandleName'},
|
||||||
|
{'1': 'owner_avatar', '3': 4, '4': 1, '5': 9, '10': 'ownerAvatar'},
|
||||||
|
{'1': 'main_tag_id', '3': 5, '4': 1, '5': 9, '10': 'mainTagId'},
|
||||||
|
{'1': 'sub_tag_id', '3': 6, '4': 1, '5': 9, '10': 'subTagId'},
|
||||||
|
{'1': 'created_at', '3': 7, '4': 1, '5': 3, '10': 'createdAt'},
|
||||||
|
{'1': 'owner_last_active', '3': 8, '4': 1, '5': 3, '10': 'ownerLastActive'},
|
||||||
|
{'1': 'current_members', '3': 9, '4': 1, '5': 5, '10': 'currentMembers'},
|
||||||
|
{'1': 'target_members', '3': 10, '4': 1, '5': 5, '10': 'targetMembers'},
|
||||||
|
{'1': 'has_password', '3': 11, '4': 1, '5': 8, '10': 'hasPassword'},
|
||||||
|
{'1': 'social_links', '3': 12, '4': 3, '5': 9, '10': 'socialLinks'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RoomListItem`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List roomListItemDescriptor = $convert.base64Decode(
|
||||||
|
'CgxSb29tTGlzdEl0ZW0SGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBIiCg1vd25lcl9nYW'
|
||||||
|
'1lX2lkGAIgASgJUgtvd25lckdhbWVJZBIqChFvd25lcl9oYW5kbGVfbmFtZRgDIAEoCVIPb3du'
|
||||||
|
'ZXJIYW5kbGVOYW1lEiEKDG93bmVyX2F2YXRhchgEIAEoCVILb3duZXJBdmF0YXISHgoLbWFpbl'
|
||||||
|
'90YWdfaWQYBSABKAlSCW1haW5UYWdJZBIcCgpzdWJfdGFnX2lkGAYgASgJUghzdWJUYWdJZBId'
|
||||||
|
'CgpjcmVhdGVkX2F0GAcgASgDUgljcmVhdGVkQXQSKgoRb3duZXJfbGFzdF9hY3RpdmUYCCABKA'
|
||||||
|
'NSD293bmVyTGFzdEFjdGl2ZRInCg9jdXJyZW50X21lbWJlcnMYCSABKAVSDmN1cnJlbnRNZW1i'
|
||||||
|
'ZXJzEiUKDnRhcmdldF9tZW1iZXJzGAogASgFUg10YXJnZXRNZW1iZXJzEiEKDGhhc19wYXNzd2'
|
||||||
|
'9yZBgLIAEoCFILaGFzUGFzc3dvcmQSIQoMc29jaWFsX2xpbmtzGAwgAygJUgtzb2NpYWxMaW5r'
|
||||||
|
'cw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomListRequestDescriptor instead')
|
||||||
|
const GetRoomListRequest$json = {
|
||||||
|
'1': 'GetRoomListRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'main_tag_id', '3': 1, '4': 1, '5': 9, '10': 'mainTagId'},
|
||||||
|
{'1': 'sub_tag_id', '3': 2, '4': 1, '5': 9, '10': 'subTagId'},
|
||||||
|
{'1': 'search_owner_name', '3': 3, '4': 1, '5': 9, '10': 'searchOwnerName'},
|
||||||
|
{'1': 'page', '3': 4, '4': 1, '5': 5, '10': 'page'},
|
||||||
|
{'1': 'page_size', '3': 5, '4': 1, '5': 5, '10': 'pageSize'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomListRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomListRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChJHZXRSb29tTGlzdFJlcXVlc3QSHgoLbWFpbl90YWdfaWQYASABKAlSCW1haW5UYWdJZBIcCg'
|
||||||
|
'pzdWJfdGFnX2lkGAIgASgJUghzdWJUYWdJZBIqChFzZWFyY2hfb3duZXJfbmFtZRgDIAEoCVIP'
|
||||||
|
'c2VhcmNoT3duZXJOYW1lEhIKBHBhZ2UYBCABKAVSBHBhZ2USGwoJcGFnZV9zaXplGAUgASgFUg'
|
||||||
|
'hwYWdlU2l6ZQ==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomListResponseDescriptor instead')
|
||||||
|
const GetRoomListResponse$json = {
|
||||||
|
'1': 'GetRoomListResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'rooms',
|
||||||
|
'3': 1,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomListItem',
|
||||||
|
'10': 'rooms'
|
||||||
|
},
|
||||||
|
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
|
||||||
|
{'1': 'page', '3': 3, '4': 1, '5': 5, '10': 'page'},
|
||||||
|
{'1': 'page_size', '3': 4, '4': 1, '5': 5, '10': 'pageSize'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomListResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomListResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChNHZXRSb29tTGlzdFJlc3BvbnNlEiwKBXJvb21zGAEgAygLMhYucGFydHJvb20uUm9vbUxpc3'
|
||||||
|
'RJdGVtUgVyb29tcxIUCgV0b3RhbBgCIAEoBVIFdG90YWwSEgoEcGFnZRgDIAEoBVIEcGFnZRIb'
|
||||||
|
'CglwYWdlX3NpemUYBCABKAVSCHBhZ2VTaXpl');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use createRoomRequestDescriptor instead')
|
||||||
|
const CreateRoomRequest$json = {
|
||||||
|
'1': 'CreateRoomRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'main_tag_id', '3': 1, '4': 1, '5': 9, '10': 'mainTagId'},
|
||||||
|
{'1': 'sub_tag_id', '3': 2, '4': 1, '5': 9, '10': 'subTagId'},
|
||||||
|
{'1': 'target_members', '3': 3, '4': 1, '5': 5, '10': 'targetMembers'},
|
||||||
|
{'1': 'has_password', '3': 4, '4': 1, '5': 8, '10': 'hasPassword'},
|
||||||
|
{'1': 'password', '3': 5, '4': 1, '5': 9, '10': 'password'},
|
||||||
|
{'1': 'social_links', '3': 6, '4': 3, '5': 9, '10': 'socialLinks'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `CreateRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List createRoomRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChFDcmVhdGVSb29tUmVxdWVzdBIeCgttYWluX3RhZ19pZBgBIAEoCVIJbWFpblRhZ0lkEhwKCn'
|
||||||
|
'N1Yl90YWdfaWQYAiABKAlSCHN1YlRhZ0lkEiUKDnRhcmdldF9tZW1iZXJzGAMgASgFUg10YXJn'
|
||||||
|
'ZXRNZW1iZXJzEiEKDGhhc19wYXNzd29yZBgEIAEoCFILaGFzUGFzc3dvcmQSGgoIcGFzc3dvcm'
|
||||||
|
'QYBSABKAlSCHBhc3N3b3JkEiEKDHNvY2lhbF9saW5rcxgGIAMoCVILc29jaWFsTGlua3M=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use createRoomResponseDescriptor instead')
|
||||||
|
const CreateRoomResponse$json = {
|
||||||
|
'1': 'CreateRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `CreateRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List createRoomResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJDcmVhdGVSb29tUmVzcG9uc2USGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use joinRoomRequestDescriptor instead')
|
||||||
|
const JoinRoomRequest$json = {
|
||||||
|
'1': 'JoinRoomRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `JoinRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List joinRoomRequestDescriptor = $convert.base64Decode(
|
||||||
|
'Cg9Kb2luUm9vbVJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBIaCghwYXNzd2'
|
||||||
|
'9yZBgCIAEoCVIIcGFzc3dvcmQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use joinRoomResponseDescriptor instead')
|
||||||
|
const JoinRoomResponse$json = {
|
||||||
|
'1': 'JoinRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `JoinRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List joinRoomResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChBKb2luUm9vbVJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use leaveRoomRequestDescriptor instead')
|
||||||
|
const LeaveRoomRequest$json = {
|
||||||
|
'1': 'LeaveRoomRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `LeaveRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List leaveRoomRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChBMZWF2ZVJvb21SZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use leaveRoomResponseDescriptor instead')
|
||||||
|
const LeaveRoomResponse$json = {
|
||||||
|
'1': 'LeaveRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `LeaveRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List leaveRoomResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChFMZWF2ZVJvb21SZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use dismissRoomRequestDescriptor instead')
|
||||||
|
const DismissRoomRequest$json = {
|
||||||
|
'1': 'DismissRoomRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `DismissRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List dismissRoomRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJEaXNtaXNzUm9vbVJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use dismissRoomResponseDescriptor instead')
|
||||||
|
const DismissRoomResponse$json = {
|
||||||
|
'1': 'DismissRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `DismissRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List dismissRoomResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChNEaXNtaXNzUm9vbVJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use memberStatusDescriptor instead')
|
||||||
|
const MemberStatus$json = {
|
||||||
|
'1': 'MemberStatus',
|
||||||
|
'2': [
|
||||||
|
{'1': 'current_location', '3': 1, '4': 1, '5': 9, '10': 'currentLocation'},
|
||||||
|
{'1': 'kills', '3': 2, '4': 1, '5': 5, '10': 'kills'},
|
||||||
|
{'1': 'deaths', '3': 3, '4': 1, '5': 5, '10': 'deaths'},
|
||||||
|
{'1': 'play_time', '3': 4, '4': 1, '5': 3, '10': 'playTime'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `MemberStatus`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List memberStatusDescriptor = $convert.base64Decode(
|
||||||
|
'CgxNZW1iZXJTdGF0dXMSKQoQY3VycmVudF9sb2NhdGlvbhgBIAEoCVIPY3VycmVudExvY2F0aW'
|
||||||
|
'9uEhQKBWtpbGxzGAIgASgFUgVraWxscxIWCgZkZWF0aHMYAyABKAVSBmRlYXRocxIbCglwbGF5'
|
||||||
|
'X3RpbWUYBCABKANSCHBsYXlUaW1l');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomMemberDescriptor instead')
|
||||||
|
const RoomMember$json = {
|
||||||
|
'1': 'RoomMember',
|
||||||
|
'2': [
|
||||||
|
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
|
||||||
|
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
|
||||||
|
{'1': 'joined_at', '3': 4, '4': 1, '5': 3, '10': 'joinedAt'},
|
||||||
|
{'1': 'last_active', '3': 5, '4': 1, '5': 3, '10': 'lastActive'},
|
||||||
|
{'1': 'is_owner', '3': 6, '4': 1, '5': 8, '10': 'isOwner'},
|
||||||
|
{
|
||||||
|
'1': 'status',
|
||||||
|
'3': 7,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.MemberStatus',
|
||||||
|
'10': 'status'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RoomMember`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List roomMemberDescriptor = $convert.base64Decode(
|
||||||
|
'CgpSb29tTWVtYmVyEiAKDGdhbWVfdXNlcl9pZBgBIAEoCVIKZ2FtZVVzZXJJZBIfCgtoYW5kbG'
|
||||||
|
'VfbmFtZRgCIAEoCVIKaGFuZGxlTmFtZRIdCgphdmF0YXJfdXJsGAMgASgJUglhdmF0YXJVcmwS'
|
||||||
|
'GwoJam9pbmVkX2F0GAQgASgDUghqb2luZWRBdBIfCgtsYXN0X2FjdGl2ZRgFIAEoA1IKbGFzdE'
|
||||||
|
'FjdGl2ZRIZCghpc19vd25lchgGIAEoCFIHaXNPd25lchIuCgZzdGF0dXMYByABKAsyFi5wYXJ0'
|
||||||
|
'cm9vbS5NZW1iZXJTdGF0dXNSBnN0YXR1cw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomInfoDescriptor instead')
|
||||||
|
const RoomInfo$json = {
|
||||||
|
'1': 'RoomInfo',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'owner_game_id', '3': 2, '4': 1, '5': 9, '10': 'ownerGameId'},
|
||||||
|
{'1': 'main_tag_id', '3': 3, '4': 1, '5': 9, '10': 'mainTagId'},
|
||||||
|
{'1': 'sub_tag_id', '3': 4, '4': 1, '5': 9, '10': 'subTagId'},
|
||||||
|
{'1': 'target_members', '3': 5, '4': 1, '5': 5, '10': 'targetMembers'},
|
||||||
|
{'1': 'has_password', '3': 6, '4': 1, '5': 8, '10': 'hasPassword'},
|
||||||
|
{'1': 'created_at', '3': 7, '4': 1, '5': 3, '10': 'createdAt'},
|
||||||
|
{'1': 'current_members', '3': 8, '4': 1, '5': 5, '10': 'currentMembers'},
|
||||||
|
{'1': 'social_links', '3': 9, '4': 3, '5': 9, '10': 'socialLinks'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RoomInfo`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List roomInfoDescriptor = $convert.base64Decode(
|
||||||
|
'CghSb29tSW5mbxIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEiIKDW93bmVyX2dhbWVfaW'
|
||||||
|
'QYAiABKAlSC293bmVyR2FtZUlkEh4KC21haW5fdGFnX2lkGAMgASgJUgltYWluVGFnSWQSHAoK'
|
||||||
|
'c3ViX3RhZ19pZBgEIAEoCVIIc3ViVGFnSWQSJQoOdGFyZ2V0X21lbWJlcnMYBSABKAVSDXRhcm'
|
||||||
|
'dldE1lbWJlcnMSIQoMaGFzX3Bhc3N3b3JkGAYgASgIUgtoYXNQYXNzd29yZBIdCgpjcmVhdGVk'
|
||||||
|
'X2F0GAcgASgDUgljcmVhdGVkQXQSJwoPY3VycmVudF9tZW1iZXJzGAggASgFUg5jdXJyZW50TW'
|
||||||
|
'VtYmVycxIhCgxzb2NpYWxfbGlua3MYCSADKAlSC3NvY2lhbExpbmtz');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomInfoRequestDescriptor instead')
|
||||||
|
const GetRoomInfoRequest$json = {
|
||||||
|
'1': 'GetRoomInfoRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomInfoRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomInfoRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJHZXRSb29tSW5mb1JlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomInfoResponseDescriptor instead')
|
||||||
|
const GetRoomInfoResponse$json = {
|
||||||
|
'1': 'GetRoomInfoResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'room',
|
||||||
|
'3': 1,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomInfo',
|
||||||
|
'10': 'room'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomInfoResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomInfoResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChNHZXRSb29tSW5mb1Jlc3BvbnNlEiYKBHJvb20YASABKAsyEi5wYXJ0cm9vbS5Sb29tSW5mb1'
|
||||||
|
'IEcm9vbQ==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomMembersRequestDescriptor instead')
|
||||||
|
const GetRoomMembersRequest$json = {
|
||||||
|
'1': 'GetRoomMembersRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'page', '3': 2, '4': 1, '5': 5, '10': 'page'},
|
||||||
|
{'1': 'page_size', '3': 3, '4': 1, '5': 5, '10': 'pageSize'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomMembersRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomMembersRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChVHZXRSb29tTWVtYmVyc1JlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZBISCg'
|
||||||
|
'RwYWdlGAIgASgFUgRwYWdlEhsKCXBhZ2Vfc2l6ZRgDIAEoBVIIcGFnZVNpemU=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getRoomMembersResponseDescriptor instead')
|
||||||
|
const GetRoomMembersResponse$json = {
|
||||||
|
'1': 'GetRoomMembersResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'members',
|
||||||
|
'3': 1,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomMember',
|
||||||
|
'10': 'members'
|
||||||
|
},
|
||||||
|
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetRoomMembersResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getRoomMembersResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChZHZXRSb29tTWVtYmVyc1Jlc3BvbnNlEi4KB21lbWJlcnMYASADKAsyFC5wYXJ0cm9vbS5Sb2'
|
||||||
|
'9tTWVtYmVyUgdtZW1iZXJzEhQKBXRvdGFsGAIgASgFUgV0b3RhbA==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use heartbeatRequestDescriptor instead')
|
||||||
|
const HeartbeatRequest$json = {
|
||||||
|
'1': 'HeartbeatRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `HeartbeatRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List heartbeatRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChBIZWFydGJlYXRSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use heartbeatResponseDescriptor instead')
|
||||||
|
const HeartbeatResponse$json = {
|
||||||
|
'1': 'HeartbeatResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `HeartbeatResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List heartbeatResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChFIZWFydGJlYXRSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getMyRoomRequestDescriptor instead')
|
||||||
|
const GetMyRoomRequest$json = {
|
||||||
|
'1': 'GetMyRoomRequest',
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetMyRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getMyRoomRequestDescriptor =
|
||||||
|
$convert.base64Decode('ChBHZXRNeVJvb21SZXF1ZXN0');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getMyRoomResponseDescriptor instead')
|
||||||
|
const GetMyRoomResponse$json = {
|
||||||
|
'1': 'GetMyRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'room',
|
||||||
|
'3': 1,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomInfo',
|
||||||
|
'10': 'room'
|
||||||
|
},
|
||||||
|
{'1': 'has_room', '3': 2, '4': 1, '5': 8, '10': 'hasRoom'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetMyRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getMyRoomResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChFHZXRNeVJvb21SZXNwb25zZRImCgRyb29tGAEgASgLMhIucGFydHJvb20uUm9vbUluZm9SBH'
|
||||||
|
'Jvb20SGQoIaGFzX3Jvb20YAiABKAhSB2hhc1Jvb20=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use updateRoomRequestDescriptor instead')
|
||||||
|
const UpdateRoomRequest$json = {
|
||||||
|
'1': 'UpdateRoomRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'target_members', '3': 2, '4': 1, '5': 5, '10': 'targetMembers'},
|
||||||
|
{'1': 'password', '3': 3, '4': 1, '5': 9, '10': 'password'},
|
||||||
|
{'1': 'main_tag_id', '3': 4, '4': 1, '5': 9, '10': 'mainTagId'},
|
||||||
|
{'1': 'sub_tag_id', '3': 5, '4': 1, '5': 9, '10': 'subTagId'},
|
||||||
|
{'1': 'social_links', '3': 6, '4': 3, '5': 9, '10': 'socialLinks'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `UpdateRoomRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List updateRoomRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChFVcGRhdGVSb29tUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEiUKDnRhcm'
|
||||||
|
'dldF9tZW1iZXJzGAIgASgFUg10YXJnZXRNZW1iZXJzEhoKCHBhc3N3b3JkGAMgASgJUghwYXNz'
|
||||||
|
'd29yZBIeCgttYWluX3RhZ19pZBgEIAEoCVIJbWFpblRhZ0lkEhwKCnN1Yl90YWdfaWQYBSABKA'
|
||||||
|
'lSCHN1YlRhZ0lkEiEKDHNvY2lhbF9saW5rcxgGIAMoCVILc29jaWFsTGlua3M=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use updateRoomResponseDescriptor instead')
|
||||||
|
const UpdateRoomResponse$json = {
|
||||||
|
'1': 'UpdateRoomResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `UpdateRoomResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List updateRoomResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJVcGRhdGVSb29tUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use kickMemberRequestDescriptor instead')
|
||||||
|
const KickMemberRequest$json = {
|
||||||
|
'1': 'KickMemberRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{
|
||||||
|
'1': 'target_game_user_id',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 9,
|
||||||
|
'10': 'targetGameUserId'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `KickMemberRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List kickMemberRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChFLaWNrTWVtYmVyUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEi0KE3Rhcm'
|
||||||
|
'dldF9nYW1lX3VzZXJfaWQYAiABKAlSEHRhcmdldEdhbWVVc2VySWQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use kickMemberResponseDescriptor instead')
|
||||||
|
const KickMemberResponse$json = {
|
||||||
|
'1': 'KickMemberResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `KickMemberResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List kickMemberResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJLaWNrTWVtYmVyUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use setStatusRequestDescriptor instead')
|
||||||
|
const SetStatusRequest$json = {
|
||||||
|
'1': 'SetStatusRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{
|
||||||
|
'1': 'status',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.MemberStatus',
|
||||||
|
'10': 'status'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `SetStatusRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List setStatusRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChBTZXRTdGF0dXNSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aWQSLgoGc3RhdH'
|
||||||
|
'VzGAIgASgLMhYucGFydHJvb20uTWVtYmVyU3RhdHVzUgZzdGF0dXM=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use setStatusResponseDescriptor instead')
|
||||||
|
const SetStatusResponse$json = {
|
||||||
|
'1': 'SetStatusResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `SetStatusResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List setStatusResponseDescriptor = $convert.base64Decode(
|
||||||
|
'ChFTZXRTdGF0dXNSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use sendSignalRequestDescriptor instead')
|
||||||
|
const SendSignalRequest$json = {
|
||||||
|
'1': 'SendSignalRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'signal_id', '3': 2, '4': 1, '5': 9, '10': 'signalId'},
|
||||||
|
{
|
||||||
|
'1': 'params',
|
||||||
|
'3': 3,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.SendSignalRequest.ParamsEntry',
|
||||||
|
'10': 'params'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'3': [SendSignalRequest_ParamsEntry$json],
|
||||||
|
};
|
||||||
|
|
||||||
|
@$core.Deprecated('Use sendSignalRequestDescriptor instead')
|
||||||
|
const SendSignalRequest_ParamsEntry$json = {
|
||||||
|
'1': 'ParamsEntry',
|
||||||
|
'2': [
|
||||||
|
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||||
|
],
|
||||||
|
'7': {'7': true},
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `SendSignalRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List sendSignalRequestDescriptor = $convert.base64Decode(
|
||||||
|
'ChFTZW5kU2lnbmFsUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEhsKCXNpZ2'
|
||||||
|
'5hbF9pZBgCIAEoCVIIc2lnbmFsSWQSPwoGcGFyYW1zGAMgAygLMicucGFydHJvb20uU2VuZFNp'
|
||||||
|
'Z25hbFJlcXVlc3QuUGFyYW1zRW50cnlSBnBhcmFtcxo5CgtQYXJhbXNFbnRyeRIQCgNrZXkYAS'
|
||||||
|
'ABKAlSA2tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use sendSignalResponseDescriptor instead')
|
||||||
|
const SendSignalResponse$json = {
|
||||||
|
'1': 'SendSignalResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `SendSignalResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List sendSignalResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChJTZW5kU2lnbmFsUmVzcG9uc2USGAoHc3VjY2VzcxgBIAEoCFIHc3VjY2Vzcw==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomEventDescriptor instead')
|
||||||
|
const RoomEvent$json = {
|
||||||
|
'1': 'RoomEvent',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'type',
|
||||||
|
'3': 1,
|
||||||
|
'4': 1,
|
||||||
|
'5': 14,
|
||||||
|
'6': '.partroom.RoomEventType',
|
||||||
|
'10': 'type'
|
||||||
|
},
|
||||||
|
{'1': 'room_uuid', '3': 2, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'timestamp', '3': 3, '4': 1, '5': 3, '10': 'timestamp'},
|
||||||
|
{
|
||||||
|
'1': 'member',
|
||||||
|
'3': 4,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomMember',
|
||||||
|
'10': 'member'
|
||||||
|
},
|
||||||
|
{'1': 'signal_id', '3': 5, '4': 1, '5': 9, '10': 'signalId'},
|
||||||
|
{'1': 'signal_sender', '3': 6, '4': 1, '5': 9, '10': 'signalSender'},
|
||||||
|
{
|
||||||
|
'1': 'signal_params',
|
||||||
|
'3': 7,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomEvent.SignalParamsEntry',
|
||||||
|
'10': 'signalParams'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'1': 'room_info',
|
||||||
|
'3': 8,
|
||||||
|
'4': 1,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.RoomInfo',
|
||||||
|
'10': 'roomInfo'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'3': [RoomEvent_SignalParamsEntry$json],
|
||||||
|
};
|
||||||
|
|
||||||
|
@$core.Deprecated('Use roomEventDescriptor instead')
|
||||||
|
const RoomEvent_SignalParamsEntry$json = {
|
||||||
|
'1': 'SignalParamsEntry',
|
||||||
|
'2': [
|
||||||
|
{'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
|
||||||
|
{'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
|
||||||
|
],
|
||||||
|
'7': {'7': true},
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RoomEvent`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List roomEventDescriptor = $convert.base64Decode(
|
||||||
|
'CglSb29tRXZlbnQSKwoEdHlwZRgBIAEoDjIXLnBhcnRyb29tLlJvb21FdmVudFR5cGVSBHR5cG'
|
||||||
|
'USGwoJcm9vbV91dWlkGAIgASgJUghyb29tVXVpZBIcCgl0aW1lc3RhbXAYAyABKANSCXRpbWVz'
|
||||||
|
'dGFtcBIsCgZtZW1iZXIYBCABKAsyFC5wYXJ0cm9vbS5Sb29tTWVtYmVyUgZtZW1iZXISGwoJc2'
|
||||||
|
'lnbmFsX2lkGAUgASgJUghzaWduYWxJZBIjCg1zaWduYWxfc2VuZGVyGAYgASgJUgxzaWduYWxT'
|
||||||
|
'ZW5kZXISSgoNc2lnbmFsX3BhcmFtcxgHIAMoCzIlLnBhcnRyb29tLlJvb21FdmVudC5TaWduYW'
|
||||||
|
'xQYXJhbXNFbnRyeVIMc2lnbmFsUGFyYW1zEi8KCXJvb21faW5mbxgIIAEoCzISLnBhcnRyb29t'
|
||||||
|
'LlJvb21JbmZvUghyb29tSW5mbxo/ChFTaWduYWxQYXJhbXNFbnRyeRIQCgNrZXkYASABKAlSA2'
|
||||||
|
'tleRIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use listenRoomEventsRequestDescriptor instead')
|
||||||
|
const ListenRoomEventsRequest$json = {
|
||||||
|
'1': 'ListenRoomEventsRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `ListenRoomEventsRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List listenRoomEventsRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChdMaXN0ZW5Sb29tRXZlbnRzUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlk');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use transferOwnershipRequestDescriptor instead')
|
||||||
|
const TransferOwnershipRequest$json = {
|
||||||
|
'1': 'TransferOwnershipRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{
|
||||||
|
'1': 'target_game_user_id',
|
||||||
|
'3': 2,
|
||||||
|
'4': 1,
|
||||||
|
'5': 9,
|
||||||
|
'10': 'targetGameUserId'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `TransferOwnershipRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List transferOwnershipRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChhUcmFuc2Zlck93bmVyc2hpcFJlcXVlc3QSGwoJcm9vbV91dWlkGAEgASgJUghyb29tVXVpZB'
|
||||||
|
'ItChN0YXJnZXRfZ2FtZV91c2VyX2lkGAIgASgJUhB0YXJnZXRHYW1lVXNlcklk');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use transferOwnershipResponseDescriptor instead')
|
||||||
|
const TransferOwnershipResponse$json = {
|
||||||
|
'1': 'TransferOwnershipResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `TransferOwnershipResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List transferOwnershipResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChlUcmFuc2Zlck93bmVyc2hpcFJlc3BvbnNlEhgKB3N1Y2Nlc3MYASABKAhSB3N1Y2Nlc3M=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use kickedMemberDescriptor instead')
|
||||||
|
const KickedMember$json = {
|
||||||
|
'1': 'KickedMember',
|
||||||
|
'2': [
|
||||||
|
{'1': 'game_user_id', '3': 1, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
{'1': 'handle_name', '3': 2, '4': 1, '5': 9, '10': 'handleName'},
|
||||||
|
{'1': 'avatar_url', '3': 3, '4': 1, '5': 9, '10': 'avatarUrl'},
|
||||||
|
{'1': 'joined_at', '3': 4, '4': 1, '5': 3, '10': 'joinedAt'},
|
||||||
|
{'1': 'kicked_at', '3': 5, '4': 1, '5': 3, '10': 'kickedAt'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `KickedMember`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List kickedMemberDescriptor = $convert.base64Decode(
|
||||||
|
'CgxLaWNrZWRNZW1iZXISIAoMZ2FtZV91c2VyX2lkGAEgASgJUgpnYW1lVXNlcklkEh8KC2hhbm'
|
||||||
|
'RsZV9uYW1lGAIgASgJUgpoYW5kbGVOYW1lEh0KCmF2YXRhcl91cmwYAyABKAlSCWF2YXRhclVy'
|
||||||
|
'bBIbCglqb2luZWRfYXQYBCABKANSCGpvaW5lZEF0EhsKCWtpY2tlZF9hdBgFIAEoA1IIa2lja2'
|
||||||
|
'VkQXQ=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getKickedMembersRequestDescriptor instead')
|
||||||
|
const GetKickedMembersRequest$json = {
|
||||||
|
'1': 'GetKickedMembersRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'page', '3': 2, '4': 1, '5': 5, '10': 'page'},
|
||||||
|
{'1': 'page_size', '3': 3, '4': 1, '5': 5, '10': 'pageSize'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetKickedMembersRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getKickedMembersRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChdHZXRLaWNrZWRNZW1iZXJzUmVxdWVzdBIbCglyb29tX3V1aWQYASABKAlSCHJvb21VdWlkEh'
|
||||||
|
'IKBHBhZ2UYAiABKAVSBHBhZ2USGwoJcGFnZV9zaXplGAMgASgFUghwYWdlU2l6ZQ==');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use getKickedMembersResponseDescriptor instead')
|
||||||
|
const GetKickedMembersResponse$json = {
|
||||||
|
'1': 'GetKickedMembersResponse',
|
||||||
|
'2': [
|
||||||
|
{
|
||||||
|
'1': 'members',
|
||||||
|
'3': 1,
|
||||||
|
'4': 3,
|
||||||
|
'5': 11,
|
||||||
|
'6': '.partroom.KickedMember',
|
||||||
|
'10': 'members'
|
||||||
|
},
|
||||||
|
{'1': 'total', '3': 2, '4': 1, '5': 5, '10': 'total'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `GetKickedMembersResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List getKickedMembersResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChhHZXRLaWNrZWRNZW1iZXJzUmVzcG9uc2USMAoHbWVtYmVycxgBIAMoCzIWLnBhcnRyb29tLk'
|
||||||
|
'tpY2tlZE1lbWJlclIHbWVtYmVycxIUCgV0b3RhbBgCIAEoBVIFdG90YWw=');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use removeKickedMemberRequestDescriptor instead')
|
||||||
|
const RemoveKickedMemberRequest$json = {
|
||||||
|
'1': 'RemoveKickedMemberRequest',
|
||||||
|
'2': [
|
||||||
|
{'1': 'room_uuid', '3': 1, '4': 1, '5': 9, '10': 'roomUuid'},
|
||||||
|
{'1': 'game_user_id', '3': 2, '4': 1, '5': 9, '10': 'gameUserId'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RemoveKickedMemberRequest`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List removeKickedMemberRequestDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChlSZW1vdmVLaWNrZWRNZW1iZXJSZXF1ZXN0EhsKCXJvb21fdXVpZBgBIAEoCVIIcm9vbVV1aW'
|
||||||
|
'QSIAoMZ2FtZV91c2VyX2lkGAIgASgJUgpnYW1lVXNlcklk');
|
||||||
|
|
||||||
|
@$core.Deprecated('Use removeKickedMemberResponseDescriptor instead')
|
||||||
|
const RemoveKickedMemberResponse$json = {
|
||||||
|
'1': 'RemoveKickedMemberResponse',
|
||||||
|
'2': [
|
||||||
|
{'1': 'success', '3': 1, '4': 1, '5': 8, '10': 'success'},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Descriptor for `RemoveKickedMemberResponse`. Decode as a `google.protobuf.DescriptorProto`.
|
||||||
|
final $typed_data.Uint8List removeKickedMemberResponseDescriptor =
|
||||||
|
$convert.base64Decode(
|
||||||
|
'ChpSZW1vdmVLaWNrZWRNZW1iZXJSZXNwb25zZRIYCgdzdWNjZXNzGAEgASgIUgdzdWNjZXNz');
|
||||||
1048
lib/l10n/intl_en.arb
1048
lib/l10n/intl_en.arb
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -20,7 +20,7 @@
|
|||||||
"@about_action_email": {},
|
"@about_action_email": {},
|
||||||
"about_action_open_source": "开源",
|
"about_action_open_source": "开源",
|
||||||
"@about_action_open_source": {},
|
"@about_action_open_source": {},
|
||||||
"about_disclaimer": "这是一个非官方的星际公民工具,不隶属于 Cloud Imperium 公司集团。 本软件中非由其主机或用户创作的所有内容均为其各自所有者的财产。 \nStar Citizen®、Roberts Space Industries® 和 Cloud Imperium® 是 Cloud Imperium Rights LLC 的注册商标。",
|
"about_disclaimer": "这是一个非官方的星际公民工具,不隶属于 Cloud Imperium 公司集团。 本软件中非由其主体或用户创作的所有内容均为其各自所有者的财产。 \nStar Citizen®、Roberts Space Industries® 和 Cloud Imperium® 是 Cloud Imperium Rights LLC 的注册商标。",
|
||||||
"@about_disclaimer": {},
|
"@about_disclaimer": {},
|
||||||
"about_analytics_launch": "启动",
|
"about_analytics_launch": "启动",
|
||||||
"@about_analytics_launch": {},
|
"@about_analytics_launch": {},
|
||||||
@ -76,12 +76,14 @@
|
|||||||
"@downloader_action_resume_all": {},
|
"@downloader_action_resume_all": {},
|
||||||
"downloader_action_cancel_all": "全部取消",
|
"downloader_action_cancel_all": "全部取消",
|
||||||
"@downloader_action_cancel_all": {},
|
"@downloader_action_cancel_all": {},
|
||||||
|
"downloader_action_clear_completed": "清除已完成",
|
||||||
|
"@downloader_action_clear_completed": {},
|
||||||
|
"downloader_action_remove_record": "移除记录",
|
||||||
|
"@downloader_action_remove_record": {},
|
||||||
"downloader_info_no_download_tasks": "无下载任务",
|
"downloader_info_no_download_tasks": "无下载任务",
|
||||||
"@downloader_info_no_download_tasks": {},
|
"@downloader_info_no_download_tasks": {},
|
||||||
"downloader_info_total_size": "总大小:{v1}",
|
"downloader_info_total_size": "总大小:{v1}",
|
||||||
"@downloader_info_total_size": {},
|
"@downloader_info_total_size": {},
|
||||||
"downloader_info_verifying": "校验中...({v2})",
|
|
||||||
"@downloader_info_verifying": {},
|
|
||||||
"downloader_info_downloading": "下载中... ({v0}%)",
|
"downloader_info_downloading": "下载中... ({v0}%)",
|
||||||
"@downloader_info_downloading": {},
|
"@downloader_info_downloading": {},
|
||||||
"downloader_info_status": "状态:{v0}",
|
"downloader_info_status": "状态:{v0}",
|
||||||
@ -90,6 +92,8 @@
|
|||||||
"@downloader_info_uploaded": {},
|
"@downloader_info_uploaded": {},
|
||||||
"downloader_info_downloaded": "已下载:{v0}",
|
"downloader_info_downloaded": "已下载:{v0}",
|
||||||
"@downloader_info_downloaded": {},
|
"@downloader_info_downloaded": {},
|
||||||
|
"downloader_info_checked": "已校验:{v0}",
|
||||||
|
"@downloader_info_checked": {},
|
||||||
"downloader_action_options": "选项",
|
"downloader_action_options": "选项",
|
||||||
"@downloader_action_options": {},
|
"@downloader_action_options": {},
|
||||||
"downloader_action_continue_download": "继续下载",
|
"downloader_action_continue_download": "继续下载",
|
||||||
@ -104,6 +108,10 @@
|
|||||||
"@downloader_info_download_upload_speed": {},
|
"@downloader_info_download_upload_speed": {},
|
||||||
"downloader_info_downloading_status": "下载中...",
|
"downloader_info_downloading_status": "下载中...",
|
||||||
"@downloader_info_downloading_status": {},
|
"@downloader_info_downloading_status": {},
|
||||||
|
"downloader_info_checking": "校验中",
|
||||||
|
"@downloader_info_checking": {},
|
||||||
|
"downloader_info_checking_progress": "校验中... ({v0}%)",
|
||||||
|
"@downloader_info_checking_progress": {},
|
||||||
"downloader_info_waiting": "等待中",
|
"downloader_info_waiting": "等待中",
|
||||||
"@downloader_info_waiting": {},
|
"@downloader_info_waiting": {},
|
||||||
"downloader_info_paused": "已暂停",
|
"downloader_info_paused": "已暂停",
|
||||||
@ -134,6 +142,14 @@
|
|||||||
"@downloader_input_download_speed_limit": {},
|
"@downloader_input_download_speed_limit": {},
|
||||||
"downloader_input_info_p2p_upload_note": "* P2P 上传仅在下载文件时进行,下载完成后会关闭 p2p 连接。如您想参与做种,请通过关于页面联系我们。",
|
"downloader_input_info_p2p_upload_note": "* P2P 上传仅在下载文件时进行,下载完成后会关闭 p2p 连接。如您想参与做种,请通过关于页面联系我们。",
|
||||||
"@downloader_input_info_p2p_upload_note": {},
|
"@downloader_input_info_p2p_upload_note": {},
|
||||||
|
"downloader_info_speed_limit_saved_restart_required": "限速设置已保存,将在下次启动下载器时生效。",
|
||||||
|
"@downloader_info_speed_limit_saved_restart_required": {},
|
||||||
|
"downloader_action_restart_now": "立即重启下载管理器",
|
||||||
|
"@downloader_action_restart_now": {},
|
||||||
|
"downloader_action_restart_later": "下次启动时生效",
|
||||||
|
"@downloader_action_restart_later": {},
|
||||||
|
"downloader_info_restart_manager_to_apply": "限速设置已保存。是否立即重启下载管理器以应用新设置?",
|
||||||
|
"@downloader_info_restart_manager_to_apply": {},
|
||||||
"doctor_title_one_click_diagnosis": "一键诊断 -> {v0}",
|
"doctor_title_one_click_diagnosis": "一键诊断 -> {v0}",
|
||||||
"@doctor_title_one_click_diagnosis": {},
|
"@doctor_title_one_click_diagnosis": {},
|
||||||
"doctor_action_rsi_launcher_log": "RSI启动器log",
|
"doctor_action_rsi_launcher_log": "RSI启动器log",
|
||||||
@ -538,7 +554,7 @@
|
|||||||
"@tools_info_rsi_launcher_location": {},
|
"@tools_info_rsi_launcher_location": {},
|
||||||
"tools_action_view_system_info": "查看系统信息",
|
"tools_action_view_system_info": "查看系统信息",
|
||||||
"@tools_action_view_system_info": {},
|
"@tools_action_view_system_info": {},
|
||||||
"tools_action_info_view_critical_system_info": "查看系统关键信息,用于快速问诊 \n\n耗时操作,请耐心等待。",
|
"tools_action_info_view_critical_system_info": "查看系统关键信息,用于快速问诊。",
|
||||||
"@tools_action_info_view_critical_system_info": {},
|
"@tools_action_info_view_critical_system_info": {},
|
||||||
"tools_action_p4k_download_repair": "P4K 分流下载 / 修复",
|
"tools_action_p4k_download_repair": "P4K 分流下载 / 修复",
|
||||||
"@tools_action_p4k_download_repair": {},
|
"@tools_action_p4k_download_repair": {},
|
||||||
@ -578,7 +594,7 @@
|
|||||||
"@tools_action_info_fix_success_restart": {},
|
"@tools_action_info_fix_success_restart": {},
|
||||||
"tools_action_clear_shader_cache": "清理着色器缓存",
|
"tools_action_clear_shader_cache": "清理着色器缓存",
|
||||||
"@tools_action_clear_shader_cache": {},
|
"@tools_action_clear_shader_cache": {},
|
||||||
"tools_action_info_shader_cache_issue": "若游戏画面出现异常或版本更新后可使用本工具清理过期的着色器(同时会将 Vulkan 还原为 DX11) \n\n缓存大小:{v0} MB",
|
"tools_action_info_shader_cache_issue": "若游戏画面出现异常或版本更新后可使用本工具清理过期的着色器 \n\n缓存大小:{v0} MB",
|
||||||
"@tools_action_info_shader_cache_issue": {},
|
"@tools_action_info_shader_cache_issue": {},
|
||||||
"tools_action_close_photography_mode": "关闭摄影模式",
|
"tools_action_close_photography_mode": "关闭摄影模式",
|
||||||
"@tools_action_close_photography_mode": {},
|
"@tools_action_close_photography_mode": {},
|
||||||
@ -760,7 +776,9 @@
|
|||||||
"performance_json_text_vsync": "垂直同步",
|
"performance_json_text_vsync": "垂直同步",
|
||||||
"performance_json_text_vsync_info": "开启以防止撕裂,关闭以提高帧率",
|
"performance_json_text_vsync_info": "开启以防止撕裂,关闭以提高帧率",
|
||||||
"performance_json_text_motion_blur": "动态模糊",
|
"performance_json_text_motion_blur": "动态模糊",
|
||||||
"performance_json_text_motion_blur_info": "开启以提高运动感,关闭提升观感",
|
"performance_json_text_motion_blur_info": "开启以提高运动感,关闭提升观感",
|
||||||
|
"performance_json_text_openxr": "启用 OpenXR",
|
||||||
|
"performance_json_text_openxr_info": "连接与 OpenXR 兼容的头显,启动游戏后,使用左Alt+数字小键盘5切换 VR 与 宽屏剧院模式",
|
||||||
"performance_json_text_fov": "设置视角FOV",
|
"performance_json_text_fov": "设置视角FOV",
|
||||||
"performance_json_text_ui_animation": "UI 淡入淡出动画",
|
"performance_json_text_ui_animation": "UI 淡入淡出动画",
|
||||||
"performance_json_text_custom_parameters": "自定义参数",
|
"performance_json_text_custom_parameters": "自定义参数",
|
||||||
@ -772,7 +790,7 @@
|
|||||||
"tools_rsi_launcher_enhance_title": "RSI 启动器增强",
|
"tools_rsi_launcher_enhance_title": "RSI 启动器增强",
|
||||||
"tools_rsi_launcher_enhance_msg_version": "启动器内部版本信息:{v0}",
|
"tools_rsi_launcher_enhance_msg_version": "启动器内部版本信息:{v0}",
|
||||||
"tools_rsi_launcher_enhance_msg_patch_status": "补丁状态:{v0}",
|
"tools_rsi_launcher_enhance_msg_patch_status": "补丁状态:{v0}",
|
||||||
"tools_rsi_launcher_enhance_msg_error": "获取增强数据失败,可能是网络问题或当前版本不支持",
|
"tools_rsi_launcher_enhance_msg_error": "当前版本暂不支持,請等待適配...",
|
||||||
"tools_rsi_launcher_enhance_title_localization": "RSI 启动器本地化",
|
"tools_rsi_launcher_enhance_title_localization": "RSI 启动器本地化",
|
||||||
"tools_rsi_launcher_enhance_subtitle_localization": "为 RSI 启动器增加多语言支持。",
|
"tools_rsi_launcher_enhance_subtitle_localization": "为 RSI 启动器增加多语言支持。",
|
||||||
"tools_rsi_launcher_enhance_title_download_booster": "RSI 启动器下载增强",
|
"tools_rsi_launcher_enhance_title_download_booster": "RSI 启动器下载增强",
|
||||||
@ -793,8 +811,6 @@
|
|||||||
"home_localization_select_customize_file_ini": "请选择 ini 文件",
|
"home_localization_select_customize_file_ini": "请选择 ini 文件",
|
||||||
"home_localization_select_customize_file": "请选择自定义汉化文件",
|
"home_localization_select_customize_file": "请选择自定义汉化文件",
|
||||||
"home_localization_action_select_customize_file": "点击选择 ini 文件",
|
"home_localization_action_select_customize_file": "点击选择 ini 文件",
|
||||||
"home_localization_ptu_advanced_localization_tip_title": "推荐使用高级汉化",
|
|
||||||
"home_localization_ptu_advanced_localization_tip_title_info": "在 PTU/EPTU 等测试频道 ,当前汉化文本可能与游戏不同步,使用高级汉化可以减少乱码产生。",
|
|
||||||
"tools_rsi_launcher_enhance_action_fold": "收起额外功能",
|
"tools_rsi_launcher_enhance_action_fold": "收起额外功能",
|
||||||
"tools_rsi_launcher_enhance_action_expand": "展开额外功能",
|
"tools_rsi_launcher_enhance_action_expand": "展开额外功能",
|
||||||
"tools_unp4k_missing_runtime": "缺少运行库",
|
"tools_unp4k_missing_runtime": "缺少运行库",
|
||||||
@ -841,8 +857,13 @@
|
|||||||
"input_method_support_updated": "社区输入法支持已更新",
|
"input_method_support_updated": "社区输入法支持已更新",
|
||||||
"input_method_support_updated_to_version": "社区输入法支持已更新到:{v0}",
|
"input_method_support_updated_to_version": "社区输入法支持已更新到:{v0}",
|
||||||
"input_method_auto_translate": "双语翻译:",
|
"input_method_auto_translate": "双语翻译:",
|
||||||
"input_method_auto_translate_dialog_title": "启用双语翻译?",
|
"input_method_auto_translate_dialog_title": "是否下载 AI 模型以使用翻译功能?",
|
||||||
"input_method_auto_translate_dialog_title_content": "启用后,将使用 Google 翻译服务为您的输入内容增加英文副本,可能会导致响应滞后,若功能异常请关闭。\n\n文本将转发给 Google 服务器,请参阅 Google 的隐私政策。",
|
"input_method_auto_translate_dialog_title_content": "大约需要 200MB 的本地空间。\n\n我们使用本地模型进行翻译,您的翻译数据不会发送给任何第三方。\n\nOpus-MT-StarCitizen 是汉化盒子团队基于 Opus-MT 模型微调得到的模型,对游戏术语进行了优化。",
|
||||||
|
"input_method_auto_translate_model_download_start": "下载已开始,请在模型下载完成后重新启用翻译功能。",
|
||||||
|
"input_method_auto_translate_model_tips": "{v0}\n\n本地翻译模型对中英混合处理能力较差,如有需要,建议分开发送。",
|
||||||
|
"input_method_auto_translate_model_tips_downloading_tips": "模型正在下载中,请稍后...",
|
||||||
|
"input_method_auto_translate_model_load_failed_title": "翻译模型加载失败",
|
||||||
|
"input_method_auto_translate_model_load_failed_content": "是否删除本地文件,稍后您可以尝试重新下载。错误信息:\n{v0}",
|
||||||
"support_dev_thanks_message": "感谢您使用 SC汉化盒子,我是其开发者 xkeyC\n汉化盒子致力于开放源代码并为各位玩家提供免费的服务,无偿的服务是一项充满挑战的工作,若您考虑给我送点饮料钱,我将不胜感激。\n捐赠的资金将用于服务器支出、新功能的开发,以及提高软件维护的积极性。",
|
"support_dev_thanks_message": "感谢您使用 SC汉化盒子,我是其开发者 xkeyC\n汉化盒子致力于开放源代码并为各位玩家提供免费的服务,无偿的服务是一项充满挑战的工作,若您考虑给我送点饮料钱,我将不胜感激。\n捐赠的资金将用于服务器支出、新功能的开发,以及提高软件维护的积极性。",
|
||||||
"support_dev_referral_code_message": "如果您还没有注册游戏或填写邀请码,可以考虑我的: STAR-3YXS-SWTC ,感谢你看到这里",
|
"support_dev_referral_code_message": "如果您还没有注册游戏或填写邀请码,可以考虑我的: STAR-3YXS-SWTC ,感谢你看到这里",
|
||||||
"support_dev_title": "支持开发者",
|
"support_dev_title": "支持开发者",
|
||||||
@ -853,6 +874,9 @@
|
|||||||
"support_dev_in_game_id_copied": "游戏ID已复制",
|
"support_dev_in_game_id_copied": "游戏ID已复制",
|
||||||
"support_dev_copy_button": "复制",
|
"support_dev_copy_button": "复制",
|
||||||
"support_dev_in_game_currency_message": "您可以在游戏中向我发送 aUEC 作为支持,这将会帮助我在有限的时间里获得更好的游戏体验",
|
"support_dev_in_game_currency_message": "您可以在游戏中向我发送 aUEC 作为支持,这将会帮助我在有限的时间里获得更好的游戏体验",
|
||||||
|
"support_dev_hk_fps_transfer_title": "香港 FPS 轉數快",
|
||||||
|
"support_dev_hk_fps_transfer_id_copied": "FPS ID 已复制",
|
||||||
|
"support_dev_hk_fps_transfer_info": "如果您位于中国香港,或拥有中国香港的银行账户,这将是最轻松的转账方式",
|
||||||
"support_dev_alipay": "支付宝",
|
"support_dev_alipay": "支付宝",
|
||||||
"support_dev_wechat": "微信",
|
"support_dev_wechat": "微信",
|
||||||
"support_dev_donation_disclaimer": "* 请注意:捐赠是无偿赠与,您不会在软件体验上获得额外好处。",
|
"support_dev_donation_disclaimer": "* 请注意:捐赠是无偿赠与,您不会在软件体验上获得额外好处。",
|
||||||
@ -884,7 +908,7 @@
|
|||||||
"log_analyzer_soft_death": "软死亡",
|
"log_analyzer_soft_death": "软死亡",
|
||||||
"log_analyzer_disintegration": "解体",
|
"log_analyzer_disintegration": "解体",
|
||||||
"log_analyzer_vehicle_damage_details": "载具型号:{v0} \n区域:{v1} \n损毁等级:{v2} ({v3}) 责任方:{v4}",
|
"log_analyzer_vehicle_damage_details": "载具型号:{v0} \n区域:{v1} \n损毁等级:{v2} ({v3}) 责任方:{v4}",
|
||||||
"log_analyzer_death_details": "受害者ID:{v0} 死因:{v1} \n击杀者ID:{v2} \n区域:{v3}",
|
"log_analyzer_death_details": "受害者ID:{v0} \n位置:{v2} \n区域:{v3}",
|
||||||
"log_analyzer_player_login": "玩家 {v0} 登录 ...",
|
"log_analyzer_player_login": "玩家 {v0} 登录 ...",
|
||||||
"log_analyzer_view_local_inventory": "查看本地库存",
|
"log_analyzer_view_local_inventory": "查看本地库存",
|
||||||
"log_analyzer_player_location": "玩家ID:{v0} 位置:{v1}",
|
"log_analyzer_player_location": "玩家ID:{v0} 位置:{v1}",
|
||||||
@ -898,5 +922,419 @@
|
|||||||
"nav_third_party_service_disclaimer": "*对应链接指向的服务由第三方提供,我们不对其做任何担保,请用户自行判断使用风险 | ",
|
"nav_third_party_service_disclaimer": "*对应链接指向的服务由第三方提供,我们不对其做任何担保,请用户自行判断使用风险 | ",
|
||||||
"nav_website_navigation_data_provided_by": "网站导航数据由",
|
"nav_website_navigation_data_provided_by": "网站导航数据由",
|
||||||
"nav_provided_by": "提供",
|
"nav_provided_by": "提供",
|
||||||
"nav_fetching_data": "正在获取数据..."
|
"nav_fetching_data": "正在获取数据...",
|
||||||
|
"tools_vehicle_sorting_title": "载具排序",
|
||||||
|
"tools_vehicle_sorting_info": "将左侧载具拖动到右侧列表中,这将会为载具名称增加 001、002 .. 等前缀,方便您在游戏内 UI 快速定位载具。在右侧列表上下拖动可以调整载具的顺序。",
|
||||||
|
"tools_vehicle_sorting_vehicle": "载具",
|
||||||
|
"tools_vehicle_sorting_search": "搜索载具",
|
||||||
|
"tools_vehicle_sorting_sorted": "已排序载具",
|
||||||
|
"user_not_logged_in": "未登录",
|
||||||
|
"user_action_unregister": "注销账户",
|
||||||
|
"user_confirm_unregister_title": "确认注销",
|
||||||
|
"user_confirm_unregister_message": "您确定要注销账户吗?此操作不可撤销,如需再次登录,需重新验证 RSI 账号。",
|
||||||
|
"user_unregister_success": "账户注销成功",
|
||||||
|
"user_unregister_failed": "账户注销失败",
|
||||||
|
"settings_item_onnx_xnn_pack": "使用 XNN 加速 ONNX 推理",
|
||||||
|
"@settings_item_onnx_xnn_pack": {},
|
||||||
|
"settings_item_onnx_xnn_pack_info": "关闭此选项或许可以解决一些兼容问题",
|
||||||
|
"party_room_title": "组队大厅",
|
||||||
|
"party_room_connecting": "正在连接服务器...",
|
||||||
|
"party_room_connect_failed": "连接失败",
|
||||||
|
"party_room_retry": "重试",
|
||||||
|
"party_room_disconnected": "连接已断开",
|
||||||
|
"party_room_reconnect_prompt": "与房间服务器的连接已断开,是否重新连接?",
|
||||||
|
"party_room_exit_room": "退出房间",
|
||||||
|
"party_room_reconnect": "重新连接",
|
||||||
|
"party_room_exit_room_failed": "退出房间失败: {v0}",
|
||||||
|
"@party_room_exit_room_failed": {},
|
||||||
|
"party_room_no_members": "暂无成员",
|
||||||
|
"party_room_copy_game_id": "复制游戏ID",
|
||||||
|
"party_room_transfer_owner": "转移房主",
|
||||||
|
"party_room_transfer_owner_confirm": "确定要将房主转移给 {v0} 吗?",
|
||||||
|
"@party_room_transfer_owner_confirm": {},
|
||||||
|
"party_room_transfer": "转移",
|
||||||
|
"party_room_operation_failed": "操作失败",
|
||||||
|
"party_room_transfer_owner_failed": "转移房主失败:{v0}",
|
||||||
|
"@party_room_transfer_owner_failed": {},
|
||||||
|
"party_room_kick_member": "踢出成员",
|
||||||
|
"party_room_kick_member_confirm": "确定要踢出 {v0} 吗?",
|
||||||
|
"@party_room_kick_member_confirm": {},
|
||||||
|
"party_room_kick": "踢出",
|
||||||
|
"party_room_kick_member_failed": "踢出成员失败:{v0}",
|
||||||
|
"@party_room_kick_member_failed": {},
|
||||||
|
"party_room_loading": "加载中...",
|
||||||
|
"party_room_send_signal": "发送信号",
|
||||||
|
"party_room_send_failed": "发送失败",
|
||||||
|
"party_room_no_messages": "暂无消息",
|
||||||
|
"party_room_social_links_hint": "该房间包含第三方社交链接,点击加入自由交流吧~",
|
||||||
|
"party_room_copy_owner_id_hint": "复制房主的游戏ID,可在游戏首页添加好友,快速组队",
|
||||||
|
"party_room_copy": "复制",
|
||||||
|
"party_room_link": "链接",
|
||||||
|
"party_room_unknown_location": "未知位置",
|
||||||
|
"party_room_unknown_area": "未知区域",
|
||||||
|
"party_room_player_death": "玩家死亡",
|
||||||
|
"party_room_location": "位置",
|
||||||
|
"party_room_area": "区域",
|
||||||
|
"party_room_unknown_user": "未知用户",
|
||||||
|
"party_room_new_owner": "新房主",
|
||||||
|
"party_room_system": "系统",
|
||||||
|
"party_room_joined_room": "加入了房间",
|
||||||
|
"party_room_left_room": "离开了房间",
|
||||||
|
"party_room_became_owner": "成为了新房主",
|
||||||
|
"party_room_info_updated": "房间信息已更新",
|
||||||
|
"party_room_dismissed": "房间已解散",
|
||||||
|
"party_room_kicked": "被踢出房间",
|
||||||
|
"party_room_just_now": "刚刚",
|
||||||
|
"party_room_minutes_ago": "{v0} 分钟前",
|
||||||
|
"@party_room_minutes_ago": {},
|
||||||
|
"party_room_hours_ago": "{v0} 小时前",
|
||||||
|
"@party_room_hours_ago": {},
|
||||||
|
"party_room_days_ago": "{v0} 天前",
|
||||||
|
"@party_room_days_ago": {},
|
||||||
|
"party_room_room": "房间",
|
||||||
|
"party_room_members_count": "{v0}/{v1} 成员",
|
||||||
|
"@party_room_members_count": {},
|
||||||
|
"party_room_edit_room": "编辑房间",
|
||||||
|
"party_room_confirm_dismiss": "确认解散",
|
||||||
|
"party_room_dismiss_confirm_msg": "确定要解散房间吗?所有成员将被移出。",
|
||||||
|
"party_room_dismiss": "解散",
|
||||||
|
"party_room_dismiss_room": "解散房间",
|
||||||
|
"party_room_leave_confirm": "确认离开房间吗?",
|
||||||
|
"party_room_leave_room": "离开房间",
|
||||||
|
"party_room_create_room": "创建房间",
|
||||||
|
"party_room_room_type": "房间类型",
|
||||||
|
"party_room_select_main_tag": "选择主标签",
|
||||||
|
"party_room_sub_tag_optional": "子标签 (可选)",
|
||||||
|
"party_room_select_sub_tag": "选择子标签",
|
||||||
|
"party_room_none": "无",
|
||||||
|
"party_room_target_members": "目标人数 (2-100)",
|
||||||
|
"party_room_enter_target_members": "输入目标人数",
|
||||||
|
"party_room_set_password": "设置密码",
|
||||||
|
"party_room_room_password": "房间密码",
|
||||||
|
"party_room_password_empty_hint": "为空则不更新密码,取消勾选则取消密码",
|
||||||
|
"party_room_enter_password": "输入密码",
|
||||||
|
"party_room_password_disabled": "未启用密码",
|
||||||
|
"party_room_social_links_optional": "社交链接 (可选)",
|
||||||
|
"party_room_social_links_placeholder": "以 https:// 开头,目前仅支持 qq、discord、kook、oopz 链接",
|
||||||
|
"party_room_select_room_type": "请选择房间类型",
|
||||||
|
"party_room_target_members_range": "目标人数必须在 2-100 之间",
|
||||||
|
"party_room_enter_password_required": "请输入密码",
|
||||||
|
"party_room_link_format_error": "链接格式错误!",
|
||||||
|
"party_room_update_failed": "更新失败",
|
||||||
|
"party_room_create_failed": "创建失败",
|
||||||
|
"party_room_save": "保存",
|
||||||
|
"party_room_create": "创建",
|
||||||
|
"party_room_register_title": "注册账号",
|
||||||
|
"party_room_error": "错误",
|
||||||
|
"party_room_step_enter_game_id": "输入游戏ID",
|
||||||
|
"party_room_step_verify_rsi": "验证RSI账号",
|
||||||
|
"party_room_step_complete": "完成注册",
|
||||||
|
"party_room_about_verification": "关于账号验证",
|
||||||
|
"party_room_verification_hint": "接下来,您需要在 RSI 账号简介中添加验证码以证明账号所有权,验证通过后,您可以移除该验证码。",
|
||||||
|
"party_room_step1_title": "步骤 1: 输入您的游戏ID",
|
||||||
|
"party_room_step1_desc": "请输入您在星际公民中的游戏ID(Handle),这是您在游戏中使用的唯一标识符。",
|
||||||
|
"party_room_game_id_example": "例如: Citizen123",
|
||||||
|
"party_room_view_game_id": "查看我的游戏ID",
|
||||||
|
"party_room_enter_game_id": "请输入游戏ID",
|
||||||
|
"party_room_next_step": "下一步",
|
||||||
|
"party_room_step2_title": "步骤 2: 验证 RSI 账号",
|
||||||
|
"party_room_step2_desc": "请按照以下步骤完成账号验证:",
|
||||||
|
"party_room_copy_code": "1. 复制以下验证码:",
|
||||||
|
"party_room_visit_rsi": "2. 访问您的 RSI 账号资设置页",
|
||||||
|
"party_room_open_profile": "打开资料页",
|
||||||
|
"party_room_edit_bio": "3. 编辑您的个人简介,将验证码添加到简介中",
|
||||||
|
"party_room_code_validity": "在简介的任意位置添加验证码即可,验证码30分钟内有效",
|
||||||
|
"party_room_prev_step": "上一步",
|
||||||
|
"party_room_verify_register": "我已添加,验证并注册",
|
||||||
|
"party_room_register_success": "注册成功!",
|
||||||
|
"party_room_register_success_msg": "您已成功注册组队大厅,现在可以开始使用了",
|
||||||
|
"party_room_guest_mode_hint": "您正在以游客身份浏览,登录后可创建或加入房间。",
|
||||||
|
"party_room_login": "登录",
|
||||||
|
"party_room_search_owner": "搜索房主名称...",
|
||||||
|
"party_room_return_to_room": "返回当前房间",
|
||||||
|
"party_room_select_tag": "选择标签",
|
||||||
|
"party_room_all_tags": "全部标签",
|
||||||
|
"party_room_no_matching_room": "没有找到符合条件的房间",
|
||||||
|
"party_room_no_room_in_category": "当前分类下没有房间",
|
||||||
|
"party_room_no_available_room": "暂无可用房间",
|
||||||
|
"party_room_be_first_create": "成为第一个创建房间的人吧!",
|
||||||
|
"party_room_all_loaded": "已加载全部房间",
|
||||||
|
"party_room_need_login": "需要登录",
|
||||||
|
"party_room_create_need_login": "创建房间需要先登录账号,是否现在去登录?",
|
||||||
|
"party_room_go_login": "去登录",
|
||||||
|
"party_room_create_new_room": "创建新房间",
|
||||||
|
"party_room_already_in_room_create": "你已经在其他房间中,创建新房间将自动退出当前房间。是否继续?",
|
||||||
|
"party_room_continue": "继续",
|
||||||
|
"party_room_join_need_login": "加入房间需要先登录账号,是否现在去登录?",
|
||||||
|
"party_room_switch_room": "切换房间",
|
||||||
|
"party_room_already_in_room_join": "你已经在其他房间中,加入新房间将自动退出当前房间。是否继续?",
|
||||||
|
"party_room_enter_room_password": "输入房间密码",
|
||||||
|
"party_room_join": "加入",
|
||||||
|
"party_room_join_failed": "加入失败",
|
||||||
|
"party_room_reconnect_failed": "重连失败: {v0}",
|
||||||
|
"@party_room_reconnect_failed": {},
|
||||||
|
"party_room_reconnect_retry": "重连失败,已尝试 {v0} 次",
|
||||||
|
"@party_room_reconnect_retry": {},
|
||||||
|
"party_room_connect_error": "连接失败: {v0}",
|
||||||
|
"@party_room_connect_error": {},
|
||||||
|
"party_room_get_code_failed": "获取验证码失败: {v0}",
|
||||||
|
"@party_room_get_code_failed": {},
|
||||||
|
"party_room_game_id_empty": "游戏ID不能为空",
|
||||||
|
"party_room_register_failed": "注册失败: {v0}",
|
||||||
|
"@party_room_register_failed": {},
|
||||||
|
"party_room_load_list_failed": "加载房间列表失败: {v0}",
|
||||||
|
"@party_room_load_list_failed": {},
|
||||||
|
"party_room_game_not_started": "<游戏未启动>",
|
||||||
|
"party_room_main_menu": "<主菜单>",
|
||||||
|
"splash_diagnostic_mode": "诊断模式 - Step {v0}",
|
||||||
|
"@splash_diagnostic_mode": {},
|
||||||
|
"splash_read_full_log": "读取完整日志",
|
||||||
|
"splash_reset_database": "重置数据库",
|
||||||
|
"splash_init_task_status": "初始化任务执行情况:",
|
||||||
|
"splash_waiting_log": "等待日志...",
|
||||||
|
"splash_timeout": "超时",
|
||||||
|
"splash_error": "错误",
|
||||||
|
"splash_diagnostic_log": "[诊断] {v0}",
|
||||||
|
"@splash_diagnostic_log": {},
|
||||||
|
"splash_start_init": "[{v0}] 开始初始化...",
|
||||||
|
"@splash_start_init": {},
|
||||||
|
"splash_exec_app_init": "执行 appModel.initApp()...",
|
||||||
|
"splash_app_init_timeout": "✗ appModel.initApp() 超时 (10秒)",
|
||||||
|
"splash_app_init_done": "✓ appModel.initApp() 完成",
|
||||||
|
"splash_app_init_error": "✗ appModel.initApp() 错误: {v0}",
|
||||||
|
"@splash_app_init_error": {},
|
||||||
|
"splash_open_hive_box": "打开 Hive app_conf box...",
|
||||||
|
"splash_hive_timeout": "✗ Hive.openBox(\"app_conf\") 超时 (10秒)",
|
||||||
|
"splash_hive_done": "✓ Hive.openBox(\"app_conf\") 完成",
|
||||||
|
"splash_hive_error": "✗ Hive.openBox(\"app_conf\") 错误: {v0}",
|
||||||
|
"@splash_hive_error": {},
|
||||||
|
"splash_check_version": "检查 splash_alert_info_version...",
|
||||||
|
"splash_exec_analytics": "执行 AnalyticsApi.touch(\"launch\")...",
|
||||||
|
"splash_analytics_timeout": "⚠ AnalyticsApi.touch() 超时 (10秒) - 继续执行",
|
||||||
|
"splash_analytics_done": "✓ AnalyticsApi.touch(\"launch\") 完成",
|
||||||
|
"splash_analytics_error": "⚠ AnalyticsApi.touch(\"launch\") 错误: {v0} - 继续执行",
|
||||||
|
"@splash_analytics_error": {},
|
||||||
|
"splash_show_agreement": "需要显示用户协议对话框...",
|
||||||
|
"splash_context_unmounted_dialog": "✗ Context 已卸载,无法显示对话框",
|
||||||
|
"splash_agreement_handled": "✓ 用户协议对话框已处理",
|
||||||
|
"splash_exec_check_host": "执行 URLConf.checkHost()...",
|
||||||
|
"splash_check_host_timeout": "⚠ URLConf.checkHost() 超时 (10秒) - 继续执行",
|
||||||
|
"splash_check_host_done": "✓ URLConf.checkHost() 完成",
|
||||||
|
"splash_check_host_error": "⚠ URLConf.checkHost() 错误: {v0} - 继续执行",
|
||||||
|
"@splash_check_host_error": {},
|
||||||
|
"splash_step0_done": "--- Step 0 完成,进入 Step 1 ---",
|
||||||
|
"splash_context_unmounted": "✗ Context 已卸载",
|
||||||
|
"splash_exec_check_update": "执行 appModel.checkUpdate()...",
|
||||||
|
"splash_check_update_timeout": "⚠ appModel.checkUpdate() 超时 (10秒) - 继续执行",
|
||||||
|
"splash_check_update_done": "✓ appModel.checkUpdate() 完成",
|
||||||
|
"splash_check_update_error": "⚠ appModel.checkUpdate() 错误: {v0} - 继续执行",
|
||||||
|
"@splash_check_update_error": {},
|
||||||
|
"splash_step1_done": "--- Step 1 完成,进入 Step 2 ---",
|
||||||
|
"splash_init_aria2c": "初始化 aria2cModelProvider...",
|
||||||
|
"splash_aria2c_done": "✓ aria2cModelProvider 初始化完成",
|
||||||
|
"splash_aria2c_error": "⚠ aria2cModelProvider 初始化错误: {v0}",
|
||||||
|
"@splash_aria2c_error": {},
|
||||||
|
"splash_context_unmounted_nav": "✗ Context 已卸载,无法导航",
|
||||||
|
"splash_all_done": "✓ 所有初始化完成,准备跳转到主界面",
|
||||||
|
"splash_context_unmounted_jump": "✗ Context 已卸载,无法跳转",
|
||||||
|
"splash_log_not_exist": "[{v0}] ⚠ 日志文件不存在",
|
||||||
|
"@splash_log_not_exist": {},
|
||||||
|
"splash_start_read_log": "[{v0}] --- 开始读取完整日志文件 ---",
|
||||||
|
"@splash_start_read_log": {},
|
||||||
|
"splash_log_read_done": "[{v0}] --- 日志读取完成 (显示最后1000行) ---",
|
||||||
|
"@splash_log_read_done": {},
|
||||||
|
"splash_read_log_failed": "[{v0}] ✗ 读取日志失败: {v1}",
|
||||||
|
"@splash_read_log_failed": {},
|
||||||
|
"splash_user_reset_db": "[诊断] 用户请求重置数据库",
|
||||||
|
"splash_hive_boxes_closed": "[诊断] Hive boxes 已关闭",
|
||||||
|
"splash_close_hive_failed": "[诊断] 关闭 Hive boxes 失败: {v0}",
|
||||||
|
"@splash_close_hive_failed": {},
|
||||||
|
"splash_deleting_db": "[诊断] 正在删除数据库目录: {v0}",
|
||||||
|
"@splash_deleting_db": {},
|
||||||
|
"splash_db_deleted": "[诊断] 数据库目录已删除",
|
||||||
|
"splash_db_not_exist": "[诊断] 数据库目录不存在: {v0}",
|
||||||
|
"@splash_db_not_exist": {},
|
||||||
|
"splash_db_reset_done": "[诊断] 数据库重置完成,准备退出应用",
|
||||||
|
"splash_db_reset_msg": "数据库已重置,应用将退出。请重新启动应用。",
|
||||||
|
"splash_reset_db_failed": "[诊断] 重置数据库失败: {v0}",
|
||||||
|
"@splash_reset_db_failed": {},
|
||||||
|
"tools_unp4k_search_placeholder": "搜索文件(支持正则)...",
|
||||||
|
"tools_unp4k_sort_default": "默认排序",
|
||||||
|
"tools_unp4k_sort_size_asc": "小文件优先",
|
||||||
|
"tools_unp4k_sort_size_desc": "大文件优先",
|
||||||
|
"tools_unp4k_sort_date_asc": "旧文件优先",
|
||||||
|
"tools_unp4k_sort_date_desc": "新文件优先",
|
||||||
|
"tools_unp4k_action_save_as": "另存为...",
|
||||||
|
"tools_unp4k_action_extracting": "正在提取:{v0}",
|
||||||
|
"tools_unp4k_action_extract_success": "提取完成:{v0}",
|
||||||
|
"tools_unp4k_action_extract_failed": "提取失败:{v0}",
|
||||||
|
"tools_unp4k_search_no_result": "未找到匹配文件",
|
||||||
|
"tools_unp4k_searching": "正在搜索...",
|
||||||
|
"tools_unp4k_extract_dialog_title": "提取文件",
|
||||||
|
"tools_unp4k_extract_progress": "正在提取 ({v0}/{v1})",
|
||||||
|
"tools_unp4k_extract_current_file": "当前文件:{v0}",
|
||||||
|
"tools_unp4k_extract_cancelled": "提取已取消",
|
||||||
|
"tools_unp4k_extract_completed": "提取完成,共 {v0} 个文件",
|
||||||
|
"tools_unp4k_action_multi_select": "多选",
|
||||||
|
"tools_unp4k_action_export_selected": "导出选中项 ({v0})",
|
||||||
|
"tools_unp4k_action_cancel_multi_select": "取消多选",
|
||||||
|
"tools_unp4k_action_select_all": "全选",
|
||||||
|
"tools_unp4k_action_deselect_all": "取消全选",
|
||||||
|
"dcb_viewer_title": "DataForge 查看器 -> {v0}",
|
||||||
|
"dcb_viewer_loading": "正在加载 DCB 文件...",
|
||||||
|
"dcb_viewer_parsing": "正在解析 DataForge 数据...",
|
||||||
|
"dcb_viewer_loading_records": "正在加载记录列表...",
|
||||||
|
"dcb_viewer_loaded_records": "已加载 {v0} 条记录",
|
||||||
|
"dcb_viewer_error_not_dcb": "无效的 DCB 文件格式",
|
||||||
|
"dcb_viewer_search_mode": "搜索模式",
|
||||||
|
"dcb_viewer_searching": "正在搜索...",
|
||||||
|
"dcb_viewer_search_results": "找到 {v0} 个结果",
|
||||||
|
"dcb_viewer_search_fulltext_placeholder": "全文搜索(回车确认)...",
|
||||||
|
"dcb_viewer_search_list_placeholder": "过滤记录路径...",
|
||||||
|
"dcb_viewer_search_in_file": "在当前文件中搜索...",
|
||||||
|
"dcb_viewer_search_no_results": "无结果",
|
||||||
|
"dcb_viewer_search_case_sensitive": "区分大小写",
|
||||||
|
"dcb_viewer_search_regex": "使用正则表达式",
|
||||||
|
"dcb_viewer_fold_all": "折叠/展开代码块",
|
||||||
|
"dcb_viewer_no_records": "没有记录",
|
||||||
|
"dcb_viewer_no_search_results": "没有搜索结果",
|
||||||
|
"dcb_viewer_select_record": "选择一条记录以查看 XML 内容",
|
||||||
|
"dcb_viewer_export": "导出",
|
||||||
|
"dcb_viewer_export_single_xml": "导出为单个 XML",
|
||||||
|
"dcb_viewer_export_multiple_xml": "导出为多个 XML 文件",
|
||||||
|
"dcb_viewer_export_success": "导出成功",
|
||||||
|
"dcb_viewer_export_failed": "导出失败",
|
||||||
|
"dcb_viewer_title_standalone": "DataForge 查看器",
|
||||||
|
"dcb_viewer_select_file_title": "选择 DCB 文件",
|
||||||
|
"dcb_viewer_select_file_description": "请选择一个 .dcb 文件或从 P4K 中提取的 DCB 文件",
|
||||||
|
"dcb_viewer_select_dcb_file": "选择 DCB 文件",
|
||||||
|
"dcb_viewer_select_p4k_file": "选择 P4K 文件",
|
||||||
|
"dcb_viewer_select_another_file": "选择其他文件",
|
||||||
|
"tools_action_dcb_viewer": "DCB/DataForge 查看器",
|
||||||
|
"tools_action_dcb_viewer_info": "查看和导出 DataForge 游戏数据库 (.dcb) 文件内容",
|
||||||
|
"action_back": "返回",
|
||||||
|
"tools_action_switch_graphics_renderer": "切换 DirectX/Vulkan 渲染器",
|
||||||
|
"tools_action_switch_graphics_renderer_info": "当前渲染器:{v0}",
|
||||||
|
"tools_graphics_renderer_dx11": "DirectX 11",
|
||||||
|
"tools_graphics_renderer_vulkan": "Vulkan",
|
||||||
|
"tools_graphics_renderer_unknown": "未知",
|
||||||
|
"tools_graphics_renderer_dialog_title": "切换图形渲染器",
|
||||||
|
"tools_graphics_renderer_dialog_version": "版本代码",
|
||||||
|
"tools_graphics_renderer_dialog_version_hint": "请选择或输入版本代码",
|
||||||
|
"tools_graphics_renderer_dialog_renderer": "渲染器",
|
||||||
|
"tools_graphics_renderer_dialog_save": "保存",
|
||||||
|
"tools_graphics_renderer_dialog_save_success": "渲染器设置已保存",
|
||||||
|
"tools_graphics_renderer_dialog_save_failed": "保存失败:{v0}",
|
||||||
|
"tools_graphics_renderer_dialog_no_version": "未找到版本代码,请手动输入(若您不了解此项,请群求其他玩家帮助)",
|
||||||
|
"yearly_report_title": "星际公民 {year} 年度报告",
|
||||||
|
"yearly_report_generating": "正在生成您的年度报告...",
|
||||||
|
"yearly_report_analyzing_logs": "正在分析游戏日志数据",
|
||||||
|
"yearly_report_error_title": "无法生成年度报告",
|
||||||
|
"yearly_report_error_description": "请确保游戏目录正确且存在日志文件",
|
||||||
|
"yearly_report_nav_prev": "上一页",
|
||||||
|
"yearly_report_nav_next": "继续查看",
|
||||||
|
"yearly_report_welcome_title": "{year} 年度报告",
|
||||||
|
"yearly_report_welcome_subtitle": "回顾您在星际公民中的精彩时刻",
|
||||||
|
"yearly_report_welcome_hint": "向下滚动或点击下方按钮开始",
|
||||||
|
"yearly_report_launch_count_title": "游戏启动次数",
|
||||||
|
"yearly_report_launch_count_desc": "今年您启动了游戏",
|
||||||
|
"yearly_report_launch_count_label": "累计启动",
|
||||||
|
"yearly_report_launch_count_value": "{v0} 次",
|
||||||
|
"@yearly_report_launch_count_value": {},
|
||||||
|
"yearly_report_play_time_title": "游玩时长",
|
||||||
|
"yearly_report_play_time_desc": "今年您在宇宙中遨游了",
|
||||||
|
"yearly_report_play_time_unit": "小时",
|
||||||
|
"yearly_report_play_time_label": "累计游玩",
|
||||||
|
"yearly_report_play_time_value": "{v0} 小时",
|
||||||
|
"@yearly_report_play_time_value": {},
|
||||||
|
"yearly_report_crash_title": "游戏崩溃次数",
|
||||||
|
"yearly_report_crash_desc": "今年游戏不太稳定的时刻",
|
||||||
|
"yearly_report_crash_label": "累计崩溃",
|
||||||
|
"yearly_report_crash_note_high": "希望明年能更稳定!",
|
||||||
|
"yearly_report_crash_note_low": "运气不错!",
|
||||||
|
"yearly_report_kd_title": "击杀统计",
|
||||||
|
"yearly_report_kd_kill": "击杀",
|
||||||
|
"yearly_report_kd_death": "死亡",
|
||||||
|
"yearly_report_kd_suicide": "自杀",
|
||||||
|
"yearly_report_kd_no_record": "今年没有检测到击杀/死亡记录",
|
||||||
|
"yearly_report_no_data": "暂无数据",
|
||||||
|
"yearly_report_earliest_play_title": "最早的一次游玩",
|
||||||
|
"yearly_report_earliest_play_desc": "您在清晨 {v0} 月 {v1} 日开始了星际之旅",
|
||||||
|
"@yearly_report_earliest_play_desc": {},
|
||||||
|
"yearly_report_latest_play_title": "最晚的一次游玩",
|
||||||
|
"yearly_report_latest_play_desc": "深夜 {v0} 月 {v1} 日还在探索宇宙",
|
||||||
|
"@yearly_report_latest_play_desc": {},
|
||||||
|
"yearly_report_vehicle_destruction_title": "载具损毁统计",
|
||||||
|
"yearly_report_vehicle_destruction_desc": "今年您共炸了",
|
||||||
|
"yearly_report_vehicle_destruction_unit": "艘船",
|
||||||
|
"yearly_report_vehicle_destruction_most": "炸的最多的船",
|
||||||
|
"yearly_report_vehicle_destruction_count": "炸了 {v0} 次",
|
||||||
|
"@yearly_report_vehicle_destruction_count": {},
|
||||||
|
"yearly_report_vehicle_pilot_title": "载具驾驶统计",
|
||||||
|
"yearly_report_vehicle_pilot_most": "最常驾驶的载具",
|
||||||
|
"yearly_report_vehicle_pilot_count": "驾驶了 {v0} 次",
|
||||||
|
"@yearly_report_vehicle_pilot_count": {},
|
||||||
|
"yearly_report_vehicle_pilot_collapse": "收起详情",
|
||||||
|
"yearly_report_vehicle_pilot_expand": "查看全部 {v0} 个载具",
|
||||||
|
"@yearly_report_vehicle_pilot_expand": {},
|
||||||
|
"yearly_report_account_title": "账号统计",
|
||||||
|
"yearly_report_account_most": "最常使用的账号",
|
||||||
|
"yearly_report_account_count": "登录了 {v0} 次",
|
||||||
|
"@yearly_report_account_count": {},
|
||||||
|
"yearly_report_account_total": "共检测到 {v0} 个账号",
|
||||||
|
"@yearly_report_account_total": {},
|
||||||
|
"yearly_report_account_expand": "查看全部账号",
|
||||||
|
"yearly_report_duration_hours_minutes": "{v0} 小时 {v1} 分钟",
|
||||||
|
"@yearly_report_duration_hours_minutes": {},
|
||||||
|
"yearly_report_duration_minutes": "{v0} 分钟",
|
||||||
|
"@yearly_report_duration_minutes": {},
|
||||||
|
"yearly_report_session_title": "游玩时长详情",
|
||||||
|
"yearly_report_session_average": "平均",
|
||||||
|
"yearly_report_session_longest": "最长",
|
||||||
|
"yearly_report_session_date": "{v0}月{v1}日",
|
||||||
|
"@yearly_report_session_date": {},
|
||||||
|
"yearly_report_session_shortest": "最短",
|
||||||
|
"yearly_report_session_note": "(最短仅统计超过 5 分钟的游戏)",
|
||||||
|
"yearly_report_month_format": "{v0}月",
|
||||||
|
"@yearly_report_month_format": {},
|
||||||
|
"yearly_report_monthly_title": "月份统计",
|
||||||
|
"yearly_report_monthly_most": "游玩最多",
|
||||||
|
"yearly_report_monthly_most_count": "启动了 {v0} 次",
|
||||||
|
"@yearly_report_monthly_most_count": {},
|
||||||
|
"yearly_report_monthly_least": "游玩最少",
|
||||||
|
"yearly_report_monthly_least_count": "仅启动 {v0} 次",
|
||||||
|
"@yearly_report_monthly_least_count": {},
|
||||||
|
"yearly_report_date_range": "{v0}月{v1}日 - {v2}月{v3}日",
|
||||||
|
"@yearly_report_date_range": {},
|
||||||
|
"yearly_report_streak_title": "连续记录",
|
||||||
|
"yearly_report_streak_play": "连续游玩",
|
||||||
|
"yearly_report_streak_day_unit": "天",
|
||||||
|
"yearly_report_streak_offline": "连续离线",
|
||||||
|
"yearly_report_location_title": "地点统计",
|
||||||
|
"yearly_report_location_no_record": "暂无地点访问记录",
|
||||||
|
"yearly_report_location_frequent": "常去的地点",
|
||||||
|
"yearly_report_location_note": "基于库存查看记录统计",
|
||||||
|
"yearly_report_thanks_title": "感谢您的陪伴",
|
||||||
|
"yearly_report_thanks_message": "{year} 年,我们一起在星际公民中\n创造了无数精彩回忆",
|
||||||
|
"yearly_report_thanks_next": "期待 {nextYear} 年继续与您相伴!",
|
||||||
|
"yearly_report_summary_launch_game": "启动游戏",
|
||||||
|
"yearly_report_summary_longest_online": "最长在线",
|
||||||
|
"yearly_report_summary_earliest_time": "最早时刻",
|
||||||
|
"yearly_report_summary_latest_time": "最晚时刻",
|
||||||
|
"yearly_report_summary_respawn_count": "重开次数",
|
||||||
|
"yearly_report_summary_hottest_month": "最热月",
|
||||||
|
"yearly_report_summary_frequent_location": "常去位置",
|
||||||
|
"yearly_report_summary_favorite_vehicle": "最爱载具",
|
||||||
|
"yearly_report_powered_by": "由 SC 汉化盒子为您呈现",
|
||||||
|
"yearly_report_disclaimer": "数据使用您的本地日志生成,不会发送到任何第三方。因跨版本 Log 改动较大,数据可能不完整,仅供娱乐。",
|
||||||
|
"yearly_report_card_title": "{year} 年度报告(限时)",
|
||||||
|
"yearly_report_card_desc": "查看您在{year}年的星际公民游玩统计,数据来自本地 log ,请确保在常用电脑上查看。",
|
||||||
|
"tools_shader_clean_dialog_title": "清理着色器缓存",
|
||||||
|
"tools_shader_clean_keep_latest": "保留最新",
|
||||||
|
"tools_shader_clean_all": "全部清理",
|
||||||
|
"tools_shader_clean_keep_latest_desc": "适合游戏更新并完成首次启动后使用。保留最新版本的所有文件,清理其他旧版本。",
|
||||||
|
"tools_shader_clean_all_desc": "清理所有版本的缓存。适合画面异常或更新后清理。",
|
||||||
|
"tools_action_info_cleaning": "正在清理...",
|
||||||
|
"tools_action_start_cleaning": "开始清理",
|
||||||
|
"app_common_recommended": "推荐"
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
134
lib/main.dart
134
lib/main.dart
@ -1,7 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
import 'package:desktop_multi_window/desktop_multi_window.dart';
|
||||||
import 'package:desktop_webview_window/desktop_webview_window.dart';
|
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:starcitizen_doctor/generated/l10n.dart';
|
import 'package:starcitizen_doctor/generated/l10n.dart';
|
||||||
@ -11,28 +11,36 @@ import 'package:flutter_localizations/flutter_localizations.dart';
|
|||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
import 'common/utils/multi_window_manager.dart';
|
import 'common/utils/multi_window_manager.dart';
|
||||||
|
|
||||||
void main(List<String> args) async {
|
Future<void> main(List<String> args) async {
|
||||||
// webview window
|
|
||||||
if (runWebViewTitleBarWidget(args,
|
|
||||||
backgroundColor: const Color.fromRGBO(19, 36, 49, 1), builder: _defaultWebviewTitleBar)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (args.firstOrNull == 'multi_window') {
|
|
||||||
MultiWindowManager.runSubWindowApp(args);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await _initWindow();
|
await windowManager.ensureInitialized();
|
||||||
// run app
|
|
||||||
runApp(const ProviderScope(child: App()));
|
// Get the current window controller
|
||||||
|
final windowController = await WindowController.fromCurrentEngine();
|
||||||
|
|
||||||
|
// Parse window arguments to determine which window to show
|
||||||
|
final windowType = MultiWindowManager.parseWindowType(windowController.arguments);
|
||||||
|
|
||||||
|
// Initialize window-specific handlers for sub-windows
|
||||||
|
if (windowType != WindowTypes.main) {
|
||||||
|
await windowController.doCustomInitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run different apps based on the window type
|
||||||
|
switch (windowType) {
|
||||||
|
case WindowTypes.main:
|
||||||
|
await _initWindow();
|
||||||
|
runApp(const ProviderScope(child: App()));
|
||||||
|
default:
|
||||||
|
MultiWindowManager.runSubWindowApp(windowController.arguments, windowType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_initWindow() async {
|
Future<void> _initWindow() async {
|
||||||
await windowManager.ensureInitialized();
|
// Initialize flutter_acrylic before runApp (same as official example)
|
||||||
await windowManager.setTitleBarStyle(
|
await Window.initialize();
|
||||||
TitleBarStyle.hidden,
|
await Window.hideWindowControls();
|
||||||
windowButtonVisibility: false,
|
await windowManager.setTitleBarStyle(TitleBarStyle.hidden, windowButtonVisibility: false);
|
||||||
);
|
|
||||||
await windowManager.setSize(const Size(1280, 810));
|
await windowManager.setSize(const Size(1280, 810));
|
||||||
await windowManager.setMinimumSize(const Size(1280, 810));
|
await windowManager.setMinimumSize(const Size(1280, 810));
|
||||||
await windowManager.center(animate: true);
|
await windowManager.center(animate: true);
|
||||||
@ -73,18 +81,22 @@ class App extends HookConsumerWidget with WindowListener {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
theme: FluentThemeData(
|
theme: FluentThemeData(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
fontFamily: "SourceHanSansCN-Regular",
|
fontFamily: "SourceHanSansCN-Regular",
|
||||||
navigationPaneTheme: NavigationPaneThemeData(
|
navigationPaneTheme: NavigationPaneThemeData(backgroundColor: appState.themeConf.backgroundColor),
|
||||||
backgroundColor: appState.themeConf.backgroundColor,
|
menuColor: appState.themeConf.menuColor,
|
||||||
|
micaBackgroundColor: appState.themeConf.micaColor,
|
||||||
|
buttonTheme: ButtonThemeData(
|
||||||
|
defaultButtonStyle: ButtonStyle(
|
||||||
|
shape: WidgetStateProperty.all(
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
side: BorderSide(color: Colors.white.withValues(alpha: .01)),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
menuColor: appState.themeConf.menuColor,
|
),
|
||||||
micaBackgroundColor: appState.themeConf.micaColor,
|
),
|
||||||
buttonTheme: ButtonThemeData(
|
|
||||||
defaultButtonStyle: ButtonStyle(
|
|
||||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(4), side: BorderSide(color: Colors.white.withValues(alpha: .01)))),
|
|
||||||
))),
|
|
||||||
locale: appState.appLocale,
|
locale: appState.appLocale,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
routeInformationParser: router.routeInformationParser,
|
routeInformationParser: router.routeInformationParser,
|
||||||
@ -97,57 +109,21 @@ class App extends HookConsumerWidget with WindowListener {
|
|||||||
Future<void> onWindowClose() async {
|
Future<void> onWindowClose() async {
|
||||||
debugPrint("onWindowClose");
|
debugPrint("onWindowClose");
|
||||||
if (await windowManager.isPreventClose()) {
|
if (await windowManager.isPreventClose()) {
|
||||||
final windows = await DesktopMultiWindow.getAllSubWindowIds();
|
final mainWindow = await WindowController.fromCurrentEngine();
|
||||||
for (final id in windows) {
|
final windows = await WindowController.getAll();
|
||||||
await WindowController.fromWindowId(id).close();
|
for (final controller in windows) {
|
||||||
|
if (controller.windowId != mainWindow.windowId) {
|
||||||
|
try {
|
||||||
|
controller.close();
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint("Error closing window ${controller.windowId}: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await windowManager.destroy();
|
await windowManager.setPreventClose(false);
|
||||||
|
await windowManager.close();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
super.onWindowClose();
|
super.onWindowClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _defaultWebviewTitleBar(BuildContext context) {
|
|
||||||
final state = TitleBarWebViewState.of(context);
|
|
||||||
final controller = TitleBarWebViewController.of(context);
|
|
||||||
return FluentTheme(
|
|
||||||
data: FluentThemeData.dark(),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
if (Platform.isMacOS) const SizedBox(width: 96),
|
|
||||||
IconButton(
|
|
||||||
onPressed: !state.canGoBack ? null : controller.back,
|
|
||||||
icon: const Icon(FluentIcons.chevron_left),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
IconButton(
|
|
||||||
onPressed: !state.canGoForward ? null : controller.forward,
|
|
||||||
icon: const Icon(FluentIcons.chevron_right),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
if (state.isLoading)
|
|
||||||
IconButton(
|
|
||||||
onPressed: controller.stop,
|
|
||||||
icon: const Icon(FluentIcons.chrome_close),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
IconButton(
|
|
||||||
onPressed: controller.reload,
|
|
||||||
icon: const Icon(FluentIcons.refresh),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
(state.isLoading)
|
|
||||||
? const SizedBox(
|
|
||||||
width: 24,
|
|
||||||
height: 24,
|
|
||||||
child: ProgressRing(),
|
|
||||||
)
|
|
||||||
: const SizedBox(width: 24),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
SelectableText(state.url ?? ""),
|
|
||||||
const Spacer()
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,217 +0,0 @@
|
|||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/conf/binary_conf.dart';
|
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:aria2/aria2.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:hive_ce/hive.dart';
|
|
||||||
import 'package:starcitizen_doctor/api/api.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/rust/api/rs_process.dart'
|
|
||||||
as rs_process;
|
|
||||||
|
|
||||||
import 'package:starcitizen_doctor/common/utils/log.dart';
|
|
||||||
import 'package:starcitizen_doctor/common/utils/provider.dart';
|
|
||||||
|
|
||||||
part 'aria2c.g.dart';
|
|
||||||
|
|
||||||
part 'aria2c.freezed.dart';
|
|
||||||
|
|
||||||
@freezed
|
|
||||||
class Aria2cModelState with _$Aria2cModelState {
|
|
||||||
const factory Aria2cModelState({
|
|
||||||
required String aria2cDir,
|
|
||||||
Aria2c? aria2c,
|
|
||||||
Aria2GlobalStat? aria2globalStat,
|
|
||||||
}) = _Aria2cModelState;
|
|
||||||
}
|
|
||||||
|
|
||||||
extension Aria2cModelExt on Aria2cModelState {
|
|
||||||
bool get isRunning => aria2c != null;
|
|
||||||
|
|
||||||
bool get hasDownloadTask => aria2globalStat != null && aria2TotalTaskNum > 0;
|
|
||||||
|
|
||||||
int get aria2TotalTaskNum => aria2globalStat == null
|
|
||||||
? 0
|
|
||||||
: ((aria2globalStat!.numActive ?? 0) +
|
|
||||||
(aria2globalStat!.numWaiting ?? 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
@riverpod
|
|
||||||
class Aria2cModel extends _$Aria2cModel {
|
|
||||||
bool _disposed = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Aria2cModelState build() {
|
|
||||||
if (appGlobalState.applicationBinaryModuleDir == null) {
|
|
||||||
throw Exception("applicationBinaryModuleDir is null");
|
|
||||||
}
|
|
||||||
ref.onDispose(() {
|
|
||||||
_disposed = true;
|
|
||||||
});
|
|
||||||
ref.keepAlive();
|
|
||||||
final aria2cDir = "${appGlobalState.applicationBinaryModuleDir}\\aria2c";
|
|
||||||
// LazyLoad init
|
|
||||||
() async {
|
|
||||||
try {
|
|
||||||
final sessionFile = File("$aria2cDir\\aria2.session");
|
|
||||||
// 有下载任务则第一时间初始化
|
|
||||||
if (await sessionFile.exists() &&
|
|
||||||
(await sessionFile.readAsString()).trim().isNotEmpty) {
|
|
||||||
dPrint("launch Aria2c daemon");
|
|
||||||
await launchDaemon(appGlobalState.applicationBinaryModuleDir!);
|
|
||||||
} else {
|
|
||||||
dPrint("LazyLoad Aria2c daemon");
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
dPrint("Aria2cManager.checkLazyLoad Error:$e");
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
return Aria2cModelState(aria2cDir: aria2cDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future launchDaemon(String applicationBinaryModuleDir) async {
|
|
||||||
if (state.aria2c != null) return;
|
|
||||||
await BinaryModuleConf.extractModule(
|
|
||||||
["aria2c"], applicationBinaryModuleDir);
|
|
||||||
|
|
||||||
/// skip for debug hot reload
|
|
||||||
if (kDebugMode) {
|
|
||||||
if ((await SystemHelper.getPID("aria2c")).isNotEmpty) {
|
|
||||||
dPrint("[Aria2cManager] debug skip for hot reload");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final sessionFile = File("${state.aria2cDir}\\aria2.session");
|
|
||||||
if (!await sessionFile.exists()) {
|
|
||||||
await sessionFile.create(recursive: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
final exePath = "${state.aria2cDir}\\aria2c.exe";
|
|
||||||
final port = await getFreePort();
|
|
||||||
final pwd = generateRandomPassword(16);
|
|
||||||
dPrint("pwd === $pwd");
|
|
||||||
final trackerList = await Api.getTorrentTrackerList();
|
|
||||||
dPrint("trackerList === $trackerList");
|
|
||||||
dPrint("Aria2cManager .----- aria2c start $port------");
|
|
||||||
|
|
||||||
final stream = rs_process.start(
|
|
||||||
executable: exePath,
|
|
||||||
arguments: [
|
|
||||||
"-V",
|
|
||||||
"-c",
|
|
||||||
"-x 16",
|
|
||||||
"--dir=${state.aria2cDir}\\downloads",
|
|
||||||
"--disable-ipv6",
|
|
||||||
"--enable-rpc",
|
|
||||||
"--pause",
|
|
||||||
"--rpc-listen-port=$port",
|
|
||||||
"--rpc-secret=$pwd",
|
|
||||||
"--input-file=${sessionFile.absolute.path.trim()}",
|
|
||||||
"--save-session=${sessionFile.absolute.path.trim()}",
|
|
||||||
"--save-session-interval=60",
|
|
||||||
"--file-allocation=trunc",
|
|
||||||
"--seed-time=0",
|
|
||||||
],
|
|
||||||
workingDirectory: state.aria2cDir);
|
|
||||||
|
|
||||||
String launchError = "";
|
|
||||||
|
|
||||||
stream.listen((event) {
|
|
||||||
dPrint(
|
|
||||||
"Aria2cManager.rs_process event === [${event.rsPid}] ${event.dataType} >> ${event.data}");
|
|
||||||
switch (event.dataType) {
|
|
||||||
case rs_process.RsProcessStreamDataType.output:
|
|
||||||
if (event.data.contains("IPv4 RPC: listening on TCP port")) {
|
|
||||||
_onLaunch(port, pwd, trackerList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case rs_process.RsProcessStreamDataType.error:
|
|
||||||
launchError = event.data;
|
|
||||||
state = state.copyWith(aria2c: null);
|
|
||||||
break;
|
|
||||||
case rs_process.RsProcessStreamDataType.exit:
|
|
||||||
launchError = event.data;
|
|
||||||
state = state.copyWith(aria2c: null);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
if (state.aria2c != null) return;
|
|
||||||
if (launchError.isNotEmpty) throw launchError;
|
|
||||||
await Future.delayed(const Duration(milliseconds: 100));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<int> getFreePort() async {
|
|
||||||
final serverSocket = await ServerSocket.bind("127.0.0.1", 0);
|
|
||||||
final port = serverSocket.port;
|
|
||||||
await serverSocket.close();
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
String generateRandomPassword(int length) {
|
|
||||||
const String charset =
|
|
||||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
||||||
Random random = Random();
|
|
||||||
StringBuffer buffer = StringBuffer();
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
int randomIndex = random.nextInt(charset.length);
|
|
||||||
buffer.write(charset[randomIndex]);
|
|
||||||
}
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
int textToByte(String text) {
|
|
||||||
if (text.length == 1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (int.tryParse(text) != null) {
|
|
||||||
return int.parse(text);
|
|
||||||
}
|
|
||||||
if (text.endsWith("k")) {
|
|
||||||
return int.parse(text.substring(0, text.length - 1)) * 1024;
|
|
||||||
}
|
|
||||||
if (text.endsWith("m")) {
|
|
||||||
return int.parse(text.substring(0, text.length - 1)) * 1024 * 1024;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _onLaunch(int port, String pwd, String trackerList) async {
|
|
||||||
final aria2c = Aria2c("ws://127.0.0.1:$port/jsonrpc", "websocket", pwd);
|
|
||||||
state = state.copyWith(aria2c: aria2c);
|
|
||||||
aria2c.getVersion().then((value) {
|
|
||||||
dPrint("Aria2cManager.connected! version == ${value.version}");
|
|
||||||
_listenState(aria2c);
|
|
||||||
});
|
|
||||||
final box = await Hive.openBox("app_conf");
|
|
||||||
aria2c.changeGlobalOption(Aria2Option()
|
|
||||||
..maxOverallUploadLimit =
|
|
||||||
textToByte(box.get("downloader_up_limit", defaultValue: "0"))
|
|
||||||
..maxOverallDownloadLimit =
|
|
||||||
textToByte(box.get("downloader_down_limit", defaultValue: "0"))
|
|
||||||
..btTracker = trackerList);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _listenState(Aria2c aria2c) async {
|
|
||||||
dPrint("Aria2cModel._listenState start");
|
|
||||||
while (true) {
|
|
||||||
if (_disposed || state.aria2c == null) {
|
|
||||||
dPrint("Aria2cModel._listenState end");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
final aria2globalStat = await aria2c.getGlobalStat();
|
|
||||||
state = state.copyWith(aria2globalStat: aria2globalStat);
|
|
||||||
} catch (e) {
|
|
||||||
dPrint("aria2globalStat update error:$e");
|
|
||||||
}
|
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,197 +0,0 @@
|
|||||||
// coverage:ignore-file
|
|
||||||
// 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 'aria2c.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// FreezedGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
T _$identity<T>(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');
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
mixin _$Aria2cModelState {
|
|
||||||
String get aria2cDir => throw _privateConstructorUsedError;
|
|
||||||
Aria2c? get aria2c => throw _privateConstructorUsedError;
|
|
||||||
Aria2GlobalStat? get aria2globalStat => throw _privateConstructorUsedError;
|
|
||||||
|
|
||||||
/// Create a copy of Aria2cModelState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
$Aria2cModelStateCopyWith<Aria2cModelState> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class $Aria2cModelStateCopyWith<$Res> {
|
|
||||||
factory $Aria2cModelStateCopyWith(
|
|
||||||
Aria2cModelState value, $Res Function(Aria2cModelState) then) =
|
|
||||||
_$Aria2cModelStateCopyWithImpl<$Res, Aria2cModelState>;
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String aria2cDir, Aria2c? aria2c, Aria2GlobalStat? aria2globalStat});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class _$Aria2cModelStateCopyWithImpl<$Res, $Val extends Aria2cModelState>
|
|
||||||
implements $Aria2cModelStateCopyWith<$Res> {
|
|
||||||
_$Aria2cModelStateCopyWithImpl(this._value, this._then);
|
|
||||||
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Val _value;
|
|
||||||
// ignore: unused_field
|
|
||||||
final $Res Function($Val) _then;
|
|
||||||
|
|
||||||
/// Create a copy of Aria2cModelState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? aria2cDir = null,
|
|
||||||
Object? aria2c = freezed,
|
|
||||||
Object? aria2globalStat = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_value.copyWith(
|
|
||||||
aria2cDir: null == aria2cDir
|
|
||||||
? _value.aria2cDir
|
|
||||||
: aria2cDir // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
aria2c: freezed == aria2c
|
|
||||||
? _value.aria2c
|
|
||||||
: aria2c // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Aria2c?,
|
|
||||||
aria2globalStat: freezed == aria2globalStat
|
|
||||||
? _value.aria2globalStat
|
|
||||||
: aria2globalStat // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Aria2GlobalStat?,
|
|
||||||
) as $Val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
abstract class _$$Aria2cModelStateImplCopyWith<$Res>
|
|
||||||
implements $Aria2cModelStateCopyWith<$Res> {
|
|
||||||
factory _$$Aria2cModelStateImplCopyWith(_$Aria2cModelStateImpl value,
|
|
||||||
$Res Function(_$Aria2cModelStateImpl) then) =
|
|
||||||
__$$Aria2cModelStateImplCopyWithImpl<$Res>;
|
|
||||||
@override
|
|
||||||
@useResult
|
|
||||||
$Res call(
|
|
||||||
{String aria2cDir, Aria2c? aria2c, Aria2GlobalStat? aria2globalStat});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
class __$$Aria2cModelStateImplCopyWithImpl<$Res>
|
|
||||||
extends _$Aria2cModelStateCopyWithImpl<$Res, _$Aria2cModelStateImpl>
|
|
||||||
implements _$$Aria2cModelStateImplCopyWith<$Res> {
|
|
||||||
__$$Aria2cModelStateImplCopyWithImpl(_$Aria2cModelStateImpl _value,
|
|
||||||
$Res Function(_$Aria2cModelStateImpl) _then)
|
|
||||||
: super(_value, _then);
|
|
||||||
|
|
||||||
/// Create a copy of Aria2cModelState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
@override
|
|
||||||
$Res call({
|
|
||||||
Object? aria2cDir = null,
|
|
||||||
Object? aria2c = freezed,
|
|
||||||
Object? aria2globalStat = freezed,
|
|
||||||
}) {
|
|
||||||
return _then(_$Aria2cModelStateImpl(
|
|
||||||
aria2cDir: null == aria2cDir
|
|
||||||
? _value.aria2cDir
|
|
||||||
: aria2cDir // ignore: cast_nullable_to_non_nullable
|
|
||||||
as String,
|
|
||||||
aria2c: freezed == aria2c
|
|
||||||
? _value.aria2c
|
|
||||||
: aria2c // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Aria2c?,
|
|
||||||
aria2globalStat: freezed == aria2globalStat
|
|
||||||
? _value.aria2globalStat
|
|
||||||
: aria2globalStat // ignore: cast_nullable_to_non_nullable
|
|
||||||
as Aria2GlobalStat?,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @nodoc
|
|
||||||
|
|
||||||
class _$Aria2cModelStateImpl
|
|
||||||
with DiagnosticableTreeMixin
|
|
||||||
implements _Aria2cModelState {
|
|
||||||
const _$Aria2cModelStateImpl(
|
|
||||||
{required this.aria2cDir, this.aria2c, this.aria2globalStat});
|
|
||||||
|
|
||||||
@override
|
|
||||||
final String aria2cDir;
|
|
||||||
@override
|
|
||||||
final Aria2c? aria2c;
|
|
||||||
@override
|
|
||||||
final Aria2GlobalStat? aria2globalStat;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
|
||||||
return 'Aria2cModelState(aria2cDir: $aria2cDir, aria2c: $aria2c, aria2globalStat: $aria2globalStat)';
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
|
||||||
super.debugFillProperties(properties);
|
|
||||||
properties
|
|
||||||
..add(DiagnosticsProperty('type', 'Aria2cModelState'))
|
|
||||||
..add(DiagnosticsProperty('aria2cDir', aria2cDir))
|
|
||||||
..add(DiagnosticsProperty('aria2c', aria2c))
|
|
||||||
..add(DiagnosticsProperty('aria2globalStat', aria2globalStat));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) {
|
|
||||||
return identical(this, other) ||
|
|
||||||
(other.runtimeType == runtimeType &&
|
|
||||||
other is _$Aria2cModelStateImpl &&
|
|
||||||
(identical(other.aria2cDir, aria2cDir) ||
|
|
||||||
other.aria2cDir == aria2cDir) &&
|
|
||||||
(identical(other.aria2c, aria2c) || other.aria2c == aria2c) &&
|
|
||||||
(identical(other.aria2globalStat, aria2globalStat) ||
|
|
||||||
other.aria2globalStat == aria2globalStat));
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode =>
|
|
||||||
Object.hash(runtimeType, aria2cDir, aria2c, aria2globalStat);
|
|
||||||
|
|
||||||
/// Create a copy of Aria2cModelState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
@override
|
|
||||||
@pragma('vm:prefer-inline')
|
|
||||||
_$$Aria2cModelStateImplCopyWith<_$Aria2cModelStateImpl> get copyWith =>
|
|
||||||
__$$Aria2cModelStateImplCopyWithImpl<_$Aria2cModelStateImpl>(
|
|
||||||
this, _$identity);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class _Aria2cModelState implements Aria2cModelState {
|
|
||||||
const factory _Aria2cModelState(
|
|
||||||
{required final String aria2cDir,
|
|
||||||
final Aria2c? aria2c,
|
|
||||||
final Aria2GlobalStat? aria2globalStat}) = _$Aria2cModelStateImpl;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String get aria2cDir;
|
|
||||||
@override
|
|
||||||
Aria2c? get aria2c;
|
|
||||||
@override
|
|
||||||
Aria2GlobalStat? get aria2globalStat;
|
|
||||||
|
|
||||||
/// Create a copy of Aria2cModelState
|
|
||||||
/// with the given fields replaced by the non-null parameter values.
|
|
||||||
@override
|
|
||||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
||||||
_$$Aria2cModelStateImplCopyWith<_$Aria2cModelStateImpl> get copyWith =>
|
|
||||||
throw _privateConstructorUsedError;
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'aria2c.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// RiverpodGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
String _$aria2cModelHash() => r'3d51aeefd92e5291dca1f01db961f9c5496ec24f';
|
|
||||||
|
|
||||||
/// See also [Aria2cModel].
|
|
||||||
@ProviderFor(Aria2cModel)
|
|
||||||
final aria2cModelProvider =
|
|
||||||
AutoDisposeNotifierProvider<Aria2cModel, Aria2cModelState>.internal(
|
|
||||||
Aria2cModel.new,
|
|
||||||
name: r'aria2cModelProvider',
|
|
||||||
debugGetCreateSourceHash:
|
|
||||||
const bool.fromEnvironment('dart.vm.product') ? null : _$aria2cModelHash,
|
|
||||||
dependencies: null,
|
|
||||||
allTransitiveDependencies: null,
|
|
||||||
);
|
|
||||||
|
|
||||||
typedef _$Aria2cModel = AutoDisposeNotifier<Aria2cModelState>;
|
|
||||||
// ignore_for_file: type=lint
|
|
||||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
|
||||||
323
lib/provider/dcb_viewer.dart
Normal file
323
lib/provider/dcb_viewer.dart
Normal file
@ -0,0 +1,323 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/rust/api/unp4k_api.dart' as unp4k_api;
|
||||||
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
import 'package:starcitizen_doctor/data/dcb_data.dart';
|
||||||
|
|
||||||
|
part 'dcb_viewer.freezed.dart';
|
||||||
|
|
||||||
|
part 'dcb_viewer.g.dart';
|
||||||
|
|
||||||
|
/// DCB 查看器视图模式
|
||||||
|
enum DcbViewMode {
|
||||||
|
/// 普通列表浏览模式
|
||||||
|
browse,
|
||||||
|
|
||||||
|
/// 全文搜索结果模式
|
||||||
|
searchResults,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// DCB 查看器输入源类型
|
||||||
|
enum DcbSourceType {
|
||||||
|
/// 未初始化
|
||||||
|
none,
|
||||||
|
|
||||||
|
/// 从文件路径加载
|
||||||
|
filePath,
|
||||||
|
|
||||||
|
/// 从 P4K 内存数据加载
|
||||||
|
p4kMemory,
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class DcbViewerState with _$DcbViewerState {
|
||||||
|
const factory DcbViewerState({
|
||||||
|
/// 是否正在加载
|
||||||
|
@Default(true) bool isLoading,
|
||||||
|
|
||||||
|
/// 加载/错误消息
|
||||||
|
@Default('') String message,
|
||||||
|
|
||||||
|
/// 错误消息
|
||||||
|
String? errorMessage,
|
||||||
|
|
||||||
|
/// DCB 文件路径(用于显示标题)
|
||||||
|
@Default('') String dcbFilePath,
|
||||||
|
|
||||||
|
/// 数据源类型
|
||||||
|
@Default(DcbSourceType.none) DcbSourceType sourceType,
|
||||||
|
|
||||||
|
/// 所有记录列表
|
||||||
|
@Default([]) List<DcbRecordData> allRecords,
|
||||||
|
|
||||||
|
/// 当前过滤后的记录列表(用于列表搜索)
|
||||||
|
@Default([]) List<DcbRecordData> filteredRecords,
|
||||||
|
|
||||||
|
/// 当前选中的记录路径
|
||||||
|
String? selectedRecordPath,
|
||||||
|
|
||||||
|
/// 当前显示的 XML 内容
|
||||||
|
@Default('') String currentXml,
|
||||||
|
|
||||||
|
/// 列表搜索查询
|
||||||
|
@Default('') String listSearchQuery,
|
||||||
|
|
||||||
|
/// 全文搜索查询
|
||||||
|
@Default('') String fullTextSearchQuery,
|
||||||
|
|
||||||
|
/// 当前视图模式
|
||||||
|
@Default(DcbViewMode.browse) DcbViewMode viewMode,
|
||||||
|
|
||||||
|
/// 全文搜索结果
|
||||||
|
@Default([]) List<DcbSearchResultData> searchResults,
|
||||||
|
|
||||||
|
/// 是否正在搜索
|
||||||
|
@Default(false) bool isSearching,
|
||||||
|
|
||||||
|
/// 是否正在加载 XML
|
||||||
|
@Default(false) bool isLoadingXml,
|
||||||
|
|
||||||
|
/// 是否正在导出
|
||||||
|
@Default(false) bool isExporting,
|
||||||
|
|
||||||
|
/// 是否需要选择文件
|
||||||
|
@Default(false) bool needSelectFile,
|
||||||
|
}) = _DcbViewerState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
class DcbViewerModel extends _$DcbViewerModel {
|
||||||
|
@override
|
||||||
|
DcbViewerState build() {
|
||||||
|
ref.onDispose(() async {
|
||||||
|
try {
|
||||||
|
await unp4k_api.dcbClose();
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] close error: $e');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return const DcbViewerState(isLoading: false, needSelectFile: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从磁盘文件路径加载 DCB
|
||||||
|
Future<void> initFromFilePath(String filePath) async {
|
||||||
|
state = state.copyWith(
|
||||||
|
isLoading: true,
|
||||||
|
message: S.current.dcb_viewer_loading,
|
||||||
|
dcbFilePath: filePath,
|
||||||
|
sourceType: DcbSourceType.filePath,
|
||||||
|
needSelectFile: false,
|
||||||
|
errorMessage: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final file = File(filePath);
|
||||||
|
if (!await file.exists()) {
|
||||||
|
state = state.copyWith(isLoading: false, errorMessage: 'File not found: $filePath');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final data = await file.readAsBytes();
|
||||||
|
await _loadDcbData(data, filePath);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] init from file error: $e');
|
||||||
|
state = state.copyWith(isLoading: false, errorMessage: e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从 P4K 文件中提取并加载 DCB (Data/Game2.dcb)
|
||||||
|
Future<void> initFromP4kFile(String p4kPath) async {
|
||||||
|
state = state.copyWith(
|
||||||
|
isLoading: true,
|
||||||
|
message: S.current.dcb_viewer_loading,
|
||||||
|
dcbFilePath: 'Data/Game2.dcb',
|
||||||
|
sourceType: DcbSourceType.p4kMemory,
|
||||||
|
needSelectFile: false,
|
||||||
|
errorMessage: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 打开 P4K 文件
|
||||||
|
state = state.copyWith(message: S.current.tools_unp4k_msg_reading);
|
||||||
|
await unp4k_api.p4KOpen(p4KPath: p4kPath);
|
||||||
|
|
||||||
|
// 提取 DCB 文件到内存
|
||||||
|
state = state.copyWith(message: S.current.dcb_viewer_loading);
|
||||||
|
final data = await unp4k_api.p4KExtractToMemory(filePath: '\\Data\\Game2.dcb');
|
||||||
|
|
||||||
|
// 关闭 P4K(已完成提取)
|
||||||
|
await unp4k_api.p4KClose();
|
||||||
|
|
||||||
|
// 将数据写入临时文件并加载
|
||||||
|
final tempDir = await getTemporaryDirectory();
|
||||||
|
final tempPath = '${tempDir.path}/SCToolbox_dcb/Game2.dcb';
|
||||||
|
final tempFile = File(tempPath);
|
||||||
|
await tempFile.parent.create(recursive: true);
|
||||||
|
await tempFile.writeAsBytes(data);
|
||||||
|
|
||||||
|
state = state.copyWith(dcbFilePath: tempPath);
|
||||||
|
await _loadDcbData(Uint8List.fromList(data), tempPath);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] init from P4K error: $e');
|
||||||
|
// 确保关闭 P4K
|
||||||
|
try {
|
||||||
|
await unp4k_api.p4KClose();
|
||||||
|
} catch (_) {}
|
||||||
|
state = state.copyWith(isLoading: false, errorMessage: e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从内存数据初始化 DCB 查看器
|
||||||
|
Future<void> initFromData(Uint8List data, String filePath) async {
|
||||||
|
state = state.copyWith(
|
||||||
|
isLoading: true,
|
||||||
|
message: S.current.dcb_viewer_loading,
|
||||||
|
dcbFilePath: filePath,
|
||||||
|
sourceType: DcbSourceType.p4kMemory,
|
||||||
|
needSelectFile: false,
|
||||||
|
errorMessage: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
await _loadDcbData(data, filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 内部方法:加载 DCB 数据
|
||||||
|
Future<void> _loadDcbData(Uint8List data, String filePath) async {
|
||||||
|
try {
|
||||||
|
// 检查是否为 DCB 格式
|
||||||
|
final isDataforge = await unp4k_api.dcbIsDataforge(data: data);
|
||||||
|
if (!isDataforge) {
|
||||||
|
state = state.copyWith(isLoading: false, errorMessage: S.current.dcb_viewer_error_not_dcb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析 DCB 文件
|
||||||
|
state = state.copyWith(message: S.current.dcb_viewer_parsing);
|
||||||
|
await unp4k_api.dcbOpen(data: data);
|
||||||
|
|
||||||
|
// 获取记录列表
|
||||||
|
state = state.copyWith(message: S.current.dcb_viewer_loading_records);
|
||||||
|
final apiRecords = await unp4k_api.dcbGetRecordList();
|
||||||
|
|
||||||
|
// 转换为本地数据类型
|
||||||
|
final records = apiRecords.map((r) => DcbRecordData(path: r.path, index: r.index.toInt())).toList();
|
||||||
|
|
||||||
|
state = state.copyWith(
|
||||||
|
isLoading: false,
|
||||||
|
message: S.current.dcb_viewer_loaded_records(records.length),
|
||||||
|
allRecords: records,
|
||||||
|
filteredRecords: records,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] load data error: $e');
|
||||||
|
state = state.copyWith(isLoading: false, errorMessage: e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 选择一条记录并加载其 XML
|
||||||
|
Future<void> selectRecord(DcbRecordData record) async {
|
||||||
|
if (state.selectedRecordPath == record.path) return;
|
||||||
|
|
||||||
|
state = state.copyWith(selectedRecordPath: record.path, isLoadingXml: true, currentXml: '');
|
||||||
|
|
||||||
|
try {
|
||||||
|
final xml = await unp4k_api.dcbRecordToXml(path: record.path);
|
||||||
|
state = state.copyWith(isLoadingXml: false, currentXml: xml);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] load xml error: $e');
|
||||||
|
state = state.copyWith(isLoadingXml: false, currentXml: '<!-- Error loading XML: $e -->');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 列表搜索(过滤路径)
|
||||||
|
void searchList(String query) {
|
||||||
|
state = state.copyWith(listSearchQuery: query);
|
||||||
|
|
||||||
|
if (query.isEmpty) {
|
||||||
|
state = state.copyWith(filteredRecords: state.allRecords);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final queryLower = query.toLowerCase();
|
||||||
|
final filtered = state.allRecords.where((record) {
|
||||||
|
return record.path.toLowerCase().contains(queryLower);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
state = state.copyWith(filteredRecords: filtered);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 全文搜索
|
||||||
|
Future<void> searchFullText(String query) async {
|
||||||
|
if (query.isEmpty) {
|
||||||
|
// 退出搜索模式
|
||||||
|
state = state.copyWith(viewMode: DcbViewMode.browse, fullTextSearchQuery: '', searchResults: []);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
state = state.copyWith(isSearching: true, fullTextSearchQuery: query, viewMode: DcbViewMode.searchResults);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final apiResults = await unp4k_api.dcbSearchAll(query: query);
|
||||||
|
|
||||||
|
// 转换为本地数据类型
|
||||||
|
final results = apiResults.map((r) {
|
||||||
|
return DcbSearchResultData(
|
||||||
|
path: r.path,
|
||||||
|
index: r.index.toInt(),
|
||||||
|
matches: r.matches
|
||||||
|
.map((m) => DcbSearchMatchData(lineNumber: m.lineNumber.toInt(), lineContent: m.lineContent))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
state = state.copyWith(
|
||||||
|
isSearching: false,
|
||||||
|
searchResults: results,
|
||||||
|
message: S.current.dcb_viewer_search_results(results.length),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] search error: $e');
|
||||||
|
state = state.copyWith(isSearching: false, message: 'Search error: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从搜索结果选择记录
|
||||||
|
Future<void> selectFromSearchResult(DcbSearchResultData result) async {
|
||||||
|
final record = DcbRecordData(path: result.path, index: result.index);
|
||||||
|
await selectRecord(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 退出搜索模式
|
||||||
|
void exitSearchMode() {
|
||||||
|
state = state.copyWith(
|
||||||
|
viewMode: DcbViewMode.browse,
|
||||||
|
fullTextSearchQuery: '',
|
||||||
|
searchResults: [],
|
||||||
|
message: S.current.dcb_viewer_loaded_records(state.allRecords.length),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 导出 DCB(合并或分离模式)
|
||||||
|
Future<String?> exportToDisk(String outputPath, bool merge) async {
|
||||||
|
state = state.copyWith(isExporting: true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await unp4k_api.dcbExportToDisk(outputPath: outputPath, merge: merge, dcbPath: state.dcbFilePath);
|
||||||
|
state = state.copyWith(isExporting: false);
|
||||||
|
return null; // 成功
|
||||||
|
} catch (e) {
|
||||||
|
dPrint('[DCB Viewer] export error: $e');
|
||||||
|
state = state.copyWith(isExporting: false);
|
||||||
|
return e.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 重置状态,回到选择文件界面
|
||||||
|
void reset() {
|
||||||
|
state = const DcbViewerState(isLoading: false, needSelectFile: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
374
lib/provider/dcb_viewer.freezed.dart
Normal file
374
lib/provider/dcb_viewer.freezed.dart
Normal file
@ -0,0 +1,374 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
|
// 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 'dcb_viewer.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$DcbViewerState {
|
||||||
|
|
||||||
|
/// 是否正在加载
|
||||||
|
bool get isLoading;/// 加载/错误消息
|
||||||
|
String get message;/// 错误消息
|
||||||
|
String? get errorMessage;/// DCB 文件路径(用于显示标题)
|
||||||
|
String get dcbFilePath;/// 数据源类型
|
||||||
|
DcbSourceType get sourceType;/// 所有记录列表
|
||||||
|
List<DcbRecordData> get allRecords;/// 当前过滤后的记录列表(用于列表搜索)
|
||||||
|
List<DcbRecordData> get filteredRecords;/// 当前选中的记录路径
|
||||||
|
String? get selectedRecordPath;/// 当前显示的 XML 内容
|
||||||
|
String get currentXml;/// 列表搜索查询
|
||||||
|
String get listSearchQuery;/// 全文搜索查询
|
||||||
|
String get fullTextSearchQuery;/// 当前视图模式
|
||||||
|
DcbViewMode get viewMode;/// 全文搜索结果
|
||||||
|
List<DcbSearchResultData> get searchResults;/// 是否正在搜索
|
||||||
|
bool get isSearching;/// 是否正在加载 XML
|
||||||
|
bool get isLoadingXml;/// 是否正在导出
|
||||||
|
bool get isExporting;/// 是否需要选择文件
|
||||||
|
bool get needSelectFile;
|
||||||
|
/// Create a copy of DcbViewerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$DcbViewerStateCopyWith<DcbViewerState> get copyWith => _$DcbViewerStateCopyWithImpl<DcbViewerState>(this as DcbViewerState, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is DcbViewerState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.message, message) || other.message == message)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.dcbFilePath, dcbFilePath) || other.dcbFilePath == dcbFilePath)&&(identical(other.sourceType, sourceType) || other.sourceType == sourceType)&&const DeepCollectionEquality().equals(other.allRecords, allRecords)&&const DeepCollectionEquality().equals(other.filteredRecords, filteredRecords)&&(identical(other.selectedRecordPath, selectedRecordPath) || other.selectedRecordPath == selectedRecordPath)&&(identical(other.currentXml, currentXml) || other.currentXml == currentXml)&&(identical(other.listSearchQuery, listSearchQuery) || other.listSearchQuery == listSearchQuery)&&(identical(other.fullTextSearchQuery, fullTextSearchQuery) || other.fullTextSearchQuery == fullTextSearchQuery)&&(identical(other.viewMode, viewMode) || other.viewMode == viewMode)&&const DeepCollectionEquality().equals(other.searchResults, searchResults)&&(identical(other.isSearching, isSearching) || other.isSearching == isSearching)&&(identical(other.isLoadingXml, isLoadingXml) || other.isLoadingXml == isLoadingXml)&&(identical(other.isExporting, isExporting) || other.isExporting == isExporting)&&(identical(other.needSelectFile, needSelectFile) || other.needSelectFile == needSelectFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,isLoading,message,errorMessage,dcbFilePath,sourceType,const DeepCollectionEquality().hash(allRecords),const DeepCollectionEquality().hash(filteredRecords),selectedRecordPath,currentXml,listSearchQuery,fullTextSearchQuery,viewMode,const DeepCollectionEquality().hash(searchResults),isSearching,isLoadingXml,isExporting,needSelectFile);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'DcbViewerState(isLoading: $isLoading, message: $message, errorMessage: $errorMessage, dcbFilePath: $dcbFilePath, sourceType: $sourceType, allRecords: $allRecords, filteredRecords: $filteredRecords, selectedRecordPath: $selectedRecordPath, currentXml: $currentXml, listSearchQuery: $listSearchQuery, fullTextSearchQuery: $fullTextSearchQuery, viewMode: $viewMode, searchResults: $searchResults, isSearching: $isSearching, isLoadingXml: $isLoadingXml, isExporting: $isExporting, needSelectFile: $needSelectFile)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $DcbViewerStateCopyWith<$Res> {
|
||||||
|
factory $DcbViewerStateCopyWith(DcbViewerState value, $Res Function(DcbViewerState) _then) = _$DcbViewerStateCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
bool isLoading, String message, String? errorMessage, String dcbFilePath, DcbSourceType sourceType, List<DcbRecordData> allRecords, List<DcbRecordData> filteredRecords, String? selectedRecordPath, String currentXml, String listSearchQuery, String fullTextSearchQuery, DcbViewMode viewMode, List<DcbSearchResultData> searchResults, bool isSearching, bool isLoadingXml, bool isExporting, bool needSelectFile
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$DcbViewerStateCopyWithImpl<$Res>
|
||||||
|
implements $DcbViewerStateCopyWith<$Res> {
|
||||||
|
_$DcbViewerStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final DcbViewerState _self;
|
||||||
|
final $Res Function(DcbViewerState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of DcbViewerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? message = null,Object? errorMessage = freezed,Object? dcbFilePath = null,Object? sourceType = null,Object? allRecords = null,Object? filteredRecords = null,Object? selectedRecordPath = freezed,Object? currentXml = null,Object? listSearchQuery = null,Object? fullTextSearchQuery = null,Object? viewMode = null,Object? searchResults = null,Object? isSearching = null,Object? isLoadingXml = null,Object? isExporting = null,Object? needSelectFile = null,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,dcbFilePath: null == dcbFilePath ? _self.dcbFilePath : dcbFilePath // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,sourceType: null == sourceType ? _self.sourceType : sourceType // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DcbSourceType,allRecords: null == allRecords ? _self.allRecords : allRecords // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbRecordData>,filteredRecords: null == filteredRecords ? _self.filteredRecords : filteredRecords // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbRecordData>,selectedRecordPath: freezed == selectedRecordPath ? _self.selectedRecordPath : selectedRecordPath // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,currentXml: null == currentXml ? _self.currentXml : currentXml // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,listSearchQuery: null == listSearchQuery ? _self.listSearchQuery : listSearchQuery // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,fullTextSearchQuery: null == fullTextSearchQuery ? _self.fullTextSearchQuery : fullTextSearchQuery // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,viewMode: null == viewMode ? _self.viewMode : viewMode // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DcbViewMode,searchResults: null == searchResults ? _self.searchResults : searchResults // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbSearchResultData>,isSearching: null == isSearching ? _self.isSearching : isSearching // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,isLoadingXml: null == isLoadingXml ? _self.isLoadingXml : isLoadingXml // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,isExporting: null == isExporting ? _self.isExporting : isExporting // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,needSelectFile: null == needSelectFile ? _self.needSelectFile : needSelectFile // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [DcbViewerState].
|
||||||
|
extension DcbViewerStatePatterns on DcbViewerState {
|
||||||
|
/// 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 extends Object?>(TResult Function( _DcbViewerState value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState() 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 extends Object?>(TResult Function( _DcbViewerState value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState():
|
||||||
|
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 extends Object?>(TResult? Function( _DcbViewerState value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState() 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 extends Object?>(TResult Function( bool isLoading, String message, String? errorMessage, String dcbFilePath, DcbSourceType sourceType, List<DcbRecordData> allRecords, List<DcbRecordData> filteredRecords, String? selectedRecordPath, String currentXml, String listSearchQuery, String fullTextSearchQuery, DcbViewMode viewMode, List<DcbSearchResultData> searchResults, bool isSearching, bool isLoadingXml, bool isExporting, bool needSelectFile)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState() when $default != null:
|
||||||
|
return $default(_that.isLoading,_that.message,_that.errorMessage,_that.dcbFilePath,_that.sourceType,_that.allRecords,_that.filteredRecords,_that.selectedRecordPath,_that.currentXml,_that.listSearchQuery,_that.fullTextSearchQuery,_that.viewMode,_that.searchResults,_that.isSearching,_that.isLoadingXml,_that.isExporting,_that.needSelectFile);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 extends Object?>(TResult Function( bool isLoading, String message, String? errorMessage, String dcbFilePath, DcbSourceType sourceType, List<DcbRecordData> allRecords, List<DcbRecordData> filteredRecords, String? selectedRecordPath, String currentXml, String listSearchQuery, String fullTextSearchQuery, DcbViewMode viewMode, List<DcbSearchResultData> searchResults, bool isSearching, bool isLoadingXml, bool isExporting, bool needSelectFile) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState():
|
||||||
|
return $default(_that.isLoading,_that.message,_that.errorMessage,_that.dcbFilePath,_that.sourceType,_that.allRecords,_that.filteredRecords,_that.selectedRecordPath,_that.currentXml,_that.listSearchQuery,_that.fullTextSearchQuery,_that.viewMode,_that.searchResults,_that.isSearching,_that.isLoadingXml,_that.isExporting,_that.needSelectFile);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 extends Object?>(TResult? Function( bool isLoading, String message, String? errorMessage, String dcbFilePath, DcbSourceType sourceType, List<DcbRecordData> allRecords, List<DcbRecordData> filteredRecords, String? selectedRecordPath, String currentXml, String listSearchQuery, String fullTextSearchQuery, DcbViewMode viewMode, List<DcbSearchResultData> searchResults, bool isSearching, bool isLoadingXml, bool isExporting, bool needSelectFile)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DcbViewerState() when $default != null:
|
||||||
|
return $default(_that.isLoading,_that.message,_that.errorMessage,_that.dcbFilePath,_that.sourceType,_that.allRecords,_that.filteredRecords,_that.selectedRecordPath,_that.currentXml,_that.listSearchQuery,_that.fullTextSearchQuery,_that.viewMode,_that.searchResults,_that.isSearching,_that.isLoadingXml,_that.isExporting,_that.needSelectFile);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
|
||||||
|
class _DcbViewerState implements DcbViewerState {
|
||||||
|
const _DcbViewerState({this.isLoading = true, this.message = '', this.errorMessage, this.dcbFilePath = '', this.sourceType = DcbSourceType.none, final List<DcbRecordData> allRecords = const [], final List<DcbRecordData> filteredRecords = const [], this.selectedRecordPath, this.currentXml = '', this.listSearchQuery = '', this.fullTextSearchQuery = '', this.viewMode = DcbViewMode.browse, final List<DcbSearchResultData> searchResults = const [], this.isSearching = false, this.isLoadingXml = false, this.isExporting = false, this.needSelectFile = false}): _allRecords = allRecords,_filteredRecords = filteredRecords,_searchResults = searchResults;
|
||||||
|
|
||||||
|
|
||||||
|
/// 是否正在加载
|
||||||
|
@override@JsonKey() final bool isLoading;
|
||||||
|
/// 加载/错误消息
|
||||||
|
@override@JsonKey() final String message;
|
||||||
|
/// 错误消息
|
||||||
|
@override final String? errorMessage;
|
||||||
|
/// DCB 文件路径(用于显示标题)
|
||||||
|
@override@JsonKey() final String dcbFilePath;
|
||||||
|
/// 数据源类型
|
||||||
|
@override@JsonKey() final DcbSourceType sourceType;
|
||||||
|
/// 所有记录列表
|
||||||
|
final List<DcbRecordData> _allRecords;
|
||||||
|
/// 所有记录列表
|
||||||
|
@override@JsonKey() List<DcbRecordData> get allRecords {
|
||||||
|
if (_allRecords is EqualUnmodifiableListView) return _allRecords;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_allRecords);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 当前过滤后的记录列表(用于列表搜索)
|
||||||
|
final List<DcbRecordData> _filteredRecords;
|
||||||
|
/// 当前过滤后的记录列表(用于列表搜索)
|
||||||
|
@override@JsonKey() List<DcbRecordData> get filteredRecords {
|
||||||
|
if (_filteredRecords is EqualUnmodifiableListView) return _filteredRecords;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_filteredRecords);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 当前选中的记录路径
|
||||||
|
@override final String? selectedRecordPath;
|
||||||
|
/// 当前显示的 XML 内容
|
||||||
|
@override@JsonKey() final String currentXml;
|
||||||
|
/// 列表搜索查询
|
||||||
|
@override@JsonKey() final String listSearchQuery;
|
||||||
|
/// 全文搜索查询
|
||||||
|
@override@JsonKey() final String fullTextSearchQuery;
|
||||||
|
/// 当前视图模式
|
||||||
|
@override@JsonKey() final DcbViewMode viewMode;
|
||||||
|
/// 全文搜索结果
|
||||||
|
final List<DcbSearchResultData> _searchResults;
|
||||||
|
/// 全文搜索结果
|
||||||
|
@override@JsonKey() List<DcbSearchResultData> get searchResults {
|
||||||
|
if (_searchResults is EqualUnmodifiableListView) return _searchResults;
|
||||||
|
// ignore: implicit_dynamic_type
|
||||||
|
return EqualUnmodifiableListView(_searchResults);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 是否正在搜索
|
||||||
|
@override@JsonKey() final bool isSearching;
|
||||||
|
/// 是否正在加载 XML
|
||||||
|
@override@JsonKey() final bool isLoadingXml;
|
||||||
|
/// 是否正在导出
|
||||||
|
@override@JsonKey() final bool isExporting;
|
||||||
|
/// 是否需要选择文件
|
||||||
|
@override@JsonKey() final bool needSelectFile;
|
||||||
|
|
||||||
|
/// Create a copy of DcbViewerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$DcbViewerStateCopyWith<_DcbViewerState> get copyWith => __$DcbViewerStateCopyWithImpl<_DcbViewerState>(this, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DcbViewerState&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.message, message) || other.message == message)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.dcbFilePath, dcbFilePath) || other.dcbFilePath == dcbFilePath)&&(identical(other.sourceType, sourceType) || other.sourceType == sourceType)&&const DeepCollectionEquality().equals(other._allRecords, _allRecords)&&const DeepCollectionEquality().equals(other._filteredRecords, _filteredRecords)&&(identical(other.selectedRecordPath, selectedRecordPath) || other.selectedRecordPath == selectedRecordPath)&&(identical(other.currentXml, currentXml) || other.currentXml == currentXml)&&(identical(other.listSearchQuery, listSearchQuery) || other.listSearchQuery == listSearchQuery)&&(identical(other.fullTextSearchQuery, fullTextSearchQuery) || other.fullTextSearchQuery == fullTextSearchQuery)&&(identical(other.viewMode, viewMode) || other.viewMode == viewMode)&&const DeepCollectionEquality().equals(other._searchResults, _searchResults)&&(identical(other.isSearching, isSearching) || other.isSearching == isSearching)&&(identical(other.isLoadingXml, isLoadingXml) || other.isLoadingXml == isLoadingXml)&&(identical(other.isExporting, isExporting) || other.isExporting == isExporting)&&(identical(other.needSelectFile, needSelectFile) || other.needSelectFile == needSelectFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,isLoading,message,errorMessage,dcbFilePath,sourceType,const DeepCollectionEquality().hash(_allRecords),const DeepCollectionEquality().hash(_filteredRecords),selectedRecordPath,currentXml,listSearchQuery,fullTextSearchQuery,viewMode,const DeepCollectionEquality().hash(_searchResults),isSearching,isLoadingXml,isExporting,needSelectFile);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'DcbViewerState(isLoading: $isLoading, message: $message, errorMessage: $errorMessage, dcbFilePath: $dcbFilePath, sourceType: $sourceType, allRecords: $allRecords, filteredRecords: $filteredRecords, selectedRecordPath: $selectedRecordPath, currentXml: $currentXml, listSearchQuery: $listSearchQuery, fullTextSearchQuery: $fullTextSearchQuery, viewMode: $viewMode, searchResults: $searchResults, isSearching: $isSearching, isLoadingXml: $isLoadingXml, isExporting: $isExporting, needSelectFile: $needSelectFile)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$DcbViewerStateCopyWith<$Res> implements $DcbViewerStateCopyWith<$Res> {
|
||||||
|
factory _$DcbViewerStateCopyWith(_DcbViewerState value, $Res Function(_DcbViewerState) _then) = __$DcbViewerStateCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
bool isLoading, String message, String? errorMessage, String dcbFilePath, DcbSourceType sourceType, List<DcbRecordData> allRecords, List<DcbRecordData> filteredRecords, String? selectedRecordPath, String currentXml, String listSearchQuery, String fullTextSearchQuery, DcbViewMode viewMode, List<DcbSearchResultData> searchResults, bool isSearching, bool isLoadingXml, bool isExporting, bool needSelectFile
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$DcbViewerStateCopyWithImpl<$Res>
|
||||||
|
implements _$DcbViewerStateCopyWith<$Res> {
|
||||||
|
__$DcbViewerStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _DcbViewerState _self;
|
||||||
|
final $Res Function(_DcbViewerState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of DcbViewerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? message = null,Object? errorMessage = freezed,Object? dcbFilePath = null,Object? sourceType = null,Object? allRecords = null,Object? filteredRecords = null,Object? selectedRecordPath = freezed,Object? currentXml = null,Object? listSearchQuery = null,Object? fullTextSearchQuery = null,Object? viewMode = null,Object? searchResults = null,Object? isSearching = null,Object? isLoadingXml = null,Object? isExporting = null,Object? needSelectFile = null,}) {
|
||||||
|
return _then(_DcbViewerState(
|
||||||
|
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,dcbFilePath: null == dcbFilePath ? _self.dcbFilePath : dcbFilePath // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,sourceType: null == sourceType ? _self.sourceType : sourceType // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DcbSourceType,allRecords: null == allRecords ? _self._allRecords : allRecords // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbRecordData>,filteredRecords: null == filteredRecords ? _self._filteredRecords : filteredRecords // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbRecordData>,selectedRecordPath: freezed == selectedRecordPath ? _self.selectedRecordPath : selectedRecordPath // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String?,currentXml: null == currentXml ? _self.currentXml : currentXml // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,listSearchQuery: null == listSearchQuery ? _self.listSearchQuery : listSearchQuery // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,fullTextSearchQuery: null == fullTextSearchQuery ? _self.fullTextSearchQuery : fullTextSearchQuery // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,viewMode: null == viewMode ? _self.viewMode : viewMode // ignore: cast_nullable_to_non_nullable
|
||||||
|
as DcbViewMode,searchResults: null == searchResults ? _self._searchResults : searchResults // ignore: cast_nullable_to_non_nullable
|
||||||
|
as List<DcbSearchResultData>,isSearching: null == isSearching ? _self.isSearching : isSearching // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,isLoadingXml: null == isLoadingXml ? _self.isLoadingXml : isLoadingXml // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,isExporting: null == isExporting ? _self.isExporting : isExporting // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,needSelectFile: null == needSelectFile ? _self.needSelectFile : needSelectFile // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
62
lib/provider/dcb_viewer.g.dart
Normal file
62
lib/provider/dcb_viewer.g.dart
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'dcb_viewer.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// RiverpodGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(DcbViewerModel)
|
||||||
|
final dcbViewerModelProvider = DcbViewerModelProvider._();
|
||||||
|
|
||||||
|
final class DcbViewerModelProvider
|
||||||
|
extends $NotifierProvider<DcbViewerModel, DcbViewerState> {
|
||||||
|
DcbViewerModelProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'dcbViewerModelProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$dcbViewerModelHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
DcbViewerModel create() => DcbViewerModel();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(DcbViewerState value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<DcbViewerState>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$dcbViewerModelHash() => r'dfed59de5291e5a19cc481d0115fe91f5bcaf301';
|
||||||
|
|
||||||
|
abstract class _$DcbViewerModel extends $Notifier<DcbViewerState> {
|
||||||
|
DcbViewerState build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final ref = this.ref as $Ref<DcbViewerState, DcbViewerState>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<DcbViewerState, DcbViewerState>,
|
||||||
|
DcbViewerState,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleCreate(ref, build);
|
||||||
|
}
|
||||||
|
}
|
||||||
260
lib/provider/download_manager.dart
Normal file
260
lib/provider/download_manager.dart
Normal file
@ -0,0 +1,260 @@
|
|||||||
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:starcitizen_doctor/common/rust/api/downloader_api.dart' as downloader_api;
|
||||||
|
import 'package:starcitizen_doctor/common/utils/log.dart';
|
||||||
|
import 'package:starcitizen_doctor/common/utils/provider.dart';
|
||||||
|
|
||||||
|
part 'download_manager.g.dart';
|
||||||
|
|
||||||
|
part 'download_manager.freezed.dart';
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class DownloadManagerState with _$DownloadManagerState {
|
||||||
|
const factory DownloadManagerState({
|
||||||
|
required String workingDir,
|
||||||
|
required String downloadDir,
|
||||||
|
@Default(false) bool isInitialized,
|
||||||
|
downloader_api.DownloadGlobalStat? globalStat,
|
||||||
|
}) = _DownloadManagerState;
|
||||||
|
}
|
||||||
|
|
||||||
|
extension DownloadManagerStateExt on DownloadManagerState {
|
||||||
|
bool get isRunning => isInitialized;
|
||||||
|
|
||||||
|
bool get hasDownloadTask => globalStat != null && (globalStat!.numActive + globalStat!.numWaiting) > BigInt.zero;
|
||||||
|
|
||||||
|
int get totalTaskNum => globalStat == null ? 0 : (globalStat!.numActive + globalStat!.numWaiting).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@riverpod
|
||||||
|
class DownloadManager extends _$DownloadManager {
|
||||||
|
bool _disposed = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
DownloadManagerState build() {
|
||||||
|
if (appGlobalState.applicationBinaryModuleDir == null) {
|
||||||
|
throw Exception("applicationBinaryModuleDir is null");
|
||||||
|
}
|
||||||
|
if (appGlobalState.applicationSupportDir == null) {
|
||||||
|
throw Exception("applicationSupportDir is null");
|
||||||
|
}
|
||||||
|
ref.onDispose(() {
|
||||||
|
_disposed = true;
|
||||||
|
});
|
||||||
|
ref.keepAlive();
|
||||||
|
|
||||||
|
// Working directory for session data (in appSupport)
|
||||||
|
final workingDir = "${appGlobalState.applicationSupportDir}${Platform.pathSeparator}downloader";
|
||||||
|
// Default download directory (can be customized)
|
||||||
|
final downloadDir = "${appGlobalState.applicationBinaryModuleDir}${Platform.pathSeparator}downloads";
|
||||||
|
|
||||||
|
// Lazy load init
|
||||||
|
() async {
|
||||||
|
await Future.delayed(const Duration(milliseconds: 16));
|
||||||
|
try {
|
||||||
|
// Check if there are pending tasks to restore (without starting the downloader)
|
||||||
|
if (downloader_api.downloaderHasPendingSessionTasks(workingDir: workingDir)) {
|
||||||
|
dPrint("Launch download manager - found pending session tasks");
|
||||||
|
await initDownloader();
|
||||||
|
} else {
|
||||||
|
dPrint("LazyLoad download manager - no pending tasks");
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("DownloadManager.checkLazyLoad Error:$e");
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
||||||
|
return DownloadManagerState(workingDir: workingDir, downloadDir: downloadDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initDownloader({int? uploadLimitBps, int? downloadLimitBps}) async {
|
||||||
|
if (state.isInitialized) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Create working directory if it doesn't exist
|
||||||
|
final workingDir = Directory(state.workingDir);
|
||||||
|
if (!await workingDir.exists()) {
|
||||||
|
await workingDir.create(recursive: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create download directory if it doesn't exist
|
||||||
|
final downloadDir = Directory(state.downloadDir);
|
||||||
|
if (!await downloadDir.exists()) {
|
||||||
|
await downloadDir.create(recursive: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the Rust downloader with optional speed limits
|
||||||
|
await downloader_api.downloaderInit(
|
||||||
|
workingDir: state.workingDir,
|
||||||
|
defaultDownloadDir: state.downloadDir,
|
||||||
|
uploadLimitBps: uploadLimitBps,
|
||||||
|
downloadLimitBps: downloadLimitBps,
|
||||||
|
);
|
||||||
|
|
||||||
|
state = state.copyWith(isInitialized: true);
|
||||||
|
|
||||||
|
// Start listening to state updates
|
||||||
|
_listenState();
|
||||||
|
|
||||||
|
dPrint("DownloadManager initialized");
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("DownloadManager.initDownloader Error: $e");
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _listenState() async {
|
||||||
|
dPrint("DownloadManager._listenState start");
|
||||||
|
while (true) {
|
||||||
|
if (_disposed || !state.isInitialized) {
|
||||||
|
dPrint("DownloadManager._listenState end");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
final globalStat = await downloader_api.downloaderGetGlobalStats();
|
||||||
|
state = state.copyWith(globalStat: globalStat);
|
||||||
|
|
||||||
|
// Auto-remove completed tasks (no seeding behavior)
|
||||||
|
await removeCompletedTasks();
|
||||||
|
} catch (e) {
|
||||||
|
dPrint("globalStat update error:$e");
|
||||||
|
}
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add a torrent from base64 encoded bytes
|
||||||
|
Future<int> addTorrent(List<int> torrentBytes, {String? outputFolder, List<String>? trackers}) async {
|
||||||
|
await initDownloader();
|
||||||
|
final taskId = await downloader_api.downloaderAddTorrent(
|
||||||
|
torrentBytes: torrentBytes,
|
||||||
|
outputFolder: outputFolder,
|
||||||
|
trackers: trackers,
|
||||||
|
);
|
||||||
|
return taskId.toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add a torrent from magnet link
|
||||||
|
Future<int> addMagnet(String magnetLink, {String? outputFolder, List<String>? trackers}) async {
|
||||||
|
await initDownloader();
|
||||||
|
final taskId = await downloader_api.downloaderAddMagnet(
|
||||||
|
magnetLink: magnetLink,
|
||||||
|
outputFolder: outputFolder,
|
||||||
|
trackers: trackers,
|
||||||
|
);
|
||||||
|
return taskId.toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add a torrent from URL (only .torrent file URLs are supported)
|
||||||
|
/// HTTP downloads are NOT supported - will throw an exception
|
||||||
|
Future<int> addUrl(String url, {String? outputFolder, List<String>? trackers}) async {
|
||||||
|
await initDownloader();
|
||||||
|
final taskId = await downloader_api.downloaderAddUrl(url: url, outputFolder: outputFolder, trackers: trackers);
|
||||||
|
return taskId.toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> pauseTask(int taskId) async {
|
||||||
|
await downloader_api.downloaderPause(taskId: BigInt.from(taskId));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> resumeTask(int taskId) async {
|
||||||
|
await downloader_api.downloaderResume(taskId: BigInt.from(taskId));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> removeTask(int taskId, {bool deleteFiles = false}) async {
|
||||||
|
await downloader_api.downloaderRemove(taskId: BigInt.from(taskId), deleteFiles: deleteFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<downloader_api.DownloadTaskInfo> getTaskInfo(int taskId) async {
|
||||||
|
return await downloader_api.downloaderGetTaskInfo(taskId: BigInt.from(taskId));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<downloader_api.DownloadTaskInfo>> getAllTasks() async {
|
||||||
|
if (!state.isInitialized) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return await downloader_api.downloaderGetAllTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> isNameInTask(String name, {bool downloadingOnly = true}) async {
|
||||||
|
if (!state.isInitialized) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return await downloader_api.downloaderIsNameInTask(name: name, downloadingOnly: downloadingOnly);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> pauseAll() async {
|
||||||
|
await downloader_api.downloaderPauseAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> resumeAll() async {
|
||||||
|
await downloader_api.downloaderResumeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> stop() async {
|
||||||
|
await downloader_api.downloaderStop();
|
||||||
|
state = state.copyWith(isInitialized: false, globalStat: null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Shutdown the downloader completely (allows restart with new settings)
|
||||||
|
Future<void> shutdown() async {
|
||||||
|
await downloader_api.downloaderShutdown();
|
||||||
|
state = state.copyWith(isInitialized: false, globalStat: null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Restart the downloader with new speed limit settings
|
||||||
|
Future<void> restart({int? uploadLimitBps, int? downloadLimitBps}) async {
|
||||||
|
await shutdown();
|
||||||
|
await initDownloader(uploadLimitBps: uploadLimitBps, downloadLimitBps: downloadLimitBps);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Convert speed limit text to bytes per second
|
||||||
|
/// Supports formats like: "1", "100k", "10m", "0"
|
||||||
|
int textToByte(String text) {
|
||||||
|
if (text.isEmpty || text == "0") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
final trimmed = text.trim().toLowerCase();
|
||||||
|
if (int.tryParse(trimmed) != null) {
|
||||||
|
return int.parse(trimmed);
|
||||||
|
}
|
||||||
|
if (trimmed.endsWith("k")) {
|
||||||
|
return int.parse(trimmed.substring(0, trimmed.length - 1)) * 1024;
|
||||||
|
}
|
||||||
|
if (trimmed.endsWith("m")) {
|
||||||
|
return int.parse(trimmed.substring(0, trimmed.length - 1)) * 1024 * 1024;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Remove all completed tasks (equivalent to aria2's --seed-time=0 behavior)
|
||||||
|
/// Returns the number of tasks removed
|
||||||
|
Future<int> removeCompletedTasks() async {
|
||||||
|
if (!state.isInitialized) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
final removed = await downloader_api.downloaderRemoveCompletedTasks();
|
||||||
|
return removed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Check if there are any active (non-completed) download tasks
|
||||||
|
Future<bool> hasActiveTasks() async {
|
||||||
|
if (!state.isInitialized) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return await downloader_api.downloaderHasActiveTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get all completed tasks from cache (tasks that were removed by removeCompletedTasks)
|
||||||
|
/// This cache is cleared when the downloader is shutdown/restarted
|
||||||
|
List<downloader_api.DownloadTaskInfo> getCompletedTasksCache() {
|
||||||
|
return downloader_api.downloaderGetCompletedTasksCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Clear the completed tasks cache manually
|
||||||
|
void clearCompletedTasksCache() {
|
||||||
|
downloader_api.downloaderClearCompletedTasksCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
280
lib/provider/download_manager.freezed.dart
Normal file
280
lib/provider/download_manager.freezed.dart
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// coverage:ignore-file
|
||||||
|
// 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 'download_manager.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// FreezedGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// dart format off
|
||||||
|
T _$identity<T>(T value) => value;
|
||||||
|
/// @nodoc
|
||||||
|
mixin _$DownloadManagerState {
|
||||||
|
|
||||||
|
String get workingDir; String get downloadDir; bool get isInitialized; downloader_api.DownloadGlobalStat? get globalStat;
|
||||||
|
/// Create a copy of DownloadManagerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
$DownloadManagerStateCopyWith<DownloadManagerState> get copyWith => _$DownloadManagerStateCopyWithImpl<DownloadManagerState>(this as DownloadManagerState, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is DownloadManagerState&&(identical(other.workingDir, workingDir) || other.workingDir == workingDir)&&(identical(other.downloadDir, downloadDir) || other.downloadDir == downloadDir)&&(identical(other.isInitialized, isInitialized) || other.isInitialized == isInitialized)&&(identical(other.globalStat, globalStat) || other.globalStat == globalStat));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,workingDir,downloadDir,isInitialized,globalStat);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'DownloadManagerState(workingDir: $workingDir, downloadDir: $downloadDir, isInitialized: $isInitialized, globalStat: $globalStat)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class $DownloadManagerStateCopyWith<$Res> {
|
||||||
|
factory $DownloadManagerStateCopyWith(DownloadManagerState value, $Res Function(DownloadManagerState) _then) = _$DownloadManagerStateCopyWithImpl;
|
||||||
|
@useResult
|
||||||
|
$Res call({
|
||||||
|
String workingDir, String downloadDir, bool isInitialized, downloader_api.DownloadGlobalStat? globalStat
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class _$DownloadManagerStateCopyWithImpl<$Res>
|
||||||
|
implements $DownloadManagerStateCopyWith<$Res> {
|
||||||
|
_$DownloadManagerStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final DownloadManagerState _self;
|
||||||
|
final $Res Function(DownloadManagerState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of DownloadManagerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@pragma('vm:prefer-inline') @override $Res call({Object? workingDir = null,Object? downloadDir = null,Object? isInitialized = null,Object? globalStat = freezed,}) {
|
||||||
|
return _then(_self.copyWith(
|
||||||
|
workingDir: null == workingDir ? _self.workingDir : workingDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,downloadDir: null == downloadDir ? _self.downloadDir : downloadDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,isInitialized: null == isInitialized ? _self.isInitialized : isInitialized // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,globalStat: freezed == globalStat ? _self.globalStat : globalStat // ignore: cast_nullable_to_non_nullable
|
||||||
|
as downloader_api.DownloadGlobalStat?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Adds pattern-matching-related methods to [DownloadManagerState].
|
||||||
|
extension DownloadManagerStatePatterns on DownloadManagerState {
|
||||||
|
/// 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 extends Object?>(TResult Function( _DownloadManagerState value)? $default,{required TResult orElse(),}){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState() 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 extends Object?>(TResult Function( _DownloadManagerState value) $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState():
|
||||||
|
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 extends Object?>(TResult? Function( _DownloadManagerState value)? $default,){
|
||||||
|
final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState() 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 extends Object?>(TResult Function( String workingDir, String downloadDir, bool isInitialized, downloader_api.DownloadGlobalStat? globalStat)? $default,{required TResult orElse(),}) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState() when $default != null:
|
||||||
|
return $default(_that.workingDir,_that.downloadDir,_that.isInitialized,_that.globalStat);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 extends Object?>(TResult Function( String workingDir, String downloadDir, bool isInitialized, downloader_api.DownloadGlobalStat? globalStat) $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState():
|
||||||
|
return $default(_that.workingDir,_that.downloadDir,_that.isInitialized,_that.globalStat);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 extends Object?>(TResult? Function( String workingDir, String downloadDir, bool isInitialized, downloader_api.DownloadGlobalStat? globalStat)? $default,) {final _that = this;
|
||||||
|
switch (_that) {
|
||||||
|
case _DownloadManagerState() when $default != null:
|
||||||
|
return $default(_that.workingDir,_that.downloadDir,_that.isInitialized,_that.globalStat);case _:
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
|
||||||
|
|
||||||
|
class _DownloadManagerState implements DownloadManagerState {
|
||||||
|
const _DownloadManagerState({required this.workingDir, required this.downloadDir, this.isInitialized = false, this.globalStat});
|
||||||
|
|
||||||
|
|
||||||
|
@override final String workingDir;
|
||||||
|
@override final String downloadDir;
|
||||||
|
@override@JsonKey() final bool isInitialized;
|
||||||
|
@override final downloader_api.DownloadGlobalStat? globalStat;
|
||||||
|
|
||||||
|
/// Create a copy of DownloadManagerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
|
_$DownloadManagerStateCopyWith<_DownloadManagerState> get copyWith => __$DownloadManagerStateCopyWithImpl<_DownloadManagerState>(this, _$identity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DownloadManagerState&&(identical(other.workingDir, workingDir) || other.workingDir == workingDir)&&(identical(other.downloadDir, downloadDir) || other.downloadDir == downloadDir)&&(identical(other.isInitialized, isInitialized) || other.isInitialized == isInitialized)&&(identical(other.globalStat, globalStat) || other.globalStat == globalStat));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType,workingDir,downloadDir,isInitialized,globalStat);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'DownloadManagerState(workingDir: $workingDir, downloadDir: $downloadDir, isInitialized: $isInitialized, globalStat: $globalStat)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @nodoc
|
||||||
|
abstract mixin class _$DownloadManagerStateCopyWith<$Res> implements $DownloadManagerStateCopyWith<$Res> {
|
||||||
|
factory _$DownloadManagerStateCopyWith(_DownloadManagerState value, $Res Function(_DownloadManagerState) _then) = __$DownloadManagerStateCopyWithImpl;
|
||||||
|
@override @useResult
|
||||||
|
$Res call({
|
||||||
|
String workingDir, String downloadDir, bool isInitialized, downloader_api.DownloadGlobalStat? globalStat
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/// @nodoc
|
||||||
|
class __$DownloadManagerStateCopyWithImpl<$Res>
|
||||||
|
implements _$DownloadManagerStateCopyWith<$Res> {
|
||||||
|
__$DownloadManagerStateCopyWithImpl(this._self, this._then);
|
||||||
|
|
||||||
|
final _DownloadManagerState _self;
|
||||||
|
final $Res Function(_DownloadManagerState) _then;
|
||||||
|
|
||||||
|
/// Create a copy of DownloadManagerState
|
||||||
|
/// with the given fields replaced by the non-null parameter values.
|
||||||
|
@override @pragma('vm:prefer-inline') $Res call({Object? workingDir = null,Object? downloadDir = null,Object? isInitialized = null,Object? globalStat = freezed,}) {
|
||||||
|
return _then(_DownloadManagerState(
|
||||||
|
workingDir: null == workingDir ? _self.workingDir : workingDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,downloadDir: null == downloadDir ? _self.downloadDir : downloadDir // ignore: cast_nullable_to_non_nullable
|
||||||
|
as String,isInitialized: null == isInitialized ? _self.isInitialized : isInitialized // ignore: cast_nullable_to_non_nullable
|
||||||
|
as bool,globalStat: freezed == globalStat ? _self.globalStat : globalStat // ignore: cast_nullable_to_non_nullable
|
||||||
|
as downloader_api.DownloadGlobalStat?,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// dart format on
|
||||||
62
lib/provider/download_manager.g.dart
Normal file
62
lib/provider/download_manager.g.dart
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'download_manager.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// RiverpodGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
|
||||||
|
@ProviderFor(DownloadManager)
|
||||||
|
final downloadManagerProvider = DownloadManagerProvider._();
|
||||||
|
|
||||||
|
final class DownloadManagerProvider
|
||||||
|
extends $NotifierProvider<DownloadManager, DownloadManagerState> {
|
||||||
|
DownloadManagerProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'downloadManagerProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$downloadManagerHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
DownloadManager create() => DownloadManager();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(DownloadManagerState value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<DownloadManagerState>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$downloadManagerHash() => r'feed17eda191d6b618b30e01afb75b7245fe0a83';
|
||||||
|
|
||||||
|
abstract class _$DownloadManager extends $Notifier<DownloadManagerState> {
|
||||||
|
DownloadManagerState build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final ref = this.ref as $Ref<DownloadManagerState, DownloadManagerState>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<DownloadManagerState, DownloadManagerState>,
|
||||||
|
DownloadManagerState,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleCreate(ref, build);
|
||||||
|
}
|
||||||
|
}
|
||||||
1005
lib/provider/party_room.dart
Normal file
1005
lib/provider/party_room.dart
Normal file
File diff suppressed because it is too large
Load Diff
1156
lib/provider/party_room.freezed.dart
Normal file
1156
lib/provider/party_room.freezed.dart
Normal file
File diff suppressed because it is too large
Load Diff
67
lib/provider/party_room.g.dart
Normal file
67
lib/provider/party_room.g.dart
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'party_room.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// RiverpodGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
// ignore_for_file: type=lint, type=warning
|
||||||
|
/// PartyRoom Provider
|
||||||
|
|
||||||
|
@ProviderFor(PartyRoom)
|
||||||
|
final partyRoomProvider = PartyRoomProvider._();
|
||||||
|
|
||||||
|
/// PartyRoom Provider
|
||||||
|
final class PartyRoomProvider
|
||||||
|
extends $NotifierProvider<PartyRoom, PartyRoomFullState> {
|
||||||
|
/// PartyRoom Provider
|
||||||
|
PartyRoomProvider._()
|
||||||
|
: super(
|
||||||
|
from: null,
|
||||||
|
argument: null,
|
||||||
|
retry: null,
|
||||||
|
name: r'partyRoomProvider',
|
||||||
|
isAutoDispose: true,
|
||||||
|
dependencies: null,
|
||||||
|
$allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String debugGetCreateSourceHash() => _$partyRoomHash();
|
||||||
|
|
||||||
|
@$internal
|
||||||
|
@override
|
||||||
|
PartyRoom create() => PartyRoom();
|
||||||
|
|
||||||
|
/// {@macro riverpod.override_with_value}
|
||||||
|
Override overrideWithValue(PartyRoomFullState value) {
|
||||||
|
return $ProviderOverride(
|
||||||
|
origin: this,
|
||||||
|
providerOverride: $SyncValueProvider<PartyRoomFullState>(value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String _$partyRoomHash() => r'446e4cc88be96c890f8e676c6faf0e4d3b33a529';
|
||||||
|
|
||||||
|
/// PartyRoom Provider
|
||||||
|
|
||||||
|
abstract class _$PartyRoom extends $Notifier<PartyRoomFullState> {
|
||||||
|
PartyRoomFullState build();
|
||||||
|
@$mustCallSuper
|
||||||
|
@override
|
||||||
|
void runBuild() {
|
||||||
|
final ref = this.ref as $Ref<PartyRoomFullState, PartyRoomFullState>;
|
||||||
|
final element =
|
||||||
|
ref.element
|
||||||
|
as $ClassProviderElement<
|
||||||
|
AnyNotifier<PartyRoomFullState, PartyRoomFullState>,
|
||||||
|
PartyRoomFullState,
|
||||||
|
Object?,
|
||||||
|
Object?
|
||||||
|
>;
|
||||||
|
element.handleCreate(ref, build);
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user