diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml
deleted file mode 100644
index f674854cab..0000000000
--- a/.github/workflows/mac.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-name: Build for Mac
-
-on:
- workflow_call:
- inputs:
- tag:
- description: "tag"
- required: false
- default: ""
- type: string
- workflow_dispatch:
-
-jobs:
- build-mac-app:
- name: Release Mac
- runs-on: macos-26
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup flutter
- uses: subosito/flutter-action@v2
- with:
- channel: stable
- flutter-version-file: pubspec.yaml
-
- - name: Set and Extract version
- shell: pwsh
- run: lib/scripts/build.ps1
-
- - name: Apply Patch
- shell: pwsh
- run: lib/scripts/patch.ps1 macOS
- continue-on-error: true
-
- - name: Build Mac
- run: flutter build macos --release --dart-define-from-file=pili_release.json
-
- - name: Prepare Upload
- run: |
- npm install --global create-dmg
- create-dmg build/macos/Build/Products/Release/PiliPlus.app || true
- continue-on-error: true
-
- - name: Rename DMG
- run: mv PiliPlus*.dmg PiliPlus_macos_${{ env.version }}.dmg
-
- - name: Release
- if: ${{ github.event.inputs.tag != '' }}
- uses: softprops/action-gh-release@v2
- with:
- tag_name: ${{ github.event.inputs.tag }}
- name: ${{ github.event.inputs.tag }}
- files: |
- PiliPlus_macos_*.dmg
-
- - name: Upload macos release
- uses: actions/upload-artifact@v7
- with:
- archive: false
- name: macOS-release
- path: PiliPlus_macos_*.dmg
diff --git a/.github/workflows/win_x64.yml b/.github/workflows/win_x64.yml
deleted file mode 100644
index 42d90f2780..0000000000
--- a/.github/workflows/win_x64.yml
+++ /dev/null
@@ -1,87 +0,0 @@
-name: Build for Windows x64
-
-on:
- workflow_call:
- inputs:
- tag:
- description: "tag"
- required: false
- default: ""
- type: string
- workflow_dispatch:
-
-jobs:
- build-windows-app:
- name: Release Windows x64
- runs-on: windows-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Setup flutter
- uses: subosito/flutter-action@v2
- with:
- channel: stable
- flutter-version-file: pubspec.yaml
-
- - name: Apply Patch
- shell: pwsh
- run: lib/scripts/patch.ps1 windows
- continue-on-error: true
-
- - name: Add fastforge and Inno Setup
- run: |
- dart pub global activate fastforge
- choco install innosetup
-
- - name: Add Chinese language file for Inno Setup
- run: |
- Copy-Item "windows/packaging/exe/ChineseSimplified.isl" "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl"
- shell: pwsh
-
- - name: Set and Extract version
- shell: pwsh
- run: lib/scripts/build.ps1
-
- - name: Build Windows
- run: |
- fastforge package --platform windows --targets exe --flutter-build-args="dart-define-from-file=pili_release.json"
-
- - name: Prepare Upload
- run: |
- mkdir -p Release/PiliPlus-Win
- mkdir -p PiliPlus-Win-Setup
- mv build/windows/x64/runner/Release/* Release/PiliPlus-Win/
- mv dist/**/*.exe PiliPlus-Win-Setup/PiliPlus_windows_${{env.version}}_x64_setup.exe
-
- - name: Compress
- if: ${{ github.event.inputs.tag != '' }}
- run: |
- Compress-Archive -Path "Release/PiliPlus-Win" -DestinationPath "PiliPlus_windows_${{env.version}}_x64_portable.zip"
- shell: pwsh
-
- - name: Release
- if: ${{ github.event.inputs.tag != '' }}
- uses: softprops/action-gh-release@v2
- with:
- tag_name: ${{ github.event.inputs.tag }}
- name: ${{ github.event.inputs.tag }}
- files: |
- PiliPlus_windows_*.zip
- PiliPlus-Win-Setup/PiliPlus_windows_*.exe
-
- - name: Upload windows file release
- uses: actions/upload-artifact@v7
- with:
- archive: true
- name: PiliPlus_windows_${{env.version}}_x64_portable
- path: Release
-
- - name: Upload windows setup release
- uses: actions/upload-artifact@v7
- with:
- archive: false
- name: Windows-setup-x64-release
- path: PiliPlus-Win-Setup/PiliPlus_windows_*.exe
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index d67a772ca4..a74f0afb22 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,5 +1,6 @@
+
@@ -16,8 +17,7 @@
-
+
@@ -35,56 +35,62 @@
-
+ android:supportsPictureInPicture="true"
+ android:theme="@style/LaunchTheme"
+ android:windowSoftInputMode="adjustResize">
-
+
+
+
+ android:name="io.flutter.embedding.android.NormalTheme"
+ android:resource="@style/NormalTheme" />
+
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -100,36 +106,56 @@
+
+
-
+
+
+
-
-
-
+
-
+
-
-
-
+
-
+
-
-
-
+
@@ -147,28 +173,44 @@
-
-
-
-
+
+
+
-
-
+
-
+
-
+
-
+
-
@@ -177,32 +219,37 @@
+ android:theme="@style/Ucrop.CropTheme" />
-
-
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
diff --git a/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt b/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt
index 892f84aa45..21d46b4707 100644
--- a/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt
+++ b/android/app/src/main/kotlin/com/example/piliplus/MainActivity.kt
@@ -1,11 +1,16 @@
package com.example.piliplus
+import android.app.PendingIntent
import android.app.PictureInPictureParams
import android.app.SearchManager
import android.content.ComponentName
import android.content.Intent
import android.content.pm.PackageManager
+import android.content.pm.ShortcutInfo
+import android.content.pm.ShortcutManager
import android.content.res.Configuration
+import android.graphics.BitmapFactory
+import android.graphics.drawable.Icon
import android.os.Build
import android.os.Bundle
import android.provider.MediaStore
@@ -16,6 +21,7 @@ import com.ryanheise.audioservice.AudioServiceActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import kotlin.system.exitProcess
+import java.io.File
class MainActivity : AudioServiceActivity() {
private lateinit var methodChannel: MethodChannel
@@ -133,6 +139,38 @@ class MainActivity : AudioServiceActivity() {
}
}
+ "createShortcut" -> {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ try {
+ val shortcutManager =
+ context.getSystemService(ShortcutManager::class.java)
+ if (shortcutManager.isRequestPinShortcutSupported) {
+ val id = call.argument("id")!!
+ val uri = call.argument("uri")!!
+ val label = call.argument("label")!!
+ val icon = call.argument("icon")!!
+ val bitmap = BitmapFactory.decodeFile(icon)
+ val shortcut =
+ ShortcutInfo.Builder(context, id)
+ .setShortLabel(label)
+ .setIcon(Icon.createWithAdaptiveBitmap(bitmap))
+ .setIntent(Intent(Intent.ACTION_VIEW, uri.toUri()))
+ .build()
+ val pinIntent =
+ shortcutManager.createShortcutResultIntent(shortcut)
+ val pendingIntent = PendingIntent.getBroadcast(
+ context, 0, pinIntent, PendingIntent.FLAG_IMMUTABLE
+ )
+ shortcutManager.requestPinShortcut(
+ shortcut,
+ pendingIntent.intentSender
+ )
+ }
+ } catch (e: Exception) {
+ }
+ }
+ }
+
else -> result.notImplemented()
}
}
diff --git a/android/app/src/main/res/drawable/download.xml b/android/app/src/main/res/drawable/download.xml
new file mode 100644
index 0000000000..487998bf49
--- /dev/null
+++ b/android/app/src/main/res/drawable/download.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/android/app/src/main/res/drawable/search.xml b/android/app/src/main/res/drawable/search.xml
new file mode 100644
index 0000000000..d6f0b1dc5f
--- /dev/null
+++ b/android/app/src/main/res/drawable/search.xml
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/android/app/src/main/res/values/string.xml b/android/app/src/main/res/values/string.xml
index 7827e9219b..cf338c2303 100644
--- a/android/app/src/main/res/values/string.xml
+++ b/android/app/src/main/res/values/string.xml
@@ -1,3 +1,5 @@
PiliPlus
+ 搜索
+ 离线视频
\ No newline at end of file
diff --git a/android/app/src/main/res/xml-v25/shortcuts.xml b/android/app/src/main/res/xml-v25/shortcuts.xml
new file mode 100644
index 0000000000..0d7fab8ad1
--- /dev/null
+++ b/android/app/src/main/res/xml-v25/shortcuts.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index fdadabedd7..d733dff760 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -6,8 +6,6 @@ PODS:
- FlutterMacOS
- audio_session (0.0.1):
- Flutter
- - auto_orientation (0.0.1):
- - Flutter
- battery_plus (1.0.0):
- Flutter
- chat_bottom_container (0.0.1):
@@ -83,6 +81,8 @@ PODS:
- Flutter
- media_kit_video (0.0.1):
- Flutter
+ - native_device_orientation (0.0.1):
+ - Flutter
- OrderedSet (6.0.3)
- package_info_plus (0.4.5):
- Flutter
@@ -114,7 +114,6 @@ DEPENDENCIES:
- app_links (from `.symlinks/plugins/app_links/ios`)
- audio_service (from `.symlinks/plugins/audio_service/darwin`)
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- - auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
- battery_plus (from `.symlinks/plugins/battery_plus/ios`)
- chat_bottom_container (from `.symlinks/plugins/chat_bottom_container/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
@@ -133,6 +132,7 @@ DEPENDENCIES:
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
+ - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- saver_gallery (from `.symlinks/plugins/saver_gallery/ios`)
@@ -160,8 +160,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/audio_service/darwin"
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
- auto_orientation:
- :path: ".symlinks/plugins/auto_orientation/ios"
battery_plus:
:path: ".symlinks/plugins/battery_plus/ios"
chat_bottom_container:
@@ -198,6 +196,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/media_kit_native_event_loop/ios"
media_kit_video:
:path: ".symlinks/plugins/media_kit_video/ios"
+ native_device_orientation:
+ :path: ".symlinks/plugins/native_device_orientation/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
permission_handler_apple:
@@ -221,7 +221,6 @@ SPEC CHECKSUMS:
app_links: a754cbec3c255bd4bbb4d236ecc06f28cd9a7ce8
audio_service: aa99a6ba2ae7565996015322b0bb024e1d25c6fd
audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
- auto_orientation: a1600c9ed72e6e96982fb4e1214463343342432a
battery_plus: b42253f6d2dde71712f8c36fef456d99121c5977
chat_bottom_container: f1eb8323db77a87db50f361142c679f11e892d1b
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
@@ -243,6 +242,7 @@ SPEC CHECKSUMS:
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
media_kit_native_event_loop: 5fba1a849a6c87a34985f1e178a0de5bd444a0cf
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
+ native_device_orientation: e3580675687d5034770da198f6839ebf2122ef94
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
diff --git a/lib/common/widgets/avatars.dart b/lib/common/widgets/avatars.dart
index 933060b272..c49db91af9 100644
--- a/lib/common/widgets/avatars.dart
+++ b/lib/common/widgets/avatars.dart
@@ -5,11 +5,11 @@ import 'package:flutter/material.dart';
Widget avatars({
required ColorScheme colorScheme,
required Iterable users,
+ double gap = 6.0,
}) {
- const gap = 6.0;
const size = 22.0;
const padding = 0.8;
- const offset = size - gap;
+ final offset = size - gap;
const imgSize = size - 2 * padding;
if (users.length == 1) {
return NetworkImgLayer(
diff --git a/lib/common/widgets/floating_navigation_bar.dart b/lib/common/widgets/floating_navigation_bar.dart
new file mode 100644
index 0000000000..267757bd70
--- /dev/null
+++ b/lib/common/widgets/floating_navigation_bar.dart
@@ -0,0 +1,777 @@
+// Copyright 2014 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'package:PiliPlus/utils/extension/theme_ext.dart';
+import 'package:flutter/material.dart';
+
+const double _kMaxLabelTextScaleFactor = 1.3;
+
+const _kNavigationHeight = 64.0;
+const _kIndicatorHeight = _kNavigationHeight - 2 * _kIndicatorPaddingInt;
+const _kIndicatorWidth = 86.0;
+const _kIndicatorPaddingInt = 4.0;
+const _kIndicatorPadding = EdgeInsets.all(_kIndicatorPaddingInt);
+const _kBorderRadius = BorderRadius.all(.circular(_kNavigationHeight / 2));
+const _kNavigationShape = RoundedSuperellipseBorder(
+ borderRadius: _kBorderRadius,
+);
+
+/// ref [NavigationBar]
+class FloatingNavigationBar extends StatelessWidget {
+ // ignore: prefer_const_constructors_in_immutables
+ FloatingNavigationBar({
+ super.key,
+ this.animationDuration = const Duration(milliseconds: 500),
+ this.selectedIndex = 0,
+ required this.destinations,
+ this.onDestinationSelected,
+ this.backgroundColor,
+ this.elevation,
+ this.shadowColor,
+ this.surfaceTintColor,
+ this.indicatorColor,
+ this.indicatorShape,
+ this.labelBehavior,
+ this.overlayColor,
+ this.labelTextStyle,
+ this.labelPadding,
+ this.bottomPadding = 8.0,
+ }) : assert(destinations.length >= 2),
+ assert(0 <= selectedIndex && selectedIndex < destinations.length);
+
+ final Duration animationDuration;
+ final int selectedIndex;
+ final List destinations;
+ final ValueChanged? onDestinationSelected;
+ final Color? backgroundColor;
+ final double? elevation;
+ final Color? shadowColor;
+ final Color? surfaceTintColor;
+ final Color? indicatorColor;
+ final ShapeBorder? indicatorShape;
+ final NavigationDestinationLabelBehavior? labelBehavior;
+ final WidgetStateProperty? overlayColor;
+ final WidgetStateProperty? labelTextStyle;
+ final EdgeInsetsGeometry? labelPadding;
+ final double bottomPadding;
+
+ VoidCallback _handleTap(int index) {
+ return onDestinationSelected != null
+ ? () => onDestinationSelected!(index)
+ : () {};
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final defaults = _NavigationBarDefaultsM3(context);
+
+ final navigationBarTheme = NavigationBarTheme.of(context);
+ final effectiveLabelBehavior =
+ labelBehavior ??
+ navigationBarTheme.labelBehavior ??
+ defaults.labelBehavior!;
+
+ final padding = MediaQuery.viewPaddingOf(context);
+
+ return UnconstrainedBox(
+ child: Padding(
+ padding: .fromLTRB(
+ padding.left,
+ 0,
+ padding.right,
+ bottomPadding + padding.bottom,
+ ),
+ child: SizedBox(
+ height: _kNavigationHeight,
+ width: destinations.length * _kIndicatorWidth,
+ child: DecoratedBox(
+ decoration: ShapeDecoration(
+ color: ElevationOverlay.applySurfaceTint(
+ backgroundColor ??
+ navigationBarTheme.backgroundColor ??
+ defaults.backgroundColor!,
+ surfaceTintColor ??
+ navigationBarTheme.surfaceTintColor ??
+ defaults.surfaceTintColor,
+ elevation ??
+ navigationBarTheme.elevation ??
+ defaults.elevation!,
+ ),
+ shape: RoundedSuperellipseBorder(
+ side: defaults.borderSide,
+ borderRadius: _kBorderRadius,
+ ),
+ ),
+ child: Padding(
+ padding: _kIndicatorPadding,
+ child: Row(
+ crossAxisAlignment: .stretch,
+ children: [
+ for (int i = 0; i < destinations.length; i++)
+ Expanded(
+ child: _SelectableAnimatedBuilder(
+ duration: animationDuration,
+ isSelected: i == selectedIndex,
+ builder: (context, animation) {
+ return _NavigationDestinationInfo(
+ index: i,
+ selectedIndex: selectedIndex,
+ totalNumberOfDestinations: destinations.length,
+ selectedAnimation: animation,
+ labelBehavior: effectiveLabelBehavior,
+ indicatorColor: indicatorColor,
+ indicatorShape: indicatorShape,
+ overlayColor: overlayColor,
+ onTap: _handleTap(i),
+ labelTextStyle: labelTextStyle,
+ labelPadding: labelPadding,
+ child: destinations[i],
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+class FloatingNavigationDestination extends StatelessWidget {
+ const FloatingNavigationDestination({
+ super.key,
+ required this.icon,
+ this.selectedIcon,
+ required this.label,
+ this.tooltip,
+ this.enabled = true,
+ });
+
+ final Widget icon;
+
+ final Widget? selectedIcon;
+
+ final String label;
+
+ final String? tooltip;
+
+ final bool enabled;
+
+ @override
+ Widget build(BuildContext context) {
+ final info = _NavigationDestinationInfo.of(context);
+ const selectedState = {WidgetState.selected};
+ const unselectedState = {};
+ const disabledState = {WidgetState.disabled};
+
+ final navigationBarTheme = NavigationBarTheme.of(context);
+ final defaults = _NavigationBarDefaultsM3(context);
+ final animation = info.selectedAnimation;
+
+ return Stack(
+ alignment: .center,
+ clipBehavior: .none,
+ children: [
+ NavigationIndicator(
+ animation: animation,
+ color:
+ info.indicatorColor ??
+ navigationBarTheme.indicatorColor ??
+ defaults.indicatorColor!,
+ ),
+ _NavigationDestinationBuilder(
+ label: label,
+ tooltip: tooltip,
+ enabled: enabled,
+ buildIcon: (context) {
+ final IconThemeData selectedIconTheme =
+ navigationBarTheme.iconTheme?.resolve(selectedState) ??
+ defaults.iconTheme!.resolve(selectedState)!;
+ final IconThemeData unselectedIconTheme =
+ navigationBarTheme.iconTheme?.resolve(unselectedState) ??
+ defaults.iconTheme!.resolve(unselectedState)!;
+ final IconThemeData disabledIconTheme =
+ navigationBarTheme.iconTheme?.resolve(disabledState) ??
+ defaults.iconTheme!.resolve(disabledState)!;
+
+ final Widget selectedIconWidget = IconTheme.merge(
+ data: enabled ? selectedIconTheme : disabledIconTheme,
+ child: selectedIcon ?? icon,
+ );
+ final Widget unselectedIconWidget = IconTheme.merge(
+ data: enabled ? unselectedIconTheme : disabledIconTheme,
+ child: icon,
+ );
+ return _StatusTransitionWidgetBuilder(
+ animation: animation,
+ builder: (context, child) {
+ return animation.isForwardOrCompleted
+ ? selectedIconWidget
+ : unselectedIconWidget;
+ },
+ );
+ },
+ buildLabel: (context) {
+ final TextStyle? effectiveSelectedLabelTextStyle =
+ info.labelTextStyle?.resolve(selectedState) ??
+ navigationBarTheme.labelTextStyle?.resolve(selectedState) ??
+ defaults.labelTextStyle!.resolve(selectedState);
+ final TextStyle? effectiveUnselectedLabelTextStyle =
+ info.labelTextStyle?.resolve(unselectedState) ??
+ navigationBarTheme.labelTextStyle?.resolve(unselectedState) ??
+ defaults.labelTextStyle!.resolve(unselectedState);
+ final TextStyle? effectiveDisabledLabelTextStyle =
+ info.labelTextStyle?.resolve(disabledState) ??
+ navigationBarTheme.labelTextStyle?.resolve(disabledState) ??
+ defaults.labelTextStyle!.resolve(disabledState);
+ final EdgeInsetsGeometry labelPadding =
+ info.labelPadding ??
+ navigationBarTheme.labelPadding ??
+ defaults.labelPadding!;
+
+ final textStyle = enabled
+ ? animation.isForwardOrCompleted
+ ? effectiveSelectedLabelTextStyle
+ : effectiveUnselectedLabelTextStyle
+ : effectiveDisabledLabelTextStyle;
+
+ return Padding(
+ padding: labelPadding,
+ child: MediaQuery.withClampedTextScaling(
+ maxScaleFactor: _kMaxLabelTextScaleFactor,
+ child: Text(label, style: textStyle),
+ ),
+ );
+ },
+ ),
+ ],
+ );
+ }
+}
+
+class _NavigationDestinationBuilder extends StatefulWidget {
+ const _NavigationDestinationBuilder({
+ required this.buildIcon,
+ required this.buildLabel,
+ required this.label,
+ this.tooltip,
+ this.enabled = true,
+ });
+
+ final WidgetBuilder buildIcon;
+
+ final WidgetBuilder buildLabel;
+
+ final String label;
+
+ final String? tooltip;
+
+ final bool enabled;
+
+ @override
+ State<_NavigationDestinationBuilder> createState() =>
+ _NavigationDestinationBuilderState();
+}
+
+class _NavigationDestinationBuilderState
+ extends State<_NavigationDestinationBuilder> {
+ final GlobalKey iconKey = GlobalKey();
+
+ @override
+ Widget build(BuildContext context) {
+ final info = _NavigationDestinationInfo.of(context);
+
+ final child = GestureDetector(
+ behavior: .opaque,
+ onTap: widget.enabled ? info.onTap : null,
+ child: _NavigationBarDestinationLayout(
+ icon: widget.buildIcon(context),
+ iconKey: iconKey,
+ label: widget.buildLabel(context),
+ ),
+ );
+ if (info.labelBehavior == .alwaysShow) {
+ return child;
+ }
+ return _NavigationBarDestinationTooltip(
+ message: widget.tooltip ?? widget.label,
+ child: child,
+ );
+ }
+}
+
+class _NavigationDestinationInfo extends InheritedWidget {
+ const _NavigationDestinationInfo({
+ required this.index,
+ required this.selectedIndex,
+ required this.totalNumberOfDestinations,
+ required this.selectedAnimation,
+ required this.labelBehavior,
+ required this.indicatorColor,
+ required this.indicatorShape,
+ required this.overlayColor,
+ required this.onTap,
+ this.labelTextStyle,
+ this.labelPadding,
+ required super.child,
+ });
+
+ final int index;
+
+ final int selectedIndex;
+
+ final int totalNumberOfDestinations;
+
+ final Animation selectedAnimation;
+
+ final NavigationDestinationLabelBehavior labelBehavior;
+
+ final Color? indicatorColor;
+
+ final ShapeBorder? indicatorShape;
+
+ final WidgetStateProperty? overlayColor;
+
+ final VoidCallback onTap;
+
+ final WidgetStateProperty? labelTextStyle;
+
+ final EdgeInsetsGeometry? labelPadding;
+
+ static _NavigationDestinationInfo of(BuildContext context) {
+ final _NavigationDestinationInfo? result = context
+ .dependOnInheritedWidgetOfExactType<_NavigationDestinationInfo>();
+ assert(
+ result != null,
+ 'Navigation destinations need a _NavigationDestinationInfo parent, '
+ 'which is usually provided by NavigationBar.',
+ );
+ return result!;
+ }
+
+ @override
+ bool updateShouldNotify(_NavigationDestinationInfo oldWidget) {
+ return index != oldWidget.index ||
+ totalNumberOfDestinations != oldWidget.totalNumberOfDestinations ||
+ selectedAnimation != oldWidget.selectedAnimation ||
+ labelBehavior != oldWidget.labelBehavior ||
+ onTap != oldWidget.onTap;
+ }
+}
+
+class NavigationIndicator extends StatelessWidget {
+ const NavigationIndicator({
+ super.key,
+ required this.animation,
+ this.color,
+ this.width = _kIndicatorWidth,
+ this.height = _kIndicatorHeight,
+ });
+
+ final Animation animation;
+
+ final Color? color;
+
+ final double width;
+
+ final double height;
+
+ static final _anim = Tween(
+ begin: .5,
+ end: 1.0,
+ ).chain(CurveTween(curve: Curves.easeInOutCubicEmphasized));
+
+ @override
+ Widget build(BuildContext context) {
+ return AnimatedBuilder(
+ animation: animation,
+ builder: (context, child) {
+ final double scale = animation.isDismissed
+ ? 0.0
+ : _anim.evaluate(animation);
+
+ return Transform(
+ alignment: Alignment.center,
+ transform: Matrix4.diagonal3Values(scale, 1.0, 1.0),
+ child: child,
+ );
+ },
+
+ child: _StatusTransitionWidgetBuilder(
+ animation: animation,
+ builder: (context, child) {
+ return _SelectableAnimatedBuilder(
+ isSelected: animation.isForwardOrCompleted,
+ duration: const Duration(milliseconds: 100),
+ alwaysDoFullAnimation: true,
+ builder: (context, fadeAnimation) {
+ return FadeTransition(
+ opacity: fadeAnimation,
+ child: DecoratedBox(
+ decoration: ShapeDecoration(
+ shape: _kNavigationShape,
+ color: color ?? Theme.of(context).colorScheme.secondary,
+ ),
+ child: const SizedBox(
+ width: _kIndicatorWidth,
+ height: _kIndicatorHeight,
+ ),
+ ),
+ );
+ },
+ );
+ },
+ ),
+ );
+ }
+}
+
+class _NavigationBarDestinationLayout extends StatelessWidget {
+ const _NavigationBarDestinationLayout({
+ required this.icon,
+ required this.iconKey,
+ required this.label,
+ });
+
+ final Widget icon;
+
+ final GlobalKey iconKey;
+
+ final Widget label;
+
+ @override
+ Widget build(BuildContext context) {
+ return _DestinationLayoutAnimationBuilder(
+ builder: (context, animation) {
+ return CustomMultiChildLayout(
+ delegate: _NavigationDestinationLayoutDelegate(animation: animation),
+ children: [
+ LayoutId(
+ id: _NavigationDestinationLayoutDelegate.iconId,
+ child: KeyedSubtree(key: iconKey, child: icon),
+ ),
+ LayoutId(
+ id: _NavigationDestinationLayoutDelegate.labelId,
+ child: FadeTransition(
+ alwaysIncludeSemantics: true,
+ opacity: animation,
+ child: label,
+ ),
+ ),
+ ],
+ );
+ },
+ );
+ }
+}
+
+class _DestinationLayoutAnimationBuilder extends StatelessWidget {
+ const _DestinationLayoutAnimationBuilder({required this.builder});
+
+ final Widget Function(BuildContext, Animation) builder;
+
+ @override
+ Widget build(BuildContext context) {
+ final info = _NavigationDestinationInfo.of(context);
+ switch (info.labelBehavior) {
+ case NavigationDestinationLabelBehavior.alwaysShow:
+ return builder(context, kAlwaysCompleteAnimation);
+ case NavigationDestinationLabelBehavior.alwaysHide:
+ return builder(context, kAlwaysDismissedAnimation);
+ case NavigationDestinationLabelBehavior.onlyShowSelected:
+ return _CurvedAnimationBuilder(
+ animation: info.selectedAnimation,
+ curve: Curves.easeInOutCubicEmphasized,
+ reverseCurve: Curves.easeInOutCubicEmphasized.flipped,
+ builder: builder,
+ );
+ }
+ }
+}
+
+class _NavigationBarDestinationTooltip extends StatelessWidget {
+ const _NavigationBarDestinationTooltip({
+ required this.message,
+ required this.child,
+ });
+
+ final String message;
+
+ final Widget child;
+
+ @override
+ Widget build(BuildContext context) {
+ return Tooltip(
+ message: message,
+ verticalOffset: 34,
+ excludeFromSemantics: true,
+ preferBelow: false,
+ child: child,
+ );
+ }
+}
+
+class _NavigationDestinationLayoutDelegate extends MultiChildLayoutDelegate {
+ _NavigationDestinationLayoutDelegate({required this.animation})
+ : super(relayout: animation);
+
+ final Animation animation;
+
+ static const int iconId = 1;
+
+ static const int labelId = 2;
+
+ @override
+ void performLayout(Size size) {
+ double halfWidth(Size size) => size.width / 2;
+ double halfHeight(Size size) => size.height / 2;
+
+ final Size iconSize = layoutChild(iconId, BoxConstraints.loose(size));
+ final Size labelSize = layoutChild(labelId, BoxConstraints.loose(size));
+
+ final double yPositionOffset = Tween(
+ begin: halfHeight(iconSize),
+
+ end: halfHeight(iconSize) + halfHeight(labelSize),
+ ).transform(animation.value);
+ final double iconYPosition = halfHeight(size) - yPositionOffset;
+
+ positionChild(
+ iconId,
+ Offset(
+ halfWidth(size) - halfWidth(iconSize),
+ iconYPosition,
+ ),
+ );
+
+ positionChild(
+ labelId,
+ Offset(
+ halfWidth(size) - halfWidth(labelSize),
+
+ iconYPosition + iconSize.height,
+ ),
+ );
+ }
+
+ @override
+ bool shouldRelayout(_NavigationDestinationLayoutDelegate oldDelegate) {
+ return oldDelegate.animation != animation;
+ }
+}
+
+class _StatusTransitionWidgetBuilder extends StatusTransitionWidget {
+ const _StatusTransitionWidgetBuilder({
+ required super.animation,
+ required this.builder,
+ // ignore: unused_element_parameter
+ this.child,
+ });
+
+ final TransitionBuilder builder;
+
+ final Widget? child;
+
+ @override
+ Widget build(BuildContext context) => builder(context, child);
+}
+
+class _SelectableAnimatedBuilder extends StatefulWidget {
+ const _SelectableAnimatedBuilder({
+ required this.isSelected,
+ this.duration = const Duration(milliseconds: 200),
+ this.alwaysDoFullAnimation = false,
+ required this.builder,
+ });
+
+ final bool isSelected;
+
+ final Duration duration;
+
+ final bool alwaysDoFullAnimation;
+
+ final Widget Function(BuildContext, Animation) builder;
+
+ @override
+ _SelectableAnimatedBuilderState createState() =>
+ _SelectableAnimatedBuilderState();
+}
+
+class _SelectableAnimatedBuilderState extends State<_SelectableAnimatedBuilder>
+ with SingleTickerProviderStateMixin {
+ late AnimationController _controller;
+
+ @override
+ void initState() {
+ super.initState();
+ _controller = AnimationController(vsync: this);
+ _controller.duration = widget.duration;
+ _controller.value = widget.isSelected ? 1.0 : 0.0;
+ }
+
+ @override
+ void didUpdateWidget(_SelectableAnimatedBuilder oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (oldWidget.duration != widget.duration) {
+ _controller.duration = widget.duration;
+ }
+ if (oldWidget.isSelected != widget.isSelected) {
+ if (widget.isSelected) {
+ _controller.forward(from: widget.alwaysDoFullAnimation ? 0 : null);
+ } else {
+ _controller.reverse(from: widget.alwaysDoFullAnimation ? 1 : null);
+ }
+ }
+ }
+
+ @override
+ void dispose() {
+ _controller.dispose();
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return widget.builder(context, _controller);
+ }
+}
+
+class _CurvedAnimationBuilder extends StatefulWidget {
+ const _CurvedAnimationBuilder({
+ required this.animation,
+ required this.curve,
+ required this.reverseCurve,
+ required this.builder,
+ });
+
+ final Animation animation;
+ final Curve curve;
+ final Curve reverseCurve;
+ final Widget Function(BuildContext, Animation) builder;
+
+ @override
+ _CurvedAnimationBuilderState createState() => _CurvedAnimationBuilderState();
+}
+
+class _CurvedAnimationBuilderState extends State<_CurvedAnimationBuilder> {
+ late AnimationStatus _animationDirection;
+ AnimationStatus? _preservedDirection;
+
+ @override
+ void initState() {
+ super.initState();
+ _animationDirection = widget.animation.status;
+ _updateStatus(widget.animation.status);
+ widget.animation.addStatusListener(_updateStatus);
+ }
+
+ @override
+ void dispose() {
+ widget.animation.removeStatusListener(_updateStatus);
+ super.dispose();
+ }
+
+ void _updateStatus(AnimationStatus status) {
+ if (_animationDirection != status) {
+ setState(() {
+ _animationDirection = status;
+ });
+ }
+ switch (status) {
+ case AnimationStatus.forward || AnimationStatus.reverse
+ when _preservedDirection != null:
+ break;
+ case AnimationStatus.forward || AnimationStatus.reverse:
+ setState(() {
+ _preservedDirection = status;
+ });
+ case AnimationStatus.completed || AnimationStatus.dismissed:
+ setState(() {
+ _preservedDirection = null;
+ });
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final shouldUseForwardCurve =
+ (_preservedDirection ?? _animationDirection) != AnimationStatus.reverse;
+
+ final Animation curvedAnimation = CurveTween(
+ curve: shouldUseForwardCurve ? widget.curve : widget.reverseCurve,
+ ).animate(widget.animation);
+
+ return widget.builder(context, curvedAnimation);
+ }
+}
+
+const _indicatorDark = Color(0x15FFFFFF);
+const _indicatorLight = Color(0x10000000);
+
+class _NavigationBarDefaultsM3 extends NavigationBarThemeData {
+ _NavigationBarDefaultsM3(this.context)
+ : super(
+ height: _kNavigationHeight,
+ elevation: 3.0,
+ labelBehavior: NavigationDestinationLabelBehavior.alwaysShow,
+ );
+
+ final BuildContext context;
+ late final _colors = Theme.of(context).colorScheme;
+ late final _textTheme = Theme.of(context).textTheme;
+
+ BorderSide get borderSide => _colors.brightness.isDark
+ ? const BorderSide(color: Color(0x08FFFFFF))
+ : const BorderSide(color: Color(0x08000000));
+
+ @override
+ Color? get backgroundColor => _colors.surfaceContainer;
+
+ @override
+ Color? get shadowColor => Colors.transparent;
+
+ @override
+ Color? get surfaceTintColor => Colors.transparent;
+
+ @override
+ WidgetStateProperty? get iconTheme {
+ return WidgetStateProperty.resolveWith((Set states) {
+ return IconThemeData(
+ size: 24.0,
+ color: states.contains(WidgetState.disabled)
+ ? _colors.onSurfaceVariant.withValues(alpha: 0.38)
+ : states.contains(WidgetState.selected)
+ ? _colors.onSecondaryContainer
+ : _colors.onSurfaceVariant,
+ );
+ });
+ }
+
+ @override
+ Color? get indicatorColor =>
+ _colors.brightness.isDark ? _indicatorDark : _indicatorLight;
+
+ @override
+ ShapeBorder? get indicatorShape => const StadiumBorder();
+
+ @override
+ WidgetStateProperty? get labelTextStyle {
+ return WidgetStateProperty.resolveWith((Set states) {
+ final TextStyle style = _textTheme.labelMedium!;
+ return style.apply(
+ color: states.contains(WidgetState.disabled)
+ ? _colors.onSurfaceVariant.withValues(alpha: 0.38)
+ : states.contains(WidgetState.selected)
+ ? _colors.onSurface
+ : _colors.onSurfaceVariant,
+ );
+ });
+ }
+
+ @override
+ EdgeInsetsGeometry? get labelPadding => const EdgeInsets.only(top: 2);
+}
diff --git a/lib/http/api.dart b/lib/http/api.dart
index 903e4e2be2..e98b163cca 100644
--- a/lib/http/api.dart
+++ b/lib/http/api.dart
@@ -830,6 +830,10 @@ abstract final class Api {
static const String dynReserve = '/x/dynamic/feed/reserve/click';
+ static const String spaceReserve = '/x/space/reserve';
+
+ static const String spaceReserveCancel = '/x/space/reserve/cancel';
+
static const String favPugv = '/pugv/app/web/favorite/page';
static const String addFavPugv = '/pugv/app/web/favorite/add';
@@ -997,4 +1001,7 @@ abstract final class Api {
static const String liveMedalWall =
'${HttpString.liveBaseUrl}/xlive/web-ucenter/user/MedalWall';
+
+ static const String memberGuard =
+ '${HttpString.liveBaseUrl}/xlive/app-ucenter/v1/guard/MainGuardCardAll';
}
diff --git a/lib/http/member.dart b/lib/http/member.dart
index df8ae83ce1..6cb0903339 100644
--- a/lib/http/member.dart
+++ b/lib/http/member.dart
@@ -21,6 +21,7 @@ import 'package:PiliPlus/models_new/member/coin_like_arc/data.dart';
import 'package:PiliPlus/models_new/member/search_archive/data.dart';
import 'package:PiliPlus/models_new/member/season_web/data.dart';
import 'package:PiliPlus/models_new/member_card_info/data.dart';
+import 'package:PiliPlus/models_new/member_guard/data.dart';
import 'package:PiliPlus/models_new/space/space/data.dart';
import 'package:PiliPlus/models_new/space/space_archive/data.dart';
import 'package:PiliPlus/models_new/space/space_article/data.dart';
@@ -830,4 +831,23 @@ abstract final class MemberHttp {
return Error(res.data['message']);
}
}
+
+ static Future> memberGuard({
+ required Object ruid,
+ required int page,
+ }) async {
+ final res = await Request().get(
+ Api.memberGuard,
+ queryParameters: {
+ 'page': page,
+ 'page_size': 20,
+ 'ruid': ruid,
+ },
+ );
+ if (res.data['code'] == 0) {
+ return Success(MemberGuardData.fromJson(res.data['data']));
+ } else {
+ return Error(res.data['message']);
+ }
+ }
}
diff --git a/lib/http/user.dart b/lib/http/user.dart
index d8d76743a7..a5110789ca 100644
--- a/lib/http/user.dart
+++ b/lib/http/user.dart
@@ -431,7 +431,9 @@ abstract final class UserHttp {
}
}
- static Future> spaceSettingMod(Map data) async {
+ static Future> spaceSettingMod(
+ Map data,
+ ) async {
final res = await Request().post(
Api.spaceSettingMod,
queryParameters: {
@@ -569,4 +571,23 @@ abstract final class UserHttp {
return Error(res.data['message']);
}
}
+
+ static Future> spaceReserve({
+ required Object sid,
+ required bool isFollow,
+ }) async {
+ final res = await Request().post(
+ isFollow ? Api.spaceReserveCancel : Api.spaceReserve,
+ data: {
+ 'sid': sid,
+ 'csrf': Accounts.main.csrf,
+ },
+ options: Options(contentType: Headers.formUrlEncodedContentType),
+ );
+ if (res.data['code'] == 0) {
+ return const Success(null);
+ } else {
+ return Error(res.data['message']);
+ }
+ }
}
diff --git a/lib/main.dart b/lib/main.dart
index 2cee03f744..b9d566750b 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -9,6 +9,7 @@ import 'package:PiliPlus/common/widgets/scale_app.dart';
import 'package:PiliPlus/common/widgets/scroll_behavior.dart';
import 'package:PiliPlus/http/init.dart';
import 'package:PiliPlus/models/common/theme/theme_color_type.dart';
+import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart';
import 'package:PiliPlus/router/app_pages.dart';
import 'package:PiliPlus/services/account_service.dart';
import 'package:PiliPlus/services/download/download_service.dart';
@@ -28,6 +29,7 @@ import 'package:PiliPlus/utils/storage_pref.dart';
import 'package:PiliPlus/utils/theme_utils.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:catcher_2/catcher_2.dart';
+import 'package:device_info_plus/device_info_plus.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@@ -82,6 +84,10 @@ Future _initAppPath() async {
appSupportDirPath = (await getApplicationSupportDirectory()).path;
}
+Future _initSdkInt() async {
+ Utils.sdkInt = (await DeviceInfoPlugin().androidInfo).version.sdkInt;
+}
+
void main() async {
ScaledWidgetsFlutterBinding.ensureInitialized();
MediaKit.ensureInitialized();
@@ -104,15 +110,8 @@ void main() async {
if (PlatformUtils.isMobile) {
await Future.wait([
- SystemChrome.setPreferredOrientations(
- [
- DeviceOrientation.portraitUp,
- if (Pref.horizontalScreen) ...[
- DeviceOrientation.landscapeLeft,
- DeviceOrientation.landscapeRight,
- ],
- ],
- ),
+ if (Platform.isAndroid) _initSdkInt(),
+ if (Pref.horizontalScreen) ?fullMode() else ?portraitUpMode(),
setupServiceLocator(),
]);
} else if (Platform.isWindows) {
@@ -131,12 +130,10 @@ void main() async {
Request.setCookie();
RequestUtils.syncHistoryStatus();
- SmartDialog.config.toast = SmartConfigToast(
- displayType: SmartToastType.onlyRefresh,
- );
+ SmartDialog.config.toast = SmartConfigToast(displayType: .onlyRefresh);
if (PlatformUtils.isMobile) {
- SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
+ SystemChrome.setEnabledSystemUIMode(.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
systemNavigationBarColor: Colors.transparent,
diff --git a/lib/models/common/account_type.dart b/lib/models/common/account_type.dart
index 475f9917ab..ddd81b5e23 100644
--- a/lib/models/common/account_type.dart
+++ b/lib/models/common/account_type.dart
@@ -2,7 +2,7 @@ enum AccountType {
main('主账号'),
heartbeat('记录观看'),
recommend('推荐'),
- video('视频取流')
+ video('视频取流'),
;
final String title;
diff --git a/lib/models/common/audio_normalization.dart b/lib/models/common/audio_normalization.dart
index e81bd72e63..79ea9f648c 100644
--- a/lib/models/common/audio_normalization.dart
+++ b/lib/models/common/audio_normalization.dart
@@ -3,7 +3,7 @@ enum AudioNormalization {
// ref https://github.com/KRTirtho/spotube/commit/da10ab2e291d4ba4d3082b9a6ae535639fb8f1b7
dynaudnorm('预设 dynaudnorm', 'dynaudnorm=g=5:f=250:r=0.9:p=0.5'),
loudnorm('预设 loudnorm', 'loudnorm=I=-16:LRA=11:TP=-1.5'),
- custom('自定义参数')
+ custom('自定义参数'),
;
final String title;
diff --git a/lib/models/common/avatar_badge_type.dart b/lib/models/common/avatar_badge_type.dart
index 7baecf179d..bb5432eb84 100644
--- a/lib/models/common/avatar_badge_type.dart
+++ b/lib/models/common/avatar_badge_type.dart
@@ -4,7 +4,7 @@ enum BadgeType {
none(),
vip('大会员'),
person('认证个人', Color(0xFFFFCC00)),
- institution('认证机构', Colors.lightBlueAccent)
+ institution('认证机构', Colors.lightBlueAccent),
;
final String? desc;
diff --git a/lib/models/common/bar_hide_type.dart b/lib/models/common/bar_hide_type.dart
index 243083928e..db9fffed46 100644
--- a/lib/models/common/bar_hide_type.dart
+++ b/lib/models/common/bar_hide_type.dart
@@ -2,7 +2,7 @@ import 'package:PiliPlus/models/common/enum_with_label.dart';
enum BarHideType with EnumWithLabel {
instant('即时'),
- sync('同步')
+ sync('同步'),
;
@override
diff --git a/lib/models/common/dm_block_type.dart b/lib/models/common/dm_block_type.dart
index 53adb78dcb..cee31e94bd 100644
--- a/lib/models/common/dm_block_type.dart
+++ b/lib/models/common/dm_block_type.dart
@@ -1,7 +1,7 @@
enum DmBlockType {
keyword('关键词'),
regex('正则'),
- uid('用户')
+ uid('用户'),
;
final String label;
diff --git a/lib/models/common/dynamic/dynamic_badge_mode.dart b/lib/models/common/dynamic/dynamic_badge_mode.dart
index 2beabe1bc1..9ce018d6b9 100644
--- a/lib/models/common/dynamic/dynamic_badge_mode.dart
+++ b/lib/models/common/dynamic/dynamic_badge_mode.dart
@@ -1,7 +1,7 @@
enum DynamicBadgeMode {
hidden('隐藏'),
point('红点'),
- number('数字')
+ number('数字'),
;
final String desc;
diff --git a/lib/models/common/dynamic/dynamics_type.dart b/lib/models/common/dynamic/dynamics_type.dart
index 7065cb0dc0..a2c3974228 100644
--- a/lib/models/common/dynamic/dynamics_type.dart
+++ b/lib/models/common/dynamic/dynamics_type.dart
@@ -3,7 +3,7 @@ enum DynamicsTabType {
video('投稿'),
pgc('番剧'),
article('专栏'),
- up('UP')
+ up('UP'),
;
final String label;
diff --git a/lib/models/common/dynamic/up_panel_position.dart b/lib/models/common/dynamic/up_panel_position.dart
index 0fc276cf54..d7697e7819 100644
--- a/lib/models/common/dynamic/up_panel_position.dart
+++ b/lib/models/common/dynamic/up_panel_position.dart
@@ -3,7 +3,7 @@ enum UpPanelPosition {
leftFixed('左侧常驻'),
rightFixed('右侧常驻'),
leftDrawer('左侧抽屉'),
- rightDrawer('右侧抽屉')
+ rightDrawer('右侧抽屉'),
;
final String label;
diff --git a/lib/models/common/episode_panel_type.dart b/lib/models/common/episode_panel_type.dart
index da6135452c..d19cfe5479 100644
--- a/lib/models/common/episode_panel_type.dart
+++ b/lib/models/common/episode_panel_type.dart
@@ -1,7 +1,7 @@
enum EpisodeType {
part('分P'),
season('合集'),
- pgc('剧集')
+ pgc('剧集'),
;
final String title;
diff --git a/lib/models/common/fav_order_type.dart b/lib/models/common/fav_order_type.dart
index 1c1e639071..e6f7b4d648 100644
--- a/lib/models/common/fav_order_type.dart
+++ b/lib/models/common/fav_order_type.dart
@@ -1,7 +1,7 @@
enum FavOrderType {
mtime('最近收藏'),
view('最多播放'),
- pubtime('最近投稿')
+ pubtime('最近投稿'),
;
final String label;
diff --git a/lib/models/common/fav_type.dart b/lib/models/common/fav_type.dart
index 7d4aebfc31..b0f03f0a11 100644
--- a/lib/models/common/fav_type.dart
+++ b/lib/models/common/fav_type.dart
@@ -13,7 +13,7 @@ enum FavTabType {
article('专栏', FavArticlePage()),
note('笔记', FavNotePage()),
topic('话题', FavTopicPage()),
- cheese('课堂', FavCheesePage())
+ cheese('课堂', FavCheesePage()),
;
final String title;
diff --git a/lib/models/common/follow_order_type.dart b/lib/models/common/follow_order_type.dart
index 0af6718fd9..bcaae6e546 100644
--- a/lib/models/common/follow_order_type.dart
+++ b/lib/models/common/follow_order_type.dart
@@ -1,6 +1,6 @@
enum FollowOrderType {
def('', '最近关注'),
- attention('attention', '最常访问')
+ attention('attention', '最常访问'),
;
final String type;
diff --git a/lib/models/common/home_tab_type.dart b/lib/models/common/home_tab_type.dart
index e168616e77..5f124ddcdf 100644
--- a/lib/models/common/home_tab_type.dart
+++ b/lib/models/common/home_tab_type.dart
@@ -19,7 +19,7 @@ enum HomeTabType implements EnumWithLabel {
hot('热门'),
rank('分区'),
bangumi('番剧'),
- cinema('影视')
+ cinema('影视'),
;
@override
diff --git a/lib/models/common/later_view_type.dart b/lib/models/common/later_view_type.dart
index 1012e12225..bcd7be2fa6 100644
--- a/lib/models/common/later_view_type.dart
+++ b/lib/models/common/later_view_type.dart
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
enum LaterViewType {
all(0, '全部'),
// toView(1, '未看'),
- unfinished(2, '未看完')
+ unfinished(2, '未看完'),
// viewed(3, '已看完'),
;
diff --git a/lib/models/common/live/live_contribution_rank_type.dart b/lib/models/common/live/live_contribution_rank_type.dart
index 0a688eb109..ad5a40a8ce 100644
--- a/lib/models/common/live/live_contribution_rank_type.dart
+++ b/lib/models/common/live/live_contribution_rank_type.dart
@@ -4,7 +4,7 @@ enum LiveContributionRankType {
online_rank('在线榜', 'contribution_rank'),
daily_rank('日榜', 'today_rank'),
weekly_rank('周榜', 'current_week_rank'),
- monthly_rank('月榜', 'current_month_rank')
+ monthly_rank('月榜', 'current_month_rank'),
;
final String title;
diff --git a/lib/models/common/member/contribute_type.dart b/lib/models/common/member/contribute_type.dart
index e0076673a5..e00eb49ea7 100644
--- a/lib/models/common/member/contribute_type.dart
+++ b/lib/models/common/member/contribute_type.dart
@@ -6,7 +6,7 @@ enum ContributeType {
season(Api.spaceSeason),
series(Api.spaceSeries),
bangumi(Api.spaceBangumi),
- comic(Api.spaceComic)
+ comic(Api.spaceComic),
;
final String api;
diff --git a/lib/models/common/member/tab_type.dart b/lib/models/common/member/tab_type.dart
index 7cb96a4fd1..688e73c78e 100644
--- a/lib/models/common/member/tab_type.dart
+++ b/lib/models/common/member/tab_type.dart
@@ -8,7 +8,7 @@ enum MemberTabType {
favorite('收藏'),
bangumi('番剧'),
cheese('课堂'),
- shop('小店')
+ shop('小店'),
;
static bool showMemberShop = Pref.showMemberShop;
diff --git a/lib/models/common/msg/msg_unread_type.dart b/lib/models/common/msg/msg_unread_type.dart
index d0c88fe2ad..3c05e4f573 100644
--- a/lib/models/common/msg/msg_unread_type.dart
+++ b/lib/models/common/msg/msg_unread_type.dart
@@ -3,7 +3,7 @@ enum MsgUnReadType {
reply('回复我的'),
at('@我'),
like('收到的赞'),
- sysMsg('系统通知')
+ sysMsg('系统通知'),
;
final String title;
diff --git a/lib/models/common/nav_bar_config.dart b/lib/models/common/nav_bar_config.dart
index 920374458a..75db67df5b 100644
--- a/lib/models/common/nav_bar_config.dart
+++ b/lib/models/common/nav_bar_config.dart
@@ -7,8 +7,8 @@ import 'package:flutter/material.dart';
enum NavigationBarType implements EnumWithLabel {
home(
'首页',
- Icon(Icons.home_outlined, size: 23),
- Icon(Icons.home, size: 21),
+ Icon(Icons.home_outlined, size: 24),
+ Icon(Icons.home, size: 24),
HomePage(),
),
dynamics(
@@ -19,10 +19,10 @@ enum NavigationBarType implements EnumWithLabel {
),
mine(
'我的',
- Icon(Icons.person_outline, size: 21),
- Icon(Icons.person, size: 21),
+ Icon(Icons.person_outline, size: 24),
+ Icon(Icons.person, size: 24),
MinePage(),
- )
+ ),
;
@override
diff --git a/lib/models/common/pgc_review_type.dart b/lib/models/common/pgc_review_type.dart
index 4c9f6e63ed..c99e50bb54 100644
--- a/lib/models/common/pgc_review_type.dart
+++ b/lib/models/common/pgc_review_type.dart
@@ -2,7 +2,7 @@ import 'package:PiliPlus/http/api.dart';
enum PgcReviewType {
long(label: '长评', api: Api.pgcReviewL),
- short(label: '短评', api: Api.pgcReviewS)
+ short(label: '短评', api: Api.pgcReviewS),
;
final String label;
@@ -15,7 +15,7 @@ enum PgcReviewType {
enum PgcReviewSortType {
def('默认', 0),
- latest('最新', 1)
+ latest('最新', 1),
;
final int sort;
diff --git a/lib/models/common/rank_type.dart b/lib/models/common/rank_type.dart
index 73fd8a1764..c5fd54cb8c 100644
--- a/lib/models/common/rank_type.dart
+++ b/lib/models/common/rank_type.dart
@@ -19,7 +19,7 @@ enum RankType {
documentary('记录', seasonType: 3),
movie('电影', seasonType: 2),
tv('剧集', seasonType: 5),
- variety('综艺', seasonType: 7)
+ variety('综艺', seasonType: 7),
;
final String label;
diff --git a/lib/models/common/reply/reply_option_type.dart b/lib/models/common/reply/reply_option_type.dart
index 122231f536..b5ef8da746 100644
--- a/lib/models/common/reply/reply_option_type.dart
+++ b/lib/models/common/reply/reply_option_type.dart
@@ -4,7 +4,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
enum ReplyOptionType {
allow('允许评论'),
close('关闭评论'),
- choose('精选评论')
+ choose('精选评论'),
;
final String title;
diff --git a/lib/models/common/reply/reply_sort_type.dart b/lib/models/common/reply/reply_sort_type.dart
index 30612175f9..74c4509a88 100644
--- a/lib/models/common/reply/reply_sort_type.dart
+++ b/lib/models/common/reply/reply_sort_type.dart
@@ -1,7 +1,7 @@
enum ReplySortType {
time('最新评论', '最新'),
hot('最热评论', '最热'),
- select('精选评论', '精选')
+ select('精选评论', '精选'),
;
final String title;
diff --git a/lib/models/common/search/article_search_type.dart b/lib/models/common/search/article_search_type.dart
index 29f8273e95..3a5f790772 100644
--- a/lib/models/common/search/article_search_type.dart
+++ b/lib/models/common/search/article_search_type.dart
@@ -3,7 +3,7 @@ enum ArticleOrderType {
pubdate('最新发布'),
click('最多点击'),
attention('最多喜欢'),
- scores('最多评论')
+ scores('最多评论'),
;
String get order => name;
@@ -20,7 +20,7 @@ enum ArticleZoneType {
interest('兴趣', 29),
novel('轻小说', 16),
tech('科技', 17),
- note('笔记', 41)
+ note('笔记', 41),
;
final String label;
diff --git a/lib/models/common/search/search_type.dart b/lib/models/common/search/search_type.dart
index 72d91f73cd..d56382bd6e 100644
--- a/lib/models/common/search/search_type.dart
+++ b/lib/models/common/search/search_type.dart
@@ -18,7 +18,7 @@ enum SearchType {
// 用户:bili_user
bili_user('用户'),
// 专栏:article
- article('专栏')
+ article('专栏'),
;
// 相簿:photo
// photo
diff --git a/lib/models/common/search/user_search_type.dart b/lib/models/common/search/user_search_type.dart
index 28a03045d0..d30c42e816 100644
--- a/lib/models/common/search/user_search_type.dart
+++ b/lib/models/common/search/user_search_type.dart
@@ -3,7 +3,7 @@ enum UserOrderType {
fansDesc('粉丝数由高到低', 0, 'fans'),
fansAsc('粉丝数由低到高', 1, 'fans'),
levelDesc('Lv等级由高到低', 0, 'level'),
- levelAsc('Lv等级由低到高', 1, 'level')
+ levelAsc('Lv等级由低到高', 1, 'level'),
;
final String label;
@@ -16,7 +16,7 @@ enum UserType {
all('全部用户'),
up('UP主'),
common('普通用户'),
- verified('认证用户')
+ verified('认证用户'),
;
final String label;
diff --git a/lib/models/common/search/video_search_type.dart b/lib/models/common/search/video_search_type.dart
index bee53bbf04..b166369122 100644
--- a/lib/models/common/search/video_search_type.dart
+++ b/lib/models/common/search/video_search_type.dart
@@ -2,7 +2,7 @@ enum VideoPubTimeType {
all('不限'),
day('最近一天'),
week('最近一周'),
- halfYear('最近半年')
+ halfYear('最近半年'),
;
final String label;
@@ -14,7 +14,7 @@ enum VideoDurationType {
tenMins('0-10分钟'),
halfHour('10-30分钟'),
hour('30-60分钟'),
- hourPlus('60分钟+')
+ hourPlus('60分钟+'),
;
final String label;
@@ -43,7 +43,7 @@ enum VideoZoneType {
cinephile('影视', tids: 181),
documentary('记录', tids: 177),
movie('电影', tids: 23),
- tv('电视', tids: 11)
+ tv('电视', tids: 11),
;
final String label;
@@ -58,7 +58,7 @@ enum ArchiveFilterType {
pubdate('新发布'),
dm('弹幕多'),
stow('收藏多'),
- scores('评论多')
+ scores('评论多'),
;
// 专栏
// attention('最多喜欢'),
diff --git a/lib/models/common/setting_type.dart b/lib/models/common/setting_type.dart
index 882e3b2112..366623f60f 100644
--- a/lib/models/common/setting_type.dart
+++ b/lib/models/common/setting_type.dart
@@ -6,7 +6,7 @@ enum SettingType {
styleSetting('外观设置'),
extraSetting('其它设置'),
webdavSetting('WebDAV 设置'),
- about('关于')
+ about('关于'),
;
final String title;
diff --git a/lib/models/common/sponsor_block/action_type.dart b/lib/models/common/sponsor_block/action_type.dart
index 5efd5d5c6d..6a73a1337a 100644
--- a/lib/models/common/sponsor_block/action_type.dart
+++ b/lib/models/common/sponsor_block/action_type.dart
@@ -2,7 +2,7 @@ enum ActionType {
skip('跳过'),
mute('静音'),
full('整个视频'),
- poi('精彩时刻')
+ poi('精彩时刻'),
;
final String title;
diff --git a/lib/models/common/sponsor_block/skip_type.dart b/lib/models/common/sponsor_block/skip_type.dart
index 63616264a7..cbbcb5320d 100644
--- a/lib/models/common/sponsor_block/skip_type.dart
+++ b/lib/models/common/sponsor_block/skip_type.dart
@@ -5,7 +5,7 @@ enum SkipType implements EnumWithLabel {
skipOnce('跳过一次'),
skipManually('手动跳过'),
showOnly('仅显示'),
- disable('禁用')
+ disable('禁用'),
;
@override
diff --git a/lib/models/common/stat_type.dart b/lib/models/common/stat_type.dart
index c7a7eb9bc1..dbab936940 100644
--- a/lib/models/common/stat_type.dart
+++ b/lib/models/common/stat_type.dart
@@ -7,7 +7,7 @@ enum StatType {
reply(Icons.comment_outlined, '评论'),
follow(Icons.favorite_border, '关注'),
play(Icons.play_circle_outlined, '播放'),
- listen(Icons.headset_outlined, '播放')
+ listen(Icons.headset_outlined, '播放'),
;
final IconData iconData;
diff --git a/lib/models/common/super_resolution_type.dart b/lib/models/common/super_resolution_type.dart
index 0ca532fc03..792ac9f8d5 100644
--- a/lib/models/common/super_resolution_type.dart
+++ b/lib/models/common/super_resolution_type.dart
@@ -3,7 +3,7 @@ import 'package:PiliPlus/models/common/enum_with_label.dart';
enum SuperResolutionType with EnumWithLabel {
disable('禁用'),
efficiency('效率'),
- quality('画质')
+ quality('画质'),
;
@override
diff --git a/lib/models/common/theme/theme_type.dart b/lib/models/common/theme/theme_type.dart
index e3aefe1de6..751695bfd8 100644
--- a/lib/models/common/theme/theme_type.dart
+++ b/lib/models/common/theme/theme_type.dart
@@ -4,7 +4,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
enum ThemeType {
light('浅色'),
dark('深色'),
- system('跟随系统')
+ system('跟随系统'),
;
final String desc;
diff --git a/lib/models/common/video/audio_quality.dart b/lib/models/common/video/audio_quality.dart
index f15f5f898c..c721ea6b33 100644
--- a/lib/models/common/video/audio_quality.dart
+++ b/lib/models/common/video/audio_quality.dart
@@ -7,7 +7,7 @@ enum AudioQuality {
dolby_30255(30255, '杜比全景声'),
k192(30280, '192K'),
k132(30232, '132K'),
- k64(30216, '64K')
+ k64(30216, '64K'),
;
final int code;
diff --git a/lib/models/common/video/cdn_type.dart b/lib/models/common/video/cdn_type.dart
index 55326f9e98..8c8fe08201 100644
--- a/lib/models/common/video/cdn_type.dart
+++ b/lib/models/common/video/cdn_type.dart
@@ -24,7 +24,7 @@ enum CDNService {
aliov('aliov(阿里云海外)', 'upos-sz-mirroraliov.bilivideo.com'),
cosov('cosov(腾讯云海外)', 'upos-sz-mirrorcosov.bilivideo.com'),
hwov('hwov(华为云海外)', 'upos-sz-mirrorhwov.bilivideo.com'),
- hk_bcache('hk_bcache(Bilibili海外)', 'cn-hk-eq-bcache-01.bilivideo.com')
+ hk_bcache('hk_bcache(Bilibili海外)', 'cn-hk-eq-bcache-01.bilivideo.com'),
;
final String desc;
diff --git a/lib/models/common/video/live_quality.dart b/lib/models/common/video/live_quality.dart
index bdcbfdef94..046c566160 100644
--- a/lib/models/common/video/live_quality.dart
+++ b/lib/models/common/video/live_quality.dart
@@ -7,7 +7,7 @@ enum LiveQuality {
bluRay(400, '蓝光'),
superHD(250, '超清'),
smooth(150, '高清'),
- flunt(80, '流畅')
+ flunt(80, '流畅'),
;
final int code;
diff --git a/lib/models/common/video/source_type.dart b/lib/models/common/video/source_type.dart
index 19d9a77ad6..dea3e5268a 100644
--- a/lib/models/common/video/source_type.dart
+++ b/lib/models/common/video/source_type.dart
@@ -26,7 +26,7 @@ enum SourceType {
extraId: 4,
playlistSource: PlaylistSource.MEDIA_LIST,
),
- file
+ file,
;
final int? mediaType;
diff --git a/lib/models/common/video/subtitle_pref_type.dart b/lib/models/common/video/subtitle_pref_type.dart
index 3fc75216be..265cdb08bb 100644
--- a/lib/models/common/video/subtitle_pref_type.dart
+++ b/lib/models/common/video/subtitle_pref_type.dart
@@ -2,7 +2,7 @@ enum SubtitlePrefType {
off('默认不显示字幕'),
on('优先选择非自动生成(ai)字幕'),
withoutAi('跳过自动生成(ai)字幕,选择第一个可用字幕'),
- auto('静音时等同第二项,非静音时等同第三项')
+ auto('静音时等同第二项,非静音时等同第三项'),
;
final String desc;
diff --git a/lib/models/common/video/video_decode_type.dart b/lib/models/common/video/video_decode_type.dart
index f2f57d55a5..f17ec8c67b 100644
--- a/lib/models/common/video/video_decode_type.dart
+++ b/lib/models/common/video/video_decode_type.dart
@@ -4,7 +4,7 @@ enum VideoDecodeFormatType {
DVH1(['dvh1']),
AV1(['av01']),
HEVC(['hev1', 'hvc1']),
- AVC(['avc1'])
+ AVC(['avc1']),
;
String get description => name;
diff --git a/lib/models/common/video/video_quality.dart b/lib/models/common/video/video_quality.dart
index bd91f362e5..98329bde23 100644
--- a/lib/models/common/video/video_quality.dart
+++ b/lib/models/common/video/video_quality.dart
@@ -11,7 +11,7 @@ enum VideoQuality {
high720(64, '720P 准高清', '720P'),
clear480(32, '480P 标清', '480P'),
fluent360(16, '360P 流畅', '360P'),
- speed240(6, '240P 极速', '240P')
+ speed240(6, '240P 极速', '240P'),
;
final int code;
diff --git a/lib/models/common/video/video_type.dart b/lib/models/common/video/video_type.dart
index d564769708..f5306f0599 100644
--- a/lib/models/common/video/video_type.dart
+++ b/lib/models/common/video/video_type.dart
@@ -13,7 +13,7 @@ enum VideoType {
type: 10,
replyType: 33,
api: Api.pugvUrl,
- )
+ ),
;
final int type;
diff --git a/lib/models/common/webview_menu_type.dart b/lib/models/common/webview_menu_type.dart
index 4758938e92..8fd0a042f0 100644
--- a/lib/models/common/webview_menu_type.dart
+++ b/lib/models/common/webview_menu_type.dart
@@ -4,7 +4,7 @@ enum WebviewMenuItem {
openInBrowser('浏览器中打开'),
clearCache('清除缓存'),
resetCookie('重新设置Cookie'),
- goBack('返回')
+ goBack('返回'),
;
final String title;
diff --git a/lib/models_new/account_myinfo/data.dart b/lib/models_new/account_myinfo/data.dart
index 557338548c..6e5a77a81b 100644
--- a/lib/models_new/account_myinfo/data.dart
+++ b/lib/models_new/account_myinfo/data.dart
@@ -5,19 +5,7 @@ class AccountMyInfoData {
num? coins;
String? birthday;
String? face;
- int? faceNftNew;
int? sex;
- int? level;
- int? rank;
- int? silence;
- int? emailStatus;
- int? telStatus;
- int? identification;
- int? isTourist;
- int? pinPrompting;
- int? inRegAudit;
- bool? hasFaceNft;
- bool? setBirthday;
AccountMyInfoData({
this.mid,
@@ -26,19 +14,7 @@ class AccountMyInfoData {
this.coins,
this.birthday,
this.face,
- this.faceNftNew,
this.sex,
- this.level,
- this.rank,
- this.silence,
- this.emailStatus,
- this.telStatus,
- this.identification,
- this.isTourist,
- this.pinPrompting,
- this.inRegAudit,
- this.hasFaceNft,
- this.setBirthday,
});
factory AccountMyInfoData.fromJson(Map json) =>
@@ -49,18 +25,6 @@ class AccountMyInfoData {
coins: json['coins'] as num?,
birthday: json['birthday'] as String?,
face: json['face'] as String?,
- faceNftNew: json['face_nft_new'] as int?,
sex: json['sex'] as int?,
- level: json['level'] as int?,
- rank: json['rank'] as int?,
- silence: json['silence'] as int?,
- emailStatus: json['email_status'] as int?,
- telStatus: json['tel_status'] as int?,
- identification: json['identification'] as int?,
- isTourist: json['is_tourist'] as int?,
- pinPrompting: json['pin_prompting'] as int?,
- inRegAudit: json['in_reg_audit'] as int?,
- hasFaceNft: json['has_face_nft'] as bool?,
- setBirthday: json['set_birthday'] as bool?,
);
}
diff --git a/lib/models_new/article/article_info/data.dart b/lib/models_new/article/article_info/data.dart
index 5f74a4b76c..232a7b0287 100644
--- a/lib/models_new/article/article_info/data.dart
+++ b/lib/models_new/article/article_info/data.dart
@@ -1,86 +1,26 @@
-import 'package:PiliPlus/models_new/article/article_info/share_channel.dart';
import 'package:PiliPlus/models_new/article/article_info/stats.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class ArticleInfoData {
- int? like;
- bool? attention;
bool? favorite;
- num? coin;
Stats? stats;
String? title;
- String? bannerUrl;
- int? mid;
- String? authorName;
- bool? isAuthor;
- List? imageUrls;
List? originImageUrls;
- bool? shareable;
- bool? showLaterWatch;
- bool? showSmallWindow;
- bool? inList;
- int? pre;
- int? next;
- List? shareChannels;
- int? type;
- String? videoUrl;
- String? location;
- bool? disableShare;
ArticleInfoData({
- this.like,
- this.attention,
this.favorite,
- this.coin,
this.stats,
this.title,
- this.bannerUrl,
- this.mid,
- this.authorName,
- this.isAuthor,
- this.imageUrls,
this.originImageUrls,
- this.shareable,
- this.showLaterWatch,
- this.showSmallWindow,
- this.inList,
- this.pre,
- this.next,
- this.shareChannels,
- this.type,
- this.videoUrl,
- this.location,
- this.disableShare,
});
factory ArticleInfoData.fromJson(Map json) =>
ArticleInfoData(
- like: json['like'] as int?,
- attention: json['attention'] as bool?,
favorite: json['favorite'] as bool?,
- coin: json['coin'] as num?,
stats: json['stats'] == null
? null
: Stats.fromJson(json['stats'] as Map),
title: json['title'] as String?,
- bannerUrl: json['banner_url'] as String?,
- mid: json['mid'] as int?,
- authorName: json['author_name'] as String?,
- isAuthor: json['is_author'] as bool?,
- imageUrls: (json['image_urls'] as List?)?.fromCast(),
originImageUrls: (json['origin_image_urls'] as List?)?.fromCast(),
- shareable: json['shareable'] as bool?,
- showLaterWatch: json['show_later_watch'] as bool?,
- showSmallWindow: json['show_small_window'] as bool?,
- inList: json['in_list'] as bool?,
- pre: json['pre'] as int?,
- next: json['next'] as int?,
- shareChannels: (json['share_channels'] as List?)
- ?.map((e) => ShareChannel.fromJson(e as Map))
- .toList(),
- type: json['type'] as int?,
- videoUrl: json['video_url'] as String?,
- location: json['location'] as String?,
- disableShare: json['disable_share'] as bool?,
);
}
diff --git a/lib/models_new/article/article_info/share_channel.dart b/lib/models_new/article/article_info/share_channel.dart
deleted file mode 100644
index 5eb5eab04d..0000000000
--- a/lib/models_new/article/article_info/share_channel.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class ShareChannel {
- String? name;
- String? picture;
- String? shareChannel;
-
- ShareChannel({this.name, this.picture, this.shareChannel});
-
- factory ShareChannel.fromJson(Map json) => ShareChannel(
- name: json['name'] as String?,
- picture: json['picture'] as String?,
- shareChannel: json['share_channel'] as String?,
- );
-}
diff --git a/lib/models_new/article/article_info/stats.dart b/lib/models_new/article/article_info/stats.dart
index 590b8c79a7..5a00717a31 100644
--- a/lib/models_new/article/article_info/stats.dart
+++ b/lib/models_new/article/article_info/stats.dart
@@ -1,32 +1,20 @@
class Stats {
- int? view;
int? favorite;
int? like;
- int? dislike;
int? reply;
int? share;
- num? coin;
- int? dynam1c;
Stats({
- this.view,
this.favorite,
this.like,
- this.dislike,
this.reply,
this.share,
- this.coin,
- this.dynam1c,
});
factory Stats.fromJson(Map json) => Stats(
- view: json['view'] as int?,
favorite: json['favorite'] as int?,
like: json['like'] as int?,
- dislike: json['dislike'] as int?,
reply: json['reply'] as int?,
share: json['share'] as int?,
- coin: json['coin'] as num?,
- dynam1c: json['dynamic'] as int?,
);
}
diff --git a/lib/models_new/article/article_list/article.dart b/lib/models_new/article/article_list/article.dart
index 7767a3c6dd..e50777222a 100644
--- a/lib/models_new/article/article_list/article.dart
+++ b/lib/models_new/article/article_list/article.dart
@@ -1,67 +1,32 @@
-import 'package:PiliPlus/models_new/article/article_list/category.dart';
import 'package:PiliPlus/models_new/article/article_list/stats.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class ArticleListItemModel {
int? id;
String? title;
- int? state;
- int? publishTime;
- int? words;
List? imageUrls;
- Category? category;
- List? categories;
String? summary;
- int? type;
String? dynIdStr;
- int? attributes;
- int? authorUid;
- int? onlyFans;
Stats? stats;
- int? likeState;
ArticleListItemModel({
this.id,
this.title,
- this.state,
- this.publishTime,
- this.words,
this.imageUrls,
- this.category,
- this.categories,
this.summary,
- this.type,
this.dynIdStr,
- this.attributes,
- this.authorUid,
- this.onlyFans,
this.stats,
- this.likeState,
});
factory ArticleListItemModel.fromJson(Map json) =>
ArticleListItemModel(
id: json['id'] as int?,
title: json['title'] as String?,
- state: json['state'] as int?,
- publishTime: json['publish_time'] as int?,
- words: json['words'] as int?,
imageUrls: (json['image_urls'] as List?)?.fromCast(),
- category: json['category'] == null
- ? null
- : Category.fromJson(json['category'] as Map),
- categories: (json['categories'] as List?)
- ?.map((e) => Category.fromJson(e as Map))
- .toList(),
summary: json['summary'] as String?,
- type: json['type'] as int?,
dynIdStr: json['dyn_id_str'] as String?,
- attributes: json['attributes'] as int?,
- authorUid: json['author_uid'] as int?,
- onlyFans: json['only_fans'] as int?,
stats: json['stats'] == null
? null
: Stats.fromJson(json['stats'] as Map),
- likeState: json['like_state'] as int?,
);
}
diff --git a/lib/models_new/article/article_list/category.dart b/lib/models_new/article/article_list/category.dart
deleted file mode 100644
index 7b202e7013..0000000000
--- a/lib/models_new/article/article_list/category.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class Category {
- int? id;
- int? parentId;
- String? name;
-
- Category({this.id, this.parentId, this.name});
-
- factory Category.fromJson(Map json) => Category(
- id: json['id'] as int?,
- parentId: json['parent_id'] as int?,
- name: json['name'] as String?,
- );
-}
diff --git a/lib/models_new/article/article_list/data.dart b/lib/models_new/article/article_list/data.dart
index a9435b52f0..5fd09fb145 100644
--- a/lib/models_new/article/article_list/data.dart
+++ b/lib/models_new/article/article_list/data.dart
@@ -1,21 +1,16 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/article/article_list/article.dart';
-import 'package:PiliPlus/models_new/article/article_list/last.dart';
import 'package:PiliPlus/models_new/article/article_list/list.dart';
class ArticleListData {
ArticleListInfo? list;
List? articles;
Owner? author;
- Last? last;
- bool? attention;
ArticleListData({
this.list,
this.articles,
this.author,
- this.last,
- this.attention,
});
factory ArticleListData.fromJson(Map json) =>
@@ -31,9 +26,5 @@ class ArticleListData {
author: json['author'] == null
? null
: Owner.fromJson(json['author'] as Map),
- last: json['last'] == null
- ? null
- : Last.fromJson(json['last'] as Map),
- attention: json['attention'] as bool?,
);
}
diff --git a/lib/models_new/article/article_list/label.dart b/lib/models_new/article/article_list/label.dart
deleted file mode 100644
index 638ea14b2e..0000000000
--- a/lib/models_new/article/article_list/label.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class Label {
- String? path;
- String? text;
- String? labelTheme;
-
- Label({this.path, this.text, this.labelTheme});
-
- factory Label.fromJson(Map json) => Label(
- path: json['path'] as String?,
- text: json['text'] as String?,
- labelTheme: json['label_theme'] as String?,
- );
-}
diff --git a/lib/models_new/article/article_list/last.dart b/lib/models_new/article/article_list/last.dart
deleted file mode 100644
index ae283f843f..0000000000
--- a/lib/models_new/article/article_list/last.dart
+++ /dev/null
@@ -1,55 +0,0 @@
-import 'package:PiliPlus/models_new/article/article_list/category.dart';
-import 'package:PiliPlus/utils/extension/iterable_ext.dart';
-
-class Last {
- int? id;
- String? title;
- int? state;
- int? publishTime;
- int? words;
- List? imageUrls;
- Category? category;
- dynamic categories;
- String? summary;
- int? type;
- String? dynIdStr;
- int? attributes;
- int? authorUid;
- int? onlyFans;
-
- Last({
- this.id,
- this.title,
- this.state,
- this.publishTime,
- this.words,
- this.imageUrls,
- this.category,
- this.categories,
- this.summary,
- this.type,
- this.dynIdStr,
- this.attributes,
- this.authorUid,
- this.onlyFans,
- });
-
- factory Last.fromJson(Map json) => Last(
- id: json['id'] as int?,
- title: json['title'] as String?,
- state: json['state'] as int?,
- publishTime: json['publish_time'] as int?,
- words: json['words'] as int?,
- imageUrls: (json['image_urls'] as List?)?.fromCast(),
- category: json['category'] == null
- ? null
- : Category.fromJson(json['category'] as Map),
- categories: json['categories'] as dynamic,
- summary: json['summary'] as String?,
- type: json['type'] as int?,
- dynIdStr: json['dyn_id_str'] as String?,
- attributes: json['attributes'] as int?,
- authorUid: json['author_uid'] as int?,
- onlyFans: json['only_fans'] as int?,
- );
-}
diff --git a/lib/models_new/article/article_list/list.dart b/lib/models_new/article/article_list/list.dart
index 3c349e1b29..069fd1b813 100644
--- a/lib/models_new/article/article_list/list.dart
+++ b/lib/models_new/article/article_list/list.dart
@@ -1,54 +1,30 @@
class ArticleListInfo {
int? id;
- int? mid;
String? name;
String? imageUrl;
int? updateTime;
- int? ctime;
- int? publishTime;
- String? summary;
int? words;
int? read;
int? articlesCount;
- int? state;
- String? reason;
- String? applyTime;
- String? checkTime;
ArticleListInfo({
this.id,
- this.mid,
this.name,
this.imageUrl,
this.updateTime,
- this.ctime,
- this.publishTime,
- this.summary,
this.words,
this.read,
this.articlesCount,
- this.state,
- this.reason,
- this.applyTime,
- this.checkTime,
});
factory ArticleListInfo.fromJson(Map json) =>
ArticleListInfo(
id: json['id'] as int?,
- mid: json['mid'] as int?,
name: json['name'] as String?,
imageUrl: json['image_url'] as String?,
updateTime: json['update_time'] as int?,
- ctime: json['ctime'] as int?,
- publishTime: json['publish_time'] as int?,
- summary: json['summary'] as String?,
words: json['words'] as int?,
read: json['read'] as int?,
articlesCount: json['articles_count'] as int?,
- state: json['state'] as int?,
- reason: json['reason'] as String?,
- applyTime: json['apply_time'] as String?,
- checkTime: json['check_time'] as String?,
);
}
diff --git a/lib/models_new/article/article_list/stats.dart b/lib/models_new/article/article_list/stats.dart
index 590b8c79a7..81f6cf6e30 100644
--- a/lib/models_new/article/article_list/stats.dart
+++ b/lib/models_new/article/article_list/stats.dart
@@ -1,32 +1,17 @@
class Stats {
int? view;
- int? favorite;
int? like;
- int? dislike;
int? reply;
- int? share;
- num? coin;
- int? dynam1c;
Stats({
this.view,
- this.favorite,
this.like,
- this.dislike,
this.reply,
- this.share,
- this.coin,
- this.dynam1c,
});
factory Stats.fromJson(Map json) => Stats(
view: json['view'] as int?,
- favorite: json['favorite'] as int?,
like: json['like'] as int?,
- dislike: json['dislike'] as int?,
reply: json['reply'] as int?,
- share: json['share'] as int?,
- coin: json['coin'] as num?,
- dynam1c: json['dynamic'] as int?,
);
}
diff --git a/lib/models_new/article/article_view/category.dart b/lib/models_new/article/article_view/category.dart
deleted file mode 100644
index 7b202e7013..0000000000
--- a/lib/models_new/article/article_view/category.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class Category {
- int? id;
- int? parentId;
- String? name;
-
- Category({this.id, this.parentId, this.name});
-
- factory Category.fromJson(Map json) => Category(
- id: json['id'] as int?,
- parentId: json['parent_id'] as int?,
- name: json['name'] as String?,
- );
-}
diff --git a/lib/models_new/article/article_view/data.dart b/lib/models_new/article/article_view/data.dart
index 29d8e90e91..e5586f627a 100644
--- a/lib/models_new/article/article_view/data.dart
+++ b/lib/models_new/article/article_view/data.dart
@@ -1,95 +1,28 @@
import 'package:PiliPlus/models/model_avatar.dart';
-import 'package:PiliPlus/models_new/article/article_view/category.dart';
-import 'package:PiliPlus/models_new/article/article_view/media.dart';
import 'package:PiliPlus/models_new/article/article_view/ops.dart';
import 'package:PiliPlus/models_new/article/article_view/opus.dart';
-import 'package:PiliPlus/models_new/article/article_view/stats.dart';
-import 'package:PiliPlus/models_new/article/article_view/tag.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class ArticleViewData {
int? id;
- Category? category;
- List? categories;
String? title;
- String? summary;
- String? bannerUrl;
- int? templateId;
- int? state;
Avatar? author;
- int? reprint;
- List? imageUrls;
int? publishTime;
- int? ctime;
- int? mtime;
- Stats? stats;
- List? tags;
- int? words;
List? originImageUrls;
- dynamic list;
- bool? isLike;
- Media? media;
- String? applyTime;
- String? checkTime;
- int? original;
- int? actId;
- dynamic dispute;
- dynamic authenMark;
- int? coverAvid;
- dynamic topVideoInfo;
int? type;
- int? checkState;
- int? originTemplateId;
- int? privatePub;
- dynamic contentPicList;
String? content;
- String? keywords;
- int? versionId;
String? dynIdStr;
- int? totalArtNum;
ArticleOpus? opus;
List? ops;
ArticleViewData({
this.id,
- this.category,
- this.categories,
- this.title,
- this.summary,
- this.bannerUrl,
- this.templateId,
- this.state,
this.author,
- this.reprint,
- this.imageUrls,
this.publishTime,
- this.ctime,
- this.mtime,
- this.stats,
- this.tags,
- this.words,
this.originImageUrls,
- this.list,
- this.isLike,
- this.media,
- this.applyTime,
- this.checkTime,
- this.original,
- this.actId,
- this.dispute,
- this.authenMark,
- this.coverAvid,
- this.topVideoInfo,
this.type,
- this.checkState,
- this.originTemplateId,
- this.privatePub,
- this.contentPicList,
this.content,
- this.keywords,
- this.versionId,
this.dynIdStr,
- this.totalArtNum,
this.opus,
this.ops,
});
@@ -97,56 +30,14 @@ class ArticleViewData {
factory ArticleViewData.fromJson(Map json) =>
ArticleViewData(
id: json['id'] as int?,
- category: json['category'] == null
- ? null
- : Category.fromJson(json['category'] as Map),
- categories: (json['categories'] as List?)
- ?.map((e) => Category.fromJson(e as Map))
- .toList(),
- title: json['title'] as String?,
- summary: json['summary'] as String?,
- bannerUrl: json['banner_url'] as String?,
- templateId: json['template_id'] as int?,
- state: json['state'] as int?,
author: json['author'] == null
? null
: Avatar.fromJson(json['author'] as Map),
- reprint: json['reprint'] as int?,
- imageUrls: (json['image_urls'] as List?)?.fromCast(),
publishTime: json['publish_time'] as int?,
- ctime: json['ctime'] as int?,
- mtime: json['mtime'] as int?,
- stats: json['stats'] == null
- ? null
- : Stats.fromJson(json['stats'] as Map),
- tags: (json['tags'] as List?)
- ?.map((e) => Tag.fromJson(e as Map))
- .toList(),
- words: json['words'] as int?,
originImageUrls: (json['origin_image_urls'] as List?)?.fromCast(),
- list: json['list'] as dynamic,
- isLike: json['is_like'] as bool?,
- media: json['media'] == null
- ? null
- : Media.fromJson(json['media'] as Map),
- applyTime: json['apply_time'] as String?,
- checkTime: json['check_time'] as String?,
- original: json['original'] as int?,
- actId: json['act_id'] as int?,
- dispute: json['dispute'] as dynamic,
- authenMark: json['authenMark'] as dynamic,
- coverAvid: json['cover_avid'] as int?,
- topVideoInfo: json['top_video_info'] as dynamic,
type: json['type'] as int?,
- checkState: json['check_state'] as int?,
- originTemplateId: json['origin_template_id'] as int?,
- privatePub: json['private_pub'] as int?,
- contentPicList: json['content_pic_list'] as dynamic,
content: json['content'] as String?,
- keywords: json['keywords'] as String?,
- versionId: json['version_id'] as int?,
dynIdStr: json['dyn_id_str'] as String?,
- totalArtNum: json['total_art_num'] as int?,
opus: json['opus'] == null
? null
: ArticleOpus.fromJson(json['opus'] as Map),
diff --git a/lib/models_new/article/article_view/label.dart b/lib/models_new/article/article_view/label.dart
deleted file mode 100644
index 638ea14b2e..0000000000
--- a/lib/models_new/article/article_view/label.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class Label {
- String? path;
- String? text;
- String? labelTheme;
-
- Label({this.path, this.text, this.labelTheme});
-
- factory Label.fromJson(Map json) => Label(
- path: json['path'] as String?,
- text: json['text'] as String?,
- labelTheme: json['label_theme'] as String?,
- );
-}
diff --git a/lib/models_new/article/article_view/media.dart b/lib/models_new/article/article_view/media.dart
deleted file mode 100644
index 83c707baf5..0000000000
--- a/lib/models_new/article/article_view/media.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-class Media {
- int? score;
- int? mediaId;
- String? title;
- String? cover;
- String? area;
- int? typeId;
- String? typeName;
- int? spoiler;
- int? seasonId;
-
- Media({
- this.score,
- this.mediaId,
- this.title,
- this.cover,
- this.area,
- this.typeId,
- this.typeName,
- this.spoiler,
- this.seasonId,
- });
-
- factory Media.fromJson(Map json) => Media(
- score: json['score'] as int?,
- mediaId: json['media_id'] as int?,
- title: json['title'] as String?,
- cover: json['cover'] as String?,
- area: json['area'] as String?,
- typeId: json['type_id'] as int?,
- typeName: json['type_name'] as String?,
- spoiler: json['spoiler'] as int?,
- seasonId: json['season_id'] as int?,
- );
-}
diff --git a/lib/models_new/article/article_view/opus.dart b/lib/models_new/article/article_view/opus.dart
index cc1cbaf56a..5ad695bcd3 100644
--- a/lib/models_new/article/article_view/opus.dart
+++ b/lib/models_new/article/article_view/opus.dart
@@ -1,15 +1,9 @@
import 'package:PiliPlus/models/dynamics/article_content_model.dart';
class ArticleOpus {
- int? opusid;
- int? opussource;
- String? title;
List? content;
ArticleOpus.fromJson(Map json) {
- opusid = json['opus_id'];
- opussource = json['opus_source'];
- title = json['title'];
if (json['content']?['paragraphs'] case List list) {
content = list.map((i) => ArticleContentModel.fromJson(i)).toList();
}
diff --git a/lib/models_new/article/article_view/stats.dart b/lib/models_new/article/article_view/stats.dart
deleted file mode 100644
index 590b8c79a7..0000000000
--- a/lib/models_new/article/article_view/stats.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-class Stats {
- int? view;
- int? favorite;
- int? like;
- int? dislike;
- int? reply;
- int? share;
- num? coin;
- int? dynam1c;
-
- Stats({
- this.view,
- this.favorite,
- this.like,
- this.dislike,
- this.reply,
- this.share,
- this.coin,
- this.dynam1c,
- });
-
- factory Stats.fromJson(Map json) => Stats(
- view: json['view'] as int?,
- favorite: json['favorite'] as int?,
- like: json['like'] as int?,
- dislike: json['dislike'] as int?,
- reply: json['reply'] as int?,
- share: json['share'] as int?,
- coin: json['coin'] as num?,
- dynam1c: json['dynamic'] as int?,
- );
-}
diff --git a/lib/models_new/article/article_view/tag.dart b/lib/models_new/article/article_view/tag.dart
deleted file mode 100644
index 33fe703253..0000000000
--- a/lib/models_new/article/article_view/tag.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class Tag {
- int? tid;
- String? name;
-
- Tag({this.tid, this.name});
-
- factory Tag.fromJson(Map json) => Tag(
- tid: json['tid'] as int?,
- name: json['name'] as String?,
- );
-}
diff --git a/lib/models_new/blacklist/data.dart b/lib/models_new/blacklist/data.dart
index 7741df5b5b..1cf97c7806 100644
--- a/lib/models_new/blacklist/data.dart
+++ b/lib/models_new/blacklist/data.dart
@@ -2,16 +2,14 @@ import 'package:PiliPlus/models_new/blacklist/list.dart';
class BlackListData {
List? list;
- int? reVersion;
int? total;
- BlackListData({this.list, this.reVersion, this.total});
+ BlackListData({this.list, this.total});
factory BlackListData.fromJson(Map json) => BlackListData(
list: (json['list'] as List?)
?.map((e) => BlackListItem.fromJson(e as Map))
.toList(),
- reVersion: json['re_version'] as int?,
total: json['total'] as int?,
);
}
diff --git a/lib/models_new/blacklist/list.dart b/lib/models_new/blacklist/list.dart
index edbd86a1c1..ff54766a68 100644
--- a/lib/models_new/blacklist/list.dart
+++ b/lib/models_new/blacklist/list.dart
@@ -1,61 +1,20 @@
-import 'package:PiliPlus/models/model_avatar.dart';
-
class BlackListItem {
int? mid;
- int? attribute;
int? mtime;
- dynamic tag;
- int? special;
String? uname;
String? face;
- String? sign;
- int? faceNft;
- BaseOfficialVerify? officialVerify;
- Vip? vip;
- String? nftIcon;
- String? recReason;
- String? trackId;
- String? followTime;
BlackListItem({
this.mid,
- this.attribute,
this.mtime,
- this.tag,
- this.special,
this.uname,
this.face,
- this.sign,
- this.faceNft,
- this.officialVerify,
- this.vip,
- this.nftIcon,
- this.recReason,
- this.trackId,
- this.followTime,
});
factory BlackListItem.fromJson(Map json) => BlackListItem(
mid: json['mid'] as int?,
- attribute: json['attribute'] as int?,
mtime: json['mtime'] as int?,
- tag: json['tag'] as dynamic,
- special: json['special'] as int?,
uname: json['uname'] as String?,
face: json['face'] as String?,
- sign: json['sign'] as String?,
- faceNft: json['face_nft'] as int?,
- officialVerify: json['official_verify'] == null
- ? null
- : BaseOfficialVerify.fromJson(
- json['official_verify'] as Map,
- ),
- vip: json['vip'] == null
- ? null
- : Vip.fromJson(json['vip'] as Map),
- nftIcon: json['nft_icon'] as String?,
- recReason: json['rec_reason'] as String?,
- trackId: json['track_id'] as String?,
- followTime: json['follow_time'] as String?,
);
}
diff --git a/lib/models_new/coin_log/data.dart b/lib/models_new/coin_log/data.dart
index bba0316641..dff395016d 100644
--- a/lib/models_new/coin_log/data.dart
+++ b/lib/models_new/coin_log/data.dart
@@ -1,15 +1,13 @@
import 'package:PiliPlus/models_new/coin_log/list.dart';
class CoinLogData {
- List? list;
- int? count;
+ CoinLogData({this.list});
- CoinLogData({this.list, this.count});
+ List? list;
factory CoinLogData.fromJson(Map json) => CoinLogData(
list: (json['list'] as List?)
?.map((e) => CoinLogItem.fromJson(e as Map))
.toList(),
- count: json['count'] as int?,
);
}
diff --git a/lib/models_new/coin_log/list.dart b/lib/models_new/coin_log/list.dart
index 6e9b291a79..030b6f695d 100644
--- a/lib/models_new/coin_log/list.dart
+++ b/lib/models_new/coin_log/list.dart
@@ -1,14 +1,14 @@
class CoinLogItem {
- final String time;
- final String delta;
- final String reason;
-
const CoinLogItem({
required this.time,
required this.delta,
required this.reason,
});
+ final String time;
+ final String delta;
+ final String reason;
+
factory CoinLogItem.fromJson(Map json) => CoinLogItem(
time: json['time'],
delta: (json['delta'] as num).toString(),
diff --git a/lib/models_new/danmaku/post.dart b/lib/models_new/danmaku/post.dart
index 678934aa3f..6f9bb3c1c6 100644
--- a/lib/models_new/danmaku/post.dart
+++ b/lib/models_new/danmaku/post.dart
@@ -1,31 +1,13 @@
class DanmakuPost {
DanmakuPost({
- required this.action,
- required this.animation,
- required this.colorfulSrc,
- required this.dmContent,
required this.dmid,
- required this.dmidStr,
- required this.visible,
});
- final String? action;
- final String? animation;
- final dynamic colorfulSrc;
- final String? dmContent;
final int? dmid;
- final String? dmidStr;
- final bool? visible;
factory DanmakuPost.fromJson(Map json) {
return DanmakuPost(
- action: json["action"],
- animation: json["animation"],
- colorfulSrc: json["colorful_src"],
- dmContent: json["dm_content"],
dmid: json["dmid"],
- dmidStr: json["dmid_str"],
- visible: json["visible"],
);
}
}
diff --git a/lib/models_new/download/bili_download_entry_info.dart b/lib/models_new/download/bili_download_entry_info.dart
index 3e6fe5ebf6..24fa47aa6a 100644
--- a/lib/models_new/download/bili_download_entry_info.dart
+++ b/lib/models_new/download/bili_download_entry_info.dart
@@ -1,8 +1,12 @@
+import 'dart:io' show Platform, Process;
+
import 'package:PiliPlus/models/common/video/video_type.dart';
import 'package:PiliPlus/pages/common/multi_select/base.dart'
show MultiSelectData;
import 'package:PiliPlus/utils/page_utils.dart';
+import 'package:PiliPlus/utils/platform_utils.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/route_manager.dart';
class BiliDownloadEntryInfo with MultiSelectData {
@@ -68,10 +72,7 @@ class BiliDownloadEntryInfo with MultiSelectData {
itemBuilder: (_) => [
PopupMenuItem(
height: 38,
- child: const Text(
- '查看详情页',
- style: TextStyle(fontSize: 13),
- ),
+ child: const Text('查看详情页', style: TextStyle(fontSize: 13)),
onTap: () {
if (ep case final ep?) {
if (ep.from == VideoType.pugv.name) {
@@ -97,14 +98,34 @@ class BiliDownloadEntryInfo with MultiSelectData {
);
},
),
+ if (PlatformUtils.isDesktop)
+ PopupMenuItem(
+ height: 38,
+ child: const Text('打开本地文件夹', style: TextStyle(fontSize: 13)),
+ onTap: () async {
+ try {
+ final String executable;
+ if (Platform.isWindows) {
+ executable = 'explorer';
+ } else if (Platform.isMacOS) {
+ executable = 'open';
+ } else if (Platform.isLinux) {
+ executable = 'xdg-open';
+ } else {
+ throw UnimplementedError();
+ }
+ await Process.run(executable, [entryDirPath]);
+ } catch (e) {
+ SmartDialog.showToast(e.toString());
+ }
+ },
+ ),
if (ownerId case final mid?)
PopupMenuItem(
height: 38,
child: Text(
'访问${ownerName != null ? ':$ownerName' : '用户主页'}',
- style: const TextStyle(
- fontSize: 13,
- ),
+ style: const TextStyle(fontSize: 13),
),
onTap: () => Get.toNamed('/member?mid=$mid'),
),
@@ -395,7 +416,7 @@ enum DownloadStatus {
failDanmaku('获取弹幕失败'),
failPlayUrl('获取播放地址失败'),
pause('暂停中'),
- wait('等待中')
+ wait('等待中'),
;
final String message;
diff --git a/lib/models_new/dynamic/dyn_mention/group.dart b/lib/models_new/dynamic/dyn_mention/group.dart
index 711309a5f5..6d82649ed9 100644
--- a/lib/models_new/dynamic/dyn_mention/group.dart
+++ b/lib/models_new/dynamic/dyn_mention/group.dart
@@ -2,14 +2,12 @@ import 'package:PiliPlus/models_new/dynamic/dyn_mention/item.dart';
class MentionGroup {
String? groupName;
- int? groupType;
List? items;
- MentionGroup({this.groupName, this.groupType, this.items});
+ MentionGroup({this.groupName, this.items});
factory MentionGroup.fromJson(Map json) => MentionGroup(
groupName: json['group_name'] as String?,
- groupType: json['group_type'] as int?,
items: (json['items'] as List?)
?.map((e) => MentionItem.fromJson(e as Map))
.toList(),
diff --git a/lib/models_new/dynamic/dyn_mention/item.dart b/lib/models_new/dynamic/dyn_mention/item.dart
index 7d3572f4e7..c5207a66c8 100644
--- a/lib/models_new/dynamic/dyn_mention/item.dart
+++ b/lib/models_new/dynamic/dyn_mention/item.dart
@@ -4,14 +4,12 @@ class MentionItem with MultiSelectData {
final String? face;
final int? fans;
final String? name;
- final int? officialVerifyType;
final String? uid;
MentionItem({
this.face,
this.fans,
this.name,
- this.officialVerifyType,
this.uid,
});
@@ -19,7 +17,6 @@ class MentionItem with MultiSelectData {
face: json['face'] as String?,
fans: json['fans'] as int?,
name: json['name'] as String?,
- officialVerifyType: json['official_verify_type'] as int?,
uid: json['uid'] as String?,
);
diff --git a/lib/models_new/dynamic/dyn_reserve/data.dart b/lib/models_new/dynamic/dyn_reserve/data.dart
index fd82f63802..3401811513 100644
--- a/lib/models_new/dynamic/dyn_reserve/data.dart
+++ b/lib/models_new/dynamic/dyn_reserve/data.dart
@@ -1,23 +1,17 @@
class DynReserveData {
int? finalBtnStatus;
- int? btnMode;
int? reserveUpdate;
String? descUpdate;
- String? toast;
DynReserveData({
this.finalBtnStatus,
- this.btnMode,
this.reserveUpdate,
this.descUpdate,
- this.toast,
});
factory DynReserveData.fromJson(Map json) => DynReserveData(
finalBtnStatus: json['final_btn_status'] as int?,
- btnMode: json['btn_mode'] as int?,
reserveUpdate: json['reserve_update'] as int?,
descUpdate: json['desc_update'] as String?,
- toast: json['toast'] as String?,
);
}
diff --git a/lib/models_new/dynamic/dyn_reserve_info/data.dart b/lib/models_new/dynamic/dyn_reserve_info/data.dart
index 363c72054c..ad58d70b66 100644
--- a/lib/models_new/dynamic/dyn_reserve_info/data.dart
+++ b/lib/models_new/dynamic/dyn_reserve_info/data.dart
@@ -1,48 +1,18 @@
class ReserveInfoData {
int? id;
String? title;
- int? stime;
- int? etime;
- int? type;
int? livePlanStartTime;
- int? lotteryType;
- String? lotteryId;
- int? subType;
ReserveInfoData({
this.id,
this.title,
- this.stime,
- this.etime,
- this.type,
this.livePlanStartTime,
- this.lotteryType,
- this.lotteryId,
- this.subType,
});
factory ReserveInfoData.fromJson(Map json) =>
ReserveInfoData(
id: json['id'] as int?,
title: json['title'] as String?,
- stime: json['stime'] as int?,
- etime: json['etime'] as int?,
- type: json['type'] as int?,
livePlanStartTime: json['live_plan_start_time'] as int?,
- lotteryType: json['lottery_type'] as int?,
- lotteryId: json['lottery_id'] as String?,
- subType: json['sub_type'] as int?,
);
-
- Map toJson() => {
- 'id': id,
- 'title': title,
- 'stime': stime,
- 'etime': etime,
- 'type': type,
- 'live_plan_start_time': livePlanStartTime,
- 'lottery_type': lotteryType,
- 'lottery_id': lotteryId,
- 'sub_type': subType,
- };
}
diff --git a/lib/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart b/lib/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart
index bd0a74794a..407413e1d0 100644
--- a/lib/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart
+++ b/lib/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart
@@ -2,17 +2,15 @@ import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/all_sort_by.dart';
class TopicSortByConf {
List? allSortBy;
- int? defaultSortBy;
int? showSortBy;
- TopicSortByConf({this.allSortBy, this.defaultSortBy, this.showSortBy});
+ TopicSortByConf({this.allSortBy, this.showSortBy});
factory TopicSortByConf.fromJson(Map json) {
return TopicSortByConf(
allSortBy: (json['all_sort_by'] as List?)
?.map((e) => AllSortBy.fromJson(e as Map))
.toList(),
- defaultSortBy: json['default_sort_by'] as int?,
showSortBy: json['show_sort_by'] as int?,
);
}
diff --git a/lib/models_new/dynamic/dyn_topic_pub_search/data.dart b/lib/models_new/dynamic/dyn_topic_pub_search/data.dart
index ca05cb7e3c..73c2a59318 100644
--- a/lib/models_new/dynamic/dyn_topic_pub_search/data.dart
+++ b/lib/models_new/dynamic/dyn_topic_pub_search/data.dart
@@ -1,32 +1,20 @@
-import 'package:PiliPlus/models_new/dynamic/dyn_topic_pub_search/new_topic.dart';
import 'package:PiliPlus/models_new/dynamic/dyn_topic_pub_search/page_info.dart';
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
class TopicPubSearchData {
- NewTopic? newTopic;
- bool? hasCreateJurisdiction;
List? topicItems;
- String? requestId;
PageInfo? pageInfo;
TopicPubSearchData({
- this.newTopic,
- this.hasCreateJurisdiction,
this.topicItems,
- this.requestId,
this.pageInfo,
});
factory TopicPubSearchData.fromJson(Map json) =>
TopicPubSearchData(
- newTopic: json['new_topic'] == null
- ? null
- : NewTopic.fromJson(json['new_topic'] as Map),
- hasCreateJurisdiction: json['has_create_jurisdiction'] as bool?,
topicItems: (json['topic_items'] as List?)
?.map((e) => TopicItem.fromJson(e as Map))
.toList(),
- requestId: json['request_id'] as String?,
pageInfo: json['page_info'] == null
? null
: PageInfo.fromJson(json['page_info'] as Map),
diff --git a/lib/models_new/dynamic/dyn_topic_pub_search/new_topic.dart b/lib/models_new/dynamic/dyn_topic_pub_search/new_topic.dart
deleted file mode 100644
index e8c2db534f..0000000000
--- a/lib/models_new/dynamic/dyn_topic_pub_search/new_topic.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-class NewTopic {
- String? name;
-
- NewTopic({this.name});
-
- factory NewTopic.fromJson(Map json) => NewTopic(
- name: json['name'] as String?,
- );
-}
diff --git a/lib/models_new/dynamic/dyn_topic_pub_search/page_info.dart b/lib/models_new/dynamic/dyn_topic_pub_search/page_info.dart
index c175a7f17d..61ea5daf69 100644
--- a/lib/models_new/dynamic/dyn_topic_pub_search/page_info.dart
+++ b/lib/models_new/dynamic/dyn_topic_pub_search/page_info.dart
@@ -1,11 +1,9 @@
class PageInfo {
- int? offset;
bool? hasMore;
- PageInfo({this.offset, this.hasMore});
+ PageInfo({this.hasMore});
factory PageInfo.fromJson(Map json) => PageInfo(
- offset: json['offset'] as int?,
hasMore: json['has_more'] as bool?,
);
}
diff --git a/lib/models_new/dynamic/dyn_topic_top/top_details.dart b/lib/models_new/dynamic/dyn_topic_top/top_details.dart
index 2be417e3c0..68d749e36a 100644
--- a/lib/models_new/dynamic/dyn_topic_top/top_details.dart
+++ b/lib/models_new/dynamic/dyn_topic_top/top_details.dart
@@ -4,16 +4,10 @@ import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
class TopDetails {
TopicItem? topicItem;
TopicCreator? topicCreator;
- bool? hasCreateJurisdiction;
- int? wordColor;
- bool? closePubLayerEntry;
TopDetails({
this.topicItem,
this.topicCreator,
- this.hasCreateJurisdiction,
- this.wordColor,
- this.closePubLayerEntry,
});
factory TopDetails.fromJson(Map json) => TopDetails(
@@ -23,8 +17,5 @@ class TopDetails {
topicCreator: json['topic_creator'] == null
? null
: TopicCreator.fromJson(json['topic_creator'] as Map),
- hasCreateJurisdiction: json['has_create_jurisdiction'] as bool?,
- wordColor: json['word_color'] as int?,
- closePubLayerEntry: json['close_pub_layer_entry'] as bool?,
);
}
diff --git a/lib/models_new/dynamic/dyn_topic_top/topic_item.dart b/lib/models_new/dynamic/dyn_topic_top/topic_item.dart
index 4996a13e62..d4bb93083e 100644
--- a/lib/models_new/dynamic/dyn_topic_top/topic_item.dart
+++ b/lib/models_new/dynamic/dyn_topic_top/topic_item.dart
@@ -5,14 +5,7 @@ class TopicItem {
int discuss;
int fav;
int like;
- int? dynamics;
- String? jumpUrl;
- String? backColor;
String? description;
- String? sharePic;
- String? shareUrl;
- int? ctime;
- bool? showInteractData;
bool? isFav;
bool? isLike;
@@ -23,14 +16,7 @@ class TopicItem {
required this.discuss,
required this.fav,
required this.like,
- this.dynamics,
- this.jumpUrl,
- this.backColor,
this.description,
- this.sharePic,
- this.shareUrl,
- this.ctime,
- this.showInteractData,
this.isFav,
this.isLike,
});
@@ -42,14 +28,7 @@ class TopicItem {
discuss: json['discuss'] ?? 0,
fav: json['fav'] ?? 0,
like: json['like'] ?? 0,
- dynamics: json['dynamics'] as int?,
- jumpUrl: json['jump_url'] as String?,
- backColor: json['back_color'] as String?,
description: json['description'] as String?,
- sharePic: json['share_pic'] as String?,
- shareUrl: json['share_url'] as String?,
- ctime: json['ctime'] as int?,
- showInteractData: json['show_interact_data'] as bool?,
isFav: json['is_fav'] as bool?,
isLike: json['is_like'] as bool?,
);
diff --git a/lib/models_new/fav/fav_article/author.dart b/lib/models_new/fav/fav_article/author.dart
index 778aae8967..997e904fc8 100644
--- a/lib/models_new/fav/fav_article/author.dart
+++ b/lib/models_new/fav/fav_article/author.dart
@@ -1,13 +1,9 @@
class Author {
String? name;
- String? face;
- String? mid;
- Author({this.name, this.face, this.mid});
+ Author({this.name});
factory Author.fromJson(Map json) => Author(
name: json['name'] as String?,
- face: json['face'] as String?,
- mid: json['mid'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_article/cover.dart b/lib/models_new/fav/fav_article/cover.dart
index abcf6001a4..6463e37862 100644
--- a/lib/models_new/fav/fav_article/cover.dart
+++ b/lib/models_new/fav/fav_article/cover.dart
@@ -1,13 +1,9 @@
class Cover {
String? url;
- int? width;
- int? height;
- Cover({this.url, this.width, this.height});
+ Cover({this.url});
factory Cover.fromJson(Map json) => Cover(
url: json['url'] as String?,
- width: json['width'] as int?,
- height: json['height'] as int?,
);
}
diff --git a/lib/models_new/fav/fav_article/data.dart b/lib/models_new/fav/fav_article/data.dart
index 8f326f4ef6..6342b8f117 100644
--- a/lib/models_new/fav/fav_article/data.dart
+++ b/lib/models_new/fav/fav_article/data.dart
@@ -3,16 +3,10 @@ import 'package:PiliPlus/models_new/fav/fav_article/item.dart';
class FavArticleData {
List? items;
bool? hasMore;
- String? offset;
- String? updateNum;
- String? updateBaseline;
FavArticleData({
this.items,
this.hasMore,
- this.offset,
- this.updateNum,
- this.updateBaseline,
});
factory FavArticleData.fromJson(Map json) => FavArticleData(
@@ -20,8 +14,5 @@ class FavArticleData {
?.map((e) => FavArticleItemModel.fromJson(e as Map))
.toList(),
hasMore: json['has_more'] as bool?,
- offset: json['offset'] as String?,
- updateNum: json['update_num'] as String?,
- updateBaseline: json['update_baseline'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_article/item.dart b/lib/models_new/fav/fav_article/item.dart
index 07b40b7a86..e3f0ca1a49 100644
--- a/lib/models_new/fav/fav_article/item.dart
+++ b/lib/models_new/fav/fav_article/item.dart
@@ -3,20 +3,16 @@ import 'package:PiliPlus/models_new/fav/fav_article/cover.dart';
import 'package:PiliPlus/models_new/fav/fav_article/stat.dart';
class FavArticleItemModel {
- String? jumpUrl;
String? opusId;
String? content;
- dynamic badge;
Author? author;
Cover? cover;
Stat? stat;
String? pubTime;
FavArticleItemModel({
- this.jumpUrl,
this.opusId,
this.content,
- this.badge,
this.author,
this.cover,
this.stat,
@@ -25,10 +21,8 @@ class FavArticleItemModel {
factory FavArticleItemModel.fromJson(Map json) =>
FavArticleItemModel(
- jumpUrl: json['jump_url'] as String?,
opusId: json['opus_id'] as String?,
content: json['content'] as String?,
- badge: json['badge'] as dynamic,
author: json['author'] == null
? null
: Author.fromJson(json['author'] as Map),
diff --git a/lib/models_new/fav/fav_article/stat.dart b/lib/models_new/fav/fav_article/stat.dart
index e16802ff61..228afc060f 100644
--- a/lib/models_new/fav/fav_article/stat.dart
+++ b/lib/models_new/fav/fav_article/stat.dart
@@ -1,11 +1,9 @@
class Stat {
- String? view;
String? like;
- Stat({this.view, this.like});
+ Stat({this.like});
factory Stat.fromJson(Map json) => Stat(
- view: json['view'] as String?,
like: json['like'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_detail/cnt_info.dart b/lib/models_new/fav/fav_detail/cnt_info.dart
index 6f390a2925..e646792c92 100644
--- a/lib/models_new/fav/fav_detail/cnt_info.dart
+++ b/lib/models_new/fav/fav_detail/cnt_info.dart
@@ -1,41 +1,15 @@
class CntInfo {
- int? collect;
int? play;
- int? thumbUp;
- int? thumbDown;
- int? share;
- int? reply;
int? danmaku;
- num? coin;
- int? vt;
- int? playSwitch;
- String? viewText1;
CntInfo({
- this.collect,
this.play,
- this.thumbUp,
- this.thumbDown,
- this.share,
- this.reply,
+
this.danmaku,
- this.coin,
- this.vt,
- this.playSwitch,
- this.viewText1,
});
factory CntInfo.fromJson(Map json) => CntInfo(
- collect: json['collect'] as int?,
play: json['play'] as int?,
- thumbUp: json['thumb_up'] as int?,
- thumbDown: json['thumb_down'] as int?,
- share: json['share'] as int?,
- reply: json['reply'] as int?,
danmaku: json['danmaku'] as int?,
- coin: json['coin'] as num?,
- vt: json['vt'] as int?,
- playSwitch: json['play_switch'] as int?,
- viewText1: json['view_text_1'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_detail/data.dart b/lib/models_new/fav/fav_detail/data.dart
index 53a11ab217..72d4265892 100644
--- a/lib/models_new/fav/fav_detail/data.dart
+++ b/lib/models_new/fav/fav_detail/data.dart
@@ -5,9 +5,8 @@ class FavDetailData {
FavFolderInfo? info;
List? medias;
bool? hasMore;
- int? ttl;
- FavDetailData({this.info, this.medias, this.hasMore, this.ttl});
+ FavDetailData({this.info, this.medias, this.hasMore});
factory FavDetailData.fromJson(Map json) => FavDetailData(
info: json['info'] == null
@@ -17,6 +16,5 @@ class FavDetailData {
?.map((e) => FavDetailItemModel.fromJson(e as Map))
.toList(),
hasMore: json['has_more'] as bool?,
- ttl: json['ttl'] as int?,
);
}
diff --git a/lib/models_new/fav/fav_detail/info.dart b/lib/models_new/fav/fav_detail/info.dart
deleted file mode 100644
index a6e31cc7f8..0000000000
--- a/lib/models_new/fav/fav_detail/info.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-import 'package:PiliPlus/models/model_owner.dart';
-import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
-
-class FavDetailInfo {
- int? id;
- int? fid;
- int? mid;
- int? attr;
- String? title;
- String? cover;
- Owner? upper;
- int? coverType;
- CntInfo? cntInfo;
- int? type;
- String? intro;
- int? ctime;
- int? mtime;
- int? state;
- int? favState;
- int? likeState;
- int? mediaCount;
- bool? isTop;
-
- FavDetailInfo({
- this.id,
- this.fid,
- this.mid,
- this.attr,
- this.title,
- this.cover,
- this.upper,
- this.coverType,
- this.cntInfo,
- this.type,
- this.intro,
- this.ctime,
- this.mtime,
- this.state,
- this.favState,
- this.likeState,
- this.mediaCount,
- this.isTop,
- });
-
- factory FavDetailInfo.fromJson(Map json) => FavDetailInfo(
- id: json['id'] as int?,
- fid: json['fid'] as int?,
- mid: json['mid'] as int?,
- attr: json['attr'] as int?,
- title: json['title'] as String?,
- cover: json['cover'] as String?,
- upper: json['upper'] == null
- ? null
- : Owner.fromJson(json['upper'] as Map),
- coverType: json['cover_type'] as int?,
- cntInfo: json['cnt_info'] == null
- ? null
- : CntInfo.fromJson(json['cnt_info'] as Map),
- type: json['type'] as int?,
- intro: json['intro'] as String?,
- ctime: json['ctime'] as int?,
- mtime: json['mtime'] as int?,
- state: json['state'] as int?,
- favState: json['fav_state'] as int?,
- likeState: json['like_state'] as int?,
- mediaCount: json['media_count'] as int?,
- isTop: json['is_top'] as bool?,
- );
-}
diff --git a/lib/models_new/fav/fav_detail/media.dart b/lib/models_new/fav/fav_detail/media.dart
index e81b6cafce..662a34e84e 100644
--- a/lib/models_new/fav/fav_detail/media.dart
+++ b/lib/models_new/fav/fav_detail/media.dart
@@ -10,19 +10,14 @@ class FavDetailItemModel with MultiSelectData {
String? title;
String? cover;
String? intro;
- int? page;
int? duration;
Owner? upper;
int? attr;
CntInfo? cntInfo;
- String? link;
- int? ctime;
- int? pubtime;
int? favTime;
String? bvid;
Ogv? ogv;
Ugc? ugc;
- String? mediaListLink;
FavDetailItemModel({
this.id,
@@ -30,19 +25,14 @@ class FavDetailItemModel with MultiSelectData {
this.title,
this.cover,
this.intro,
- this.page,
this.duration,
this.upper,
this.attr,
this.cntInfo,
- this.link,
- this.ctime,
- this.pubtime,
this.favTime,
this.bvid,
this.ogv,
this.ugc,
- this.mediaListLink,
});
factory FavDetailItemModel.fromJson(Map json) =>
@@ -52,7 +42,6 @@ class FavDetailItemModel with MultiSelectData {
title: json['title'] as String?,
cover: json['cover'] as String?,
intro: json['intro'] as String?,
- page: json['page'] as int?,
duration: json['duration'] as int?,
upper: json['upper'] == null
? null
@@ -61,15 +50,11 @@ class FavDetailItemModel with MultiSelectData {
cntInfo: json['cnt_info'] == null
? null
: CntInfo.fromJson(json['cnt_info'] as Map),
- link: json['link'] as String?,
- ctime: json['ctime'] as int?,
- pubtime: json['pubtime'] as int?,
favTime: json['fav_time'] as int?,
bvid: json['bvid'] ?? json['bv_id'],
ogv: json['ogv'] == null ? null : Ogv.fromJson(json['ogv']),
ugc: json['ugc'] == null
? null
: Ugc.fromJson(json['ugc'] as Map),
- mediaListLink: json['media_list_link'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_detail/ogv.dart b/lib/models_new/fav/fav_detail/ogv.dart
index a560a46efd..47ede51361 100644
--- a/lib/models_new/fav/fav_detail/ogv.dart
+++ b/lib/models_new/fav/fav_detail/ogv.dart
@@ -1,17 +1,14 @@
class Ogv {
String? typeName;
- int? typeId;
int? seasonId;
Ogv({
this.typeName,
- this.typeId,
this.seasonId,
});
factory Ogv.fromJson(Map json) => Ogv(
typeName: json['type_name'],
- typeId: json['type_id'],
seasonId: json['season_id'],
);
}
diff --git a/lib/models_new/fav/fav_folder/list.dart b/lib/models_new/fav/fav_folder/list.dart
index 16eb9ac71d..ec8e4482ae 100644
--- a/lib/models_new/fav/fav_folder/list.dart
+++ b/lib/models_new/fav/fav_folder/list.dart
@@ -5,42 +5,24 @@ class FavFolderInfo {
int? fid;
int mid;
int attr;
- String? attrDesc;
String title;
String cover;
Owner? upper;
- int? coverType;
String? intro;
- int? ctime;
- int? mtime;
- int? state;
int? favState;
int mediaCount;
- int? viewCount;
- bool? isTop;
- int? type;
- String? bvid;
FavFolderInfo({
this.id = 0,
this.fid,
this.mid = 0,
this.attr = -1,
- this.attrDesc,
this.title = '',
this.cover = '',
this.upper,
- this.coverType,
this.intro,
- this.ctime,
- this.mtime,
- this.state,
this.favState,
this.mediaCount = 0,
- this.viewCount,
- this.isTop,
- this.type,
- this.bvid,
});
factory FavFolderInfo.fromJson(Map json) => FavFolderInfo(
@@ -48,22 +30,13 @@ class FavFolderInfo {
fid: json['fid'] as int?,
mid: json['mid'] as int? ?? 0,
attr: json['attr'] as int? ?? 0,
- attrDesc: json['attr_desc'] as String?,
title: json['title'] as String? ?? '',
cover: json['cover'] as String? ?? '',
upper: json['upper'] == null
? null
: Owner.fromJson(json['upper'] as Map),
- coverType: json['cover_type'] as int?,
intro: json['intro'] as String?,
- ctime: json['ctime'] as int?,
- mtime: json['mtime'] as int?,
- state: json['state'] as int?,
favState: json['fav_state'] as int?,
mediaCount: json['media_count'] as int? ?? 0,
- viewCount: json['view_count'] as int?,
- isTop: json['is_top'] as bool?,
- type: json['type'] as int?,
- bvid: json['bvid'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_note/arc.dart b/lib/models_new/fav/fav_note/arc.dart
deleted file mode 100644
index 710c3761f0..0000000000
--- a/lib/models_new/fav/fav_note/arc.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-class Arc {
- int? oid;
- String? bvid;
- String? pic;
- String? desc;
- int? status;
- int? oidType;
- int? aid;
-
- Arc({
- this.oid,
- this.bvid,
- this.pic,
- this.desc,
- this.status,
- this.oidType,
- this.aid,
- });
-
- factory Arc.fromJson(Map json) => Arc(
- oid: json['oid'] as int?,
- bvid: json['bvid'] as String?,
- pic: json['pic'] as String?,
- desc: json['desc'] as String?,
- status: json['status'] as int?,
- oidType: json['oid_type'] as int?,
- aid: json['aid'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_note/data.dart b/lib/models_new/fav/fav_note/data.dart
index 37d446d366..316cb859ce 100644
--- a/lib/models_new/fav/fav_note/data.dart
+++ b/lib/models_new/fav/fav_note/data.dart
@@ -1,18 +1,13 @@
import 'package:PiliPlus/models_new/fav/fav_note/list.dart';
-import 'package:PiliPlus/models_new/fav/fav_note/page.dart';
class FavNoteData {
List? list;
- Page? page;
- FavNoteData({this.list, this.page});
+ FavNoteData({this.list});
factory FavNoteData.fromJson(Map json) => FavNoteData(
list: (json['list'] as List?)
?.map((e) => FavNoteItemModel.fromJson(e as Map))
.toList(),
- page: json['page'] == null
- ? null
- : Page.fromJson(json['page'] as Map),
);
}
diff --git a/lib/models_new/fav/fav_note/page.dart b/lib/models_new/fav/fav_note/page.dart
deleted file mode 100644
index 22984a0714..0000000000
--- a/lib/models_new/fav/fav_note/page.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-class Page {
- int? total;
- int? size;
- int? num;
-
- Page({this.total, this.size, this.num});
-
- factory Page.fromJson(Map json) => Page(
- total: json['total'] as int?,
- size: json['size'] as int?,
- num: json['num'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/area.dart b/lib/models_new/fav/fav_pgc/area.dart
deleted file mode 100644
index 8540bf56fc..0000000000
--- a/lib/models_new/fav/fav_pgc/area.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class Area {
- int? id;
- String? name;
-
- Area({this.id, this.name});
-
- factory Area.fromJson(Map json) => Area(
- id: json['id'] as int?,
- name: json['name'] as String?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/badge_info.dart b/lib/models_new/fav/fav_pgc/badge_info.dart
deleted file mode 100644
index fd1c023d31..0000000000
--- a/lib/models_new/fav/fav_pgc/badge_info.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/multi_img.dart';
-
-class BadgeInfo {
- String? text;
- String? bgColor;
- String? bgColorNight;
- String? img;
- MultiImg? multiImg;
-
- BadgeInfo({
- this.text,
- this.bgColor,
- this.bgColorNight,
- this.img,
- this.multiImg,
- });
-
- factory BadgeInfo.fromJson(Map json) => BadgeInfo(
- text: json['text'] as String?,
- bgColor: json['bg_color'] as String?,
- bgColorNight: json['bg_color_night'] as String?,
- img: json['img'] as String?,
- multiImg: json['multi_img'] == null
- ? null
- : MultiImg.fromJson(json['multi_img'] as Map),
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/badge_infos.dart b/lib/models_new/fav/fav_pgc/badge_infos.dart
deleted file mode 100644
index 5c70bdd3b8..0000000000
--- a/lib/models_new/fav/fav_pgc/badge_infos.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/content_attr.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/vip_or_pay.dart';
-
-class BadgeInfos {
- ContentAttr? contentAttr;
- VipOrPay? vipOrPay;
-
- BadgeInfos({this.contentAttr, this.vipOrPay});
-
- factory BadgeInfos.fromJson(Map json) => BadgeInfos(
- contentAttr: json['content_attr'] == null
- ? null
- : ContentAttr.fromJson(json['content_attr'] as Map),
- vipOrPay: json['vip_or_pay'] == null
- ? null
- : VipOrPay.fromJson(json['vip_or_pay'] as Map),
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/cc_on_lock.dart b/lib/models_new/fav/fav_pgc/cc_on_lock.dart
deleted file mode 100644
index a83feefecc..0000000000
--- a/lib/models_new/fav/fav_pgc/cc_on_lock.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-class CcOnLock {
- String? typeUrl;
-
- CcOnLock({this.typeUrl});
-
- factory CcOnLock.fromJson(Map json) => CcOnLock(
- typeUrl: json['type_url'] as String?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/config_attrs.dart b/lib/models_new/fav/fav_pgc/config_attrs.dart
deleted file mode 100644
index 1668484e9e..0000000000
--- a/lib/models_new/fav/fav_pgc/config_attrs.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/cc_on_lock.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/highlight_ineffective_hd.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/highlight_ineffective_ott.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/highlight_ineffective_pink.dart';
-
-class ConfigAttrs {
- CcOnLock? ccOnLock;
- HighlightIneffectiveHd? highlightIneffectiveHd;
- HighlightIneffectiveOtt? highlightIneffectiveOtt;
- HighlightIneffectivePink? highlightIneffectivePink;
-
- ConfigAttrs({
- this.ccOnLock,
- this.highlightIneffectiveHd,
- this.highlightIneffectiveOtt,
- this.highlightIneffectivePink,
- });
-
- factory ConfigAttrs.fromJson(Map json) => ConfigAttrs(
- ccOnLock: json['cc_on_lock'] == null
- ? null
- : CcOnLock.fromJson(json['cc_on_lock'] as Map),
- highlightIneffectiveHd: json['highlight_ineffective_hd'] == null
- ? null
- : HighlightIneffectiveHd.fromJson(
- json['highlight_ineffective_hd'] as Map,
- ),
- highlightIneffectiveOtt: json['highlight_ineffective_ott'] == null
- ? null
- : HighlightIneffectiveOtt.fromJson(
- json['highlight_ineffective_ott'] as Map,
- ),
- highlightIneffectivePink: json['highlight_ineffective_pink'] == null
- ? null
- : HighlightIneffectivePink.fromJson(
- json['highlight_ineffective_pink'] as Map,
- ),
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/content_attr.dart b/lib/models_new/fav/fav_pgc/content_attr.dart
deleted file mode 100644
index ecb4beba08..0000000000
--- a/lib/models_new/fav/fav_pgc/content_attr.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/multi_img.dart';
-
-class ContentAttr {
- String? text;
- String? bgColor;
- String? bgColorNight;
- String? img;
- MultiImg? multiImg;
-
- ContentAttr({
- this.text,
- this.bgColor,
- this.bgColorNight,
- this.img,
- this.multiImg,
- });
-
- factory ContentAttr.fromJson(Map json) => ContentAttr(
- text: json['text'] as String?,
- bgColor: json['bg_color'] as String?,
- bgColorNight: json['bg_color_night'] as String?,
- img: json['img'] as String?,
- multiImg: json['multi_img'] == null
- ? null
- : MultiImg.fromJson(json['multi_img'] as Map),
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/data.dart b/lib/models_new/fav/fav_pgc/data.dart
index db84fd9b3f..24ed24b73e 100644
--- a/lib/models_new/fav/fav_pgc/data.dart
+++ b/lib/models_new/fav/fav_pgc/data.dart
@@ -2,18 +2,14 @@ import 'package:PiliPlus/models_new/fav/fav_pgc/list.dart';
class FavPgcData {
List? list;
- int? pn;
- int? ps;
int? total;
- FavPgcData({this.list, this.pn, this.ps, this.total});
+ FavPgcData({this.list, this.total});
factory FavPgcData.fromJson(Map json) => FavPgcData(
list: (json['list'] as List?)
?.map((e) => FavPgcItemModel.fromJson(e as Map))
.toList(),
- pn: json['pn'] as int?,
- ps: json['ps'] as int?,
total: json['total'] as int?,
);
}
diff --git a/lib/models_new/fav/fav_pgc/first_ep_info.dart b/lib/models_new/fav/fav_pgc/first_ep_info.dart
deleted file mode 100644
index 452f637def..0000000000
--- a/lib/models_new/fav/fav_pgc/first_ep_info.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-class FirstEpInfo {
- int? id;
- String? cover;
- String? title;
- String? longTitle;
- String? pubTime;
- int? duration;
-
- FirstEpInfo({
- this.id,
- this.cover,
- this.title,
- this.longTitle,
- this.pubTime,
- this.duration,
- });
-
- factory FirstEpInfo.fromJson(Map json) => FirstEpInfo(
- id: json['id'] as int?,
- cover: json['cover'] as String?,
- title: json['title'] as String?,
- longTitle: json['long_title'] as String?,
- pubTime: json['pub_time'] as String?,
- duration: json['duration'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/highlight_ineffective_hd.dart b/lib/models_new/fav/fav_pgc/highlight_ineffective_hd.dart
deleted file mode 100644
index 38753864b9..0000000000
--- a/lib/models_new/fav/fav_pgc/highlight_ineffective_hd.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class HighlightIneffectiveHd {
- String? typeUrl;
-
- HighlightIneffectiveHd({this.typeUrl});
-
- factory HighlightIneffectiveHd.fromJson(Map json) {
- return HighlightIneffectiveHd(
- typeUrl: json['type_url'] as String?,
- );
- }
-}
diff --git a/lib/models_new/fav/fav_pgc/highlight_ineffective_ott.dart b/lib/models_new/fav/fav_pgc/highlight_ineffective_ott.dart
deleted file mode 100644
index 60961e665d..0000000000
--- a/lib/models_new/fav/fav_pgc/highlight_ineffective_ott.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class HighlightIneffectiveOtt {
- String? typeUrl;
-
- HighlightIneffectiveOtt({this.typeUrl});
-
- factory HighlightIneffectiveOtt.fromJson(Map json) {
- return HighlightIneffectiveOtt(
- typeUrl: json['type_url'] as String?,
- );
- }
-}
diff --git a/lib/models_new/fav/fav_pgc/highlight_ineffective_pink.dart b/lib/models_new/fav/fav_pgc/highlight_ineffective_pink.dart
deleted file mode 100644
index 3f0433e384..0000000000
--- a/lib/models_new/fav/fav_pgc/highlight_ineffective_pink.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class HighlightIneffectivePink {
- String? typeUrl;
-
- HighlightIneffectivePink({this.typeUrl});
-
- factory HighlightIneffectivePink.fromJson(Map json) {
- return HighlightIneffectivePink(
- typeUrl: json['type_url'] as String?,
- );
- }
-}
diff --git a/lib/models_new/fav/fav_pgc/list.dart b/lib/models_new/fav/fav_pgc/list.dart
index 70a711fcde..5dacc8ce84 100644
--- a/lib/models_new/fav/fav_pgc/list.dart
+++ b/lib/models_new/fav/fav_pgc/list.dart
@@ -1,208 +1,39 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/area.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/badge_info.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/badge_infos.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/config_attrs.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/first_ep_info.dart';
import 'package:PiliPlus/models_new/fav/fav_pgc/new_ep.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/producer.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/publish.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/rating.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/rights.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/section.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/series.dart';
-import 'package:PiliPlus/models_new/fav/fav_pgc/stat.dart';
import 'package:PiliPlus/pages/common/multi_select/base.dart';
-import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class FavPgcItemModel with MultiSelectData {
int? seasonId;
- int? mediaId;
- int? seasonType;
- String? seasonTypeName;
String? title;
String? cover;
- int? totalCount;
int? isFinish;
- int? isStarted;
- int? isPlay;
String? badge;
- int? badgeType;
- Rights? rights;
- Stat? stat;
NewEp? newEp;
- Rating? rating;
- String? squareCover;
- int? seasonStatus;
- String? seasonTitle;
- String? badgeEp;
- int? mediaAttr;
- int? seasonAttr;
- String? evaluate;
- List? areas;
- String? subtitle;
- int? firstEp;
- int? canWatch;
- Series? series;
- Publish? publish;
- int? mode;
- List? section;
- String? url;
- BadgeInfo? badgeInfo;
String? renewalTime;
- FirstEpInfo? firstEpInfo;
- int? formalEpCount;
- String? shortUrl;
- BadgeInfos? badgeInfos;
- String? seasonVersion;
- String? horizontalCover169;
- String? horizontalCover1610;
- String? subtitle14;
- int? viewableCrowdType;
- List? producers;
- String? summary;
- List? styles;
- ConfigAttrs? configAttrs;
- int? followStatus;
- int? isNew;
String? progress;
- bool? bothFollow;
- String? subtitle25;
FavPgcItemModel({
this.seasonId,
- this.mediaId,
- this.seasonType,
- this.seasonTypeName,
this.title,
this.cover,
- this.totalCount,
this.isFinish,
- this.isStarted,
- this.isPlay,
this.badge,
- this.badgeType,
- this.rights,
- this.stat,
this.newEp,
- this.rating,
- this.squareCover,
- this.seasonStatus,
- this.seasonTitle,
- this.badgeEp,
- this.mediaAttr,
- this.seasonAttr,
- this.evaluate,
- this.areas,
- this.subtitle,
- this.firstEp,
- this.canWatch,
- this.series,
- this.publish,
- this.mode,
- this.section,
- this.url,
- this.badgeInfo,
this.renewalTime,
- this.firstEpInfo,
- this.formalEpCount,
- this.shortUrl,
- this.badgeInfos,
- this.seasonVersion,
- this.horizontalCover169,
- this.horizontalCover1610,
- this.subtitle14,
- this.viewableCrowdType,
- this.producers,
- this.summary,
- this.styles,
- this.configAttrs,
- this.followStatus,
- this.isNew,
this.progress,
- this.bothFollow,
- this.subtitle25,
});
factory FavPgcItemModel.fromJson(
Map json,
) => FavPgcItemModel(
seasonId: json['season_id'] as int?,
- mediaId: json['media_id'] as int?,
- seasonType: json['season_type'] as int?,
- seasonTypeName: json['season_type_name'] as String?,
title: json['title'] as String?,
cover: json['cover'] as String?,
- totalCount: json['total_count'] as int?,
isFinish: json['is_finish'] as int?,
- isStarted: json['is_started'] as int?,
- isPlay: json['is_play'] as int?,
badge: json['badge'] as String?,
- badgeType: json['badge_type'] as int?,
- rights: json['rights'] == null
- ? null
- : Rights.fromJson(json['rights'] as Map),
- stat: json['stat'] == null
- ? null
- : Stat.fromJson(json['stat'] as Map),
newEp: json['new_ep'] == null
? null
: NewEp.fromJson(json['new_ep'] as Map),
- rating: json['rating'] == null
- ? null
- : Rating.fromJson(json['rating'] as Map),
- squareCover: json['square_cover'] as String?,
- seasonStatus: json['season_status'] as int?,
- seasonTitle: json['season_title'] as String?,
- badgeEp: json['badge_ep'] as String?,
- mediaAttr: json['media_attr'] as int?,
- seasonAttr: json['season_attr'] as int?,
- evaluate: json['evaluate'] as String?,
- areas: (json['areas'] as List?)
- ?.map((e) => Area.fromJson(e as Map))
- .toList(),
- subtitle: json['subtitle'] as String?,
- firstEp: json['first_ep'] as int?,
- canWatch: json['can_watch'] as int?,
- series: json['series'] == null
- ? null
- : Series.fromJson(json['series'] as Map),
- publish: json['publish'] == null
- ? null
- : Publish.fromJson(json['publish'] as Map),
- mode: json['mode'] as int?,
- section: (json['section'] as List?)
- ?.map((e) => Section.fromJson(e as Map))
- .toList(),
- url: json['url'] as String?,
- badgeInfo: json['badge_info'] == null
- ? null
- : BadgeInfo.fromJson(json['badge_info'] as Map),
renewalTime: json['renewal_time'] as String?,
- firstEpInfo: json['first_ep_info'] == null
- ? null
- : FirstEpInfo.fromJson(json['first_ep_info'] as Map),
- formalEpCount: json['formal_ep_count'] as int?,
- shortUrl: json['short_url'] as String?,
- badgeInfos: json['badge_infos'] == null
- ? null
- : BadgeInfos.fromJson(json['badge_infos'] as Map),
- seasonVersion: json['season_version'] as String?,
- horizontalCover169: json['horizontal_cover_16_9'] as String?,
- horizontalCover1610: json['horizontal_cover_16_10'] as String?,
- subtitle14: json['subtitle_14'] as String?,
- viewableCrowdType: json['viewable_crowd_type'] as int?,
- producers: (json['producers'] as List?)
- ?.map((e) => Producer.fromJson(e as Map))
- .toList(),
- summary: json['summary'] as String?,
- styles: (json['styles'] as List?)?.fromCast(),
- configAttrs: json['config_attrs'] == null
- ? null
- : ConfigAttrs.fromJson(json['config_attrs'] as Map),
- followStatus: json['follow_status'] as int?,
- isNew: json['is_new'] as int?,
progress: json['progress'] == '' ? null : json['progress'],
- bothFollow: json['both_follow'] as bool?,
- subtitle25: json['subtitle_25'] as String?,
);
}
diff --git a/lib/models_new/fav/fav_pgc/multi_img.dart b/lib/models_new/fav/fav_pgc/multi_img.dart
deleted file mode 100644
index fbb762ba76..0000000000
--- a/lib/models_new/fav/fav_pgc/multi_img.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class MultiImg {
- String? color;
- String? mediumRemind;
-
- MultiImg({this.color, this.mediumRemind});
-
- factory MultiImg.fromJson(Map json) => MultiImg(
- color: json['color'] as String?,
- mediumRemind: json['medium_remind'] as String?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/new_ep.dart b/lib/models_new/fav/fav_pgc/new_ep.dart
index 6c1bda5db5..909748e80b 100644
--- a/lib/models_new/fav/fav_pgc/new_ep.dart
+++ b/lib/models_new/fav/fav_pgc/new_ep.dart
@@ -1,29 +1,11 @@
class NewEp {
- int? id;
String? indexShow;
- String? cover;
- String? title;
- String? longTitle;
- String? pubTime;
- int? duration;
NewEp({
- this.id,
this.indexShow,
- this.cover,
- this.title,
- this.longTitle,
- this.pubTime,
- this.duration,
});
factory NewEp.fromJson(Map json) => NewEp(
- id: json['id'] as int?,
indexShow: json['index_show'] as String?,
- cover: json['cover'] as String?,
- title: json['title'] as String?,
- longTitle: json['long_title'] as String?,
- pubTime: json['pub_time'] as String?,
- duration: json['duration'] as int?,
);
}
diff --git a/lib/models_new/fav/fav_pgc/producer.dart b/lib/models_new/fav/fav_pgc/producer.dart
deleted file mode 100644
index e08790a572..0000000000
--- a/lib/models_new/fav/fav_pgc/producer.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-class Producer {
- int? mid;
- int? type;
- int? isContribute;
- String? title;
-
- Producer({this.mid, this.type, this.isContribute, this.title});
-
- factory Producer.fromJson(Map json) => Producer(
- mid: json['mid'] as int?,
- type: json['type'] as int?,
- isContribute: json['is_contribute'] as int?,
- title: json['title'] as String?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/publish.dart b/lib/models_new/fav/fav_pgc/publish.dart
deleted file mode 100644
index a0be984fc8..0000000000
--- a/lib/models_new/fav/fav_pgc/publish.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-class Publish {
- String? pubTime;
- String? pubTimeShow;
- String? releaseDate;
- String? releaseDateShow;
-
- Publish({
- this.pubTime,
- this.pubTimeShow,
- this.releaseDate,
- this.releaseDateShow,
- });
-
- factory Publish.fromJson(Map json) => Publish(
- pubTime: json['pub_time'] as String?,
- pubTimeShow: json['pub_time_show'] as String?,
- releaseDate: json['release_date'] as String?,
- releaseDateShow: json['release_date_show'] as String?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/rating.dart b/lib/models_new/fav/fav_pgc/rating.dart
deleted file mode 100644
index 4b7e6fd9f0..0000000000
--- a/lib/models_new/fav/fav_pgc/rating.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-class Rating {
- double? score;
- int? count;
-
- Rating({this.score, this.count});
-
- factory Rating.fromJson(Map json) => Rating(
- score: (json['score'] as num?)?.toDouble(),
- count: json['count'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/rights.dart b/lib/models_new/fav/fav_pgc/rights.dart
deleted file mode 100644
index 3882f251d0..0000000000
--- a/lib/models_new/fav/fav_pgc/rights.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class Rights {
- int? allowReview;
- int? allowPreview;
- int? isSelection;
- int? selectionStyle;
- int? isRcmd;
-
- Rights({
- this.allowReview,
- this.allowPreview,
- this.isSelection,
- this.selectionStyle,
- this.isRcmd,
- });
-
- factory Rights.fromJson(Map json) => Rights(
- allowReview: json['allow_review'] as int?,
- allowPreview: json['allow_preview'] as int?,
- isSelection: json['is_selection'] as int?,
- selectionStyle: json['selection_style'] as int?,
- isRcmd: json['is_rcmd'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/section.dart b/lib/models_new/fav/fav_pgc/section.dart
deleted file mode 100644
index 100ddd7248..0000000000
--- a/lib/models_new/fav/fav_pgc/section.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-import 'package:PiliPlus/utils/extension/iterable_ext.dart';
-
-class Section {
- int? sectionId;
- int? seasonId;
- int? limitGroup;
- int? watchPlatform;
- String? copyright;
- int? banAreaShow;
- List? episodeIds;
-
- Section({
- this.sectionId,
- this.seasonId,
- this.limitGroup,
- this.watchPlatform,
- this.copyright,
- this.banAreaShow,
- this.episodeIds,
- });
-
- factory Section.fromJson(Map json) => Section(
- sectionId: json['section_id'] as int?,
- seasonId: json['season_id'] as int?,
- limitGroup: json['limit_group'] as int?,
- watchPlatform: json['watch_platform'] as int?,
- copyright: json['copyright'] as String?,
- banAreaShow: json['ban_area_show'] as int?,
- episodeIds: (json['episode_ids'] as List?)?.fromCast(),
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/series.dart b/lib/models_new/fav/fav_pgc/series.dart
deleted file mode 100644
index 82a195e3ef..0000000000
--- a/lib/models_new/fav/fav_pgc/series.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class Series {
- int? seriesId;
- String? title;
- int? seasonCount;
- int? newSeasonId;
- int? seriesOrd;
-
- Series({
- this.seriesId,
- this.title,
- this.seasonCount,
- this.newSeasonId,
- this.seriesOrd,
- });
-
- factory Series.fromJson(Map json) => Series(
- seriesId: json['series_id'] as int?,
- title: json['title'] as String?,
- seasonCount: json['season_count'] as int?,
- newSeasonId: json['new_season_id'] as int?,
- seriesOrd: json['series_ord'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/stat.dart b/lib/models_new/fav/fav_pgc/stat.dart
deleted file mode 100644
index 07674e8a7a..0000000000
--- a/lib/models_new/fav/fav_pgc/stat.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-class Stat {
- int? follow;
- int? view;
- int? danmaku;
- int? reply;
- num? coin;
- int? seriesFollow;
- int? seriesView;
- int? likes;
- int? favorite;
-
- Stat({
- this.follow,
- this.view,
- this.danmaku,
- this.reply,
- this.coin,
- this.seriesFollow,
- this.seriesView,
- this.likes,
- this.favorite,
- });
-
- factory Stat.fromJson(Map json) => Stat(
- follow: json['follow'] as int?,
- view: json['view'] as int?,
- danmaku: json['danmaku'] as int?,
- reply: json['reply'] as int?,
- coin: json['coin'] as num?,
- seriesFollow: json['series_follow'] as int?,
- seriesView: json['series_view'] as int?,
- likes: json['likes'] as int?,
- favorite: json['favorite'] as int?,
- );
-}
diff --git a/lib/models_new/fav/fav_pgc/vip_or_pay.dart b/lib/models_new/fav/fav_pgc/vip_or_pay.dart
deleted file mode 100644
index 2b8f305680..0000000000
--- a/lib/models_new/fav/fav_pgc/vip_or_pay.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'package:PiliPlus/models_new/fav/fav_pgc/multi_img.dart';
-
-class VipOrPay {
- String? text;
- String? bgColor;
- String? bgColorNight;
- String? img;
- MultiImg? multiImg;
-
- VipOrPay({
- this.text,
- this.bgColor,
- this.bgColorNight,
- this.img,
- this.multiImg,
- });
-
- factory VipOrPay.fromJson(Map json) => VipOrPay(
- text: json['text'] as String?,
- bgColor: json['bg_color'] as String?,
- bgColorNight: json['bg_color_night'] as String?,
- img: json['img'] as String?,
- multiImg: json['multi_img'] == null
- ? null
- : MultiImg.fromJson(json['multi_img'] as Map),
- );
-}
diff --git a/lib/models_new/fav/fav_topic/page_info.dart b/lib/models_new/fav/fav_topic/page_info.dart
index 6974f79cd1..0962db4db3 100644
--- a/lib/models_new/fav/fav_topic/page_info.dart
+++ b/lib/models_new/fav/fav_topic/page_info.dart
@@ -1,11 +1,9 @@
class PageInfo {
- int? curPageNum;
int? total;
- PageInfo({this.curPageNum, this.total});
+ PageInfo({this.total});
factory PageInfo.fromJson(Map json) => PageInfo(
- curPageNum: json['cur_page_num'] as int?,
total: json['total'] as int?,
);
}
diff --git a/lib/models_new/fav/fav_topic/topic_item.dart b/lib/models_new/fav/fav_topic/topic_item.dart
index e008a87d30..43fdaed888 100644
--- a/lib/models_new/fav/fav_topic/topic_item.dart
+++ b/lib/models_new/fav/fav_topic/topic_item.dart
@@ -1,29 +1,14 @@
class FavTopicItem {
int? id;
String? name;
- int? view;
- int? discuss;
- String? jumpUrl;
- String? statDesc;
- bool? showInteractData;
FavTopicItem({
this.id,
this.name,
- this.view,
- this.discuss,
- this.jumpUrl,
- this.statDesc,
- this.showInteractData,
});
factory FavTopicItem.fromJson(Map json) => FavTopicItem(
id: json['id'] as int?,
name: json['name'] as String?,
- view: json['view'] as int?,
- discuss: json['discuss'] as int?,
- jumpUrl: json['jump_url'] as String?,
- statDesc: json['stat_desc'] as String?,
- showInteractData: json['show_interact_data'] as bool?,
);
}
diff --git a/lib/models_new/follow/list.dart b/lib/models_new/follow/list.dart
index f9a53e13fa..92c9c1d485 100644
--- a/lib/models_new/follow/list.dart
+++ b/lib/models_new/follow/list.dart
@@ -3,35 +3,22 @@ import 'package:PiliPlus/models/model_avatar.dart';
class FollowItemModel extends UpItem {
int? attribute;
- int? mtime;
- dynamic tag;
- int? special;
String? sign;
BaseOfficialVerify? officialVerify;
- Vip? vip;
- String? followTime;
FollowItemModel({
required super.mid,
this.attribute,
- this.mtime,
- this.tag,
- this.special,
super.uname,
super.face,
this.sign,
this.officialVerify,
- this.vip,
- this.followTime,
});
factory FollowItemModel.fromJson(Map json) =>
FollowItemModel(
mid: json['mid'] as int? ?? 0,
attribute: json['attribute'] as int?,
- mtime: json['mtime'] as int?,
- tag: json['tag'] as dynamic,
- special: json['special'] as int?,
uname: json['uname'] as String?,
face: json['face'] as String?,
sign: json['sign'] as String?,
@@ -40,9 +27,5 @@ class FollowItemModel extends UpItem {
: BaseOfficialVerify.fromJson(
json['official_verify'] as Map,
),
- vip: json['vip'] == null
- ? null
- : Vip.fromJson(json['vip'] as Map),
- followTime: json['follow_time'] as String?,
);
}
diff --git a/lib/models_new/history/cursor.dart b/lib/models_new/history/cursor.dart
deleted file mode 100644
index a644dcd323..0000000000
--- a/lib/models_new/history/cursor.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-class Cursor {
- int? max;
- int? viewAt;
- String? business;
- int? ps;
-
- Cursor({this.max, this.viewAt, this.business, this.ps});
-
- factory Cursor.fromJson(Map json) => Cursor(
- max: json['max'] as int?,
- viewAt: json['view_at'] as int?,
- business: json['business'] as String?,
- ps: json['ps'] as int?,
- );
-}
diff --git a/lib/models_new/history/data.dart b/lib/models_new/history/data.dart
index 3f6e96f02a..624a352e82 100644
--- a/lib/models_new/history/data.dart
+++ b/lib/models_new/history/data.dart
@@ -1,18 +1,13 @@
-import 'package:PiliPlus/models_new/history/cursor.dart';
import 'package:PiliPlus/models_new/history/list.dart';
import 'package:PiliPlus/models_new/history/tab.dart';
class HistoryData {
- Cursor? cursor;
List? tab;
List? list;
- HistoryData({this.cursor, this.tab, this.list});
+ HistoryData({this.tab, this.list});
factory HistoryData.fromJson(Map json) => HistoryData(
- cursor: json['cursor'] == null
- ? null
- : Cursor.fromJson(json['cursor'] as Map),
tab: (json['tab'] as List?)
?.map((e) => HistoryTab.fromJson(e as Map))
.toList(),
diff --git a/lib/models_new/history/history.dart b/lib/models_new/history/history.dart
index b9b45f4c2c..5a2e734946 100644
--- a/lib/models_new/history/history.dart
+++ b/lib/models_new/history/history.dart
@@ -4,7 +4,6 @@ class History {
String? bvid;
int? page;
int? cid;
- String? part;
String? business;
History({
@@ -13,7 +12,6 @@ class History {
this.bvid,
this.page,
this.cid,
- this.part,
this.business,
});
@@ -23,7 +21,6 @@ class History {
bvid: json['bvid'],
page: json['page'],
cid: json['cid'] == 0 ? null : json['cid'],
- part: json['part'],
business: json['business'],
);
}
diff --git a/lib/models_new/history/list.dart b/lib/models_new/history/list.dart
index 2c9d485f3a..21540a18bf 100644
--- a/lib/models_new/history/list.dart
+++ b/lib/models_new/history/list.dart
@@ -4,24 +4,18 @@ import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class HistoryItemModel with MultiSelectData {
String? title;
- String? longTitle;
String? cover;
List? covers;
String? uri;
late History history;
int? videos;
String? authorName;
- String? authorFace;
int? authorMid;
int? viewAt;
int? progress;
String? badge;
String? showTitle;
int? duration;
- String? current;
- int? total;
- String? newDesc;
- int? isFinish;
int? isFav;
int? kid;
String? tagName;
@@ -29,24 +23,18 @@ class HistoryItemModel with MultiSelectData {
HistoryItemModel({
this.title,
- this.longTitle,
this.cover,
this.covers,
this.uri,
required this.history,
this.videos,
this.authorName,
- this.authorFace,
this.authorMid,
this.viewAt,
this.progress,
this.badge,
this.showTitle,
this.duration,
- this.current,
- this.total,
- this.newDesc,
- this.isFinish,
this.isFav,
this.kid,
this.tagName,
@@ -56,7 +44,6 @@ class HistoryItemModel with MultiSelectData {
factory HistoryItemModel.fromJson(Map json) =>
HistoryItemModel(
title: json['title'] as String?,
- longTitle: json['long_title'] as String?,
cover: json['cover'] as String?,
covers: (json['covers'] as List?)?.fromCast(),
uri: json['uri'] as String?,
@@ -65,17 +52,12 @@ class HistoryItemModel with MultiSelectData {
: History.fromJson(json['history'] as Map),
videos: json['videos'] as int?,
authorName: json['author_name'] as String?,
- authorFace: json['author_face'] as String?,
authorMid: json['author_mid'] as int?,
viewAt: json['view_at'] as int?,
progress: json['progress'] as int?,
badge: json['badge'] as String?,
showTitle: json['show_title'] as String?,
duration: json['duration'] as int?,
- current: json['current'] as String?,
- total: json['total'] as int?,
- newDesc: json['new_desc'] as String?,
- isFinish: json['is_finish'] as int?,
isFav: json['is_fav'] as int?,
kid: json['kid'] as int?,
tagName: json['tag_name'] as String?,
diff --git a/lib/models_new/later/bangumi.dart b/lib/models_new/later/bangumi.dart
index 0b1a55efb2..a0dc2df203 100644
--- a/lib/models_new/later/bangumi.dart
+++ b/lib/models_new/later/bangumi.dart
@@ -2,24 +2,15 @@ import 'package:PiliPlus/models_new/later/season.dart';
class Bangumi {
int? epId;
- String? title;
- String? longTitle;
- String? cover;
Season? season;
Bangumi({
this.epId,
- this.title,
- this.longTitle,
- this.cover,
this.season,
});
factory Bangumi.fromJson(Map json) => Bangumi(
epId: json['ep_id'] as int?,
- title: json['title'] as String?,
- longTitle: json['long_title'] as String?,
- cover: json['cover'] as String?,
season: json['season'] == null
? null
: Season.fromJson(json['season'] as Map),
diff --git a/lib/models_new/later/list.dart b/lib/models_new/later/list.dart
index 088a299cfb..195c417e18 100644
--- a/lib/models_new/later/list.dart
+++ b/lib/models_new/later/list.dart
@@ -1,6 +1,5 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/later/bangumi.dart';
-import 'package:PiliPlus/models_new/later/page.dart';
import 'package:PiliPlus/models_new/later/rights.dart';
import 'package:PiliPlus/models_new/later/stat.dart';
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
@@ -8,7 +7,6 @@ import 'package:PiliPlus/pages/common/multi_select/base.dart';
class LaterItemModel with MultiSelectData {
int? aid;
- int? videos;
String? pic;
String? title;
String? subtitle;
@@ -18,7 +16,6 @@ class LaterItemModel with MultiSelectData {
Rights? rights;
Owner? owner;
Stat? stat;
- List? pages;
Bangumi? bangumi;
int? cid;
int? progress;
@@ -26,13 +23,11 @@ class LaterItemModel with MultiSelectData {
bool? isPgc;
String? pgcLabel;
bool? isPugv;
- int? seasonId;
bool? isCharging;
Dimension? dimension;
LaterItemModel({
this.aid,
- this.videos,
this.pic,
this.title,
this.subtitle,
@@ -42,7 +37,6 @@ class LaterItemModel with MultiSelectData {
this.rights,
this.owner,
this.stat,
- this.pages,
this.bangumi,
this.cid,
this.progress,
@@ -50,14 +44,12 @@ class LaterItemModel with MultiSelectData {
this.isPgc,
this.pgcLabel,
this.isPugv,
- this.seasonId,
this.isCharging,
this.dimension,
});
factory LaterItemModel.fromJson(Map json) => LaterItemModel(
aid: json['aid'] as int?,
- videos: json['videos'] as int?,
pic: json['pic'] as String?,
title: json['title'] as String?,
pubdate: json['pubdate'] as int?,
@@ -72,9 +64,6 @@ class LaterItemModel with MultiSelectData {
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map),
- pages: (json['pages'] as List?)
- ?.map((e) => Page.fromJson(e as Map))
- .toList(),
bangumi: json['bangumi'] == null
? null
: Bangumi.fromJson(json['bangumi'] as Map),
@@ -90,7 +79,6 @@ class LaterItemModel with MultiSelectData {
isPgc: json['is_pgc'] as bool?,
pgcLabel: json['pgc_label'] == '' ? null : json['pgc_label'],
isPugv: json['is_pugv'] as bool?,
- seasonId: json['season_id'] as int?,
isCharging: json['charging_pay']?['level'] != null,
dimension: json['dimension'] == null
? null
diff --git a/lib/models_new/later/page.dart b/lib/models_new/later/page.dart
deleted file mode 100644
index f902e749cc..0000000000
--- a/lib/models_new/later/page.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-class Page {
- int? cid;
- int? page;
- int? duration;
-
- Page({
- this.cid,
- this.page,
- this.duration,
- });
-
- factory Page.fromJson(Map json) => Page(
- cid: json['cid'] as int?,
- page: json['page'] as int?,
- duration: json['duration'] as int?,
- );
-}
diff --git a/lib/models_new/later/season.dart b/lib/models_new/later/season.dart
index c45969b3f7..3d413a980f 100644
--- a/lib/models_new/later/season.dart
+++ b/lib/models_new/later/season.dart
@@ -1,14 +1,11 @@
class Season {
- int? seasonId;
String? title;
Season({
- this.seasonId,
this.title,
});
factory Season.fromJson(Map json) => Season(
- seasonId: json['season_id'] as int?,
title: json['title'] as String?,
);
}
diff --git a/lib/models_new/later/stat.dart b/lib/models_new/later/stat.dart
index 8c03db17db..fafc04b747 100644
--- a/lib/models_new/later/stat.dart
+++ b/lib/models_new/later/stat.dart
@@ -1,16 +1,13 @@
class Stat {
- int? aid;
int? view;
int? danmaku;
Stat({
- this.aid,
this.view,
this.danmaku,
});
factory Stat.fromJson(Map json) => Stat(
- aid: json['aid'] as int?,
view: json['view'] as int?,
danmaku: json['danmaku'] as int?,
);
diff --git a/lib/models_new/live/live_area_list/area_list.dart b/lib/models_new/live/live_area_list/area_list.dart
index e9d83bb380..e7dfd6b21b 100644
--- a/lib/models_new/live/live_area_list/area_list.dart
+++ b/lib/models_new/live/live_area_list/area_list.dart
@@ -1,17 +1,13 @@
import 'package:PiliPlus/models_new/live/live_area_list/area_item.dart';
class AreaList {
- int? id;
String? name;
- int? parentAreaType;
List? areaList;
- AreaList({this.id, this.name, this.parentAreaType, this.areaList});
+ AreaList({this.name, this.areaList});
factory AreaList.fromJson(Map json) => AreaList(
- id: json['id'] as int?,
name: json['name'] ?? '',
- parentAreaType: json['parent_area_type'] as int?,
areaList: (json['area_list'] as List?)
?.map((e) => AreaItem.fromJson(e as Map))
.toList(),
diff --git a/lib/models_new/live/live_contribution_rank/item.dart b/lib/models_new/live/live_contribution_rank/item.dart
index 4cc838f0c1..33ea786f41 100644
--- a/lib/models_new/live/live_contribution_rank/item.dart
+++ b/lib/models_new/live/live_contribution_rank/item.dart
@@ -4,7 +4,6 @@ class LiveContributionRankItem {
int? uid;
String? name;
String? face;
- int? rank;
int? score;
UinfoMedal? uinfoMedal;
@@ -12,7 +11,6 @@ class LiveContributionRankItem {
this.uid,
this.name,
this.face,
- this.rank,
this.score,
this.uinfoMedal,
});
@@ -22,7 +20,6 @@ class LiveContributionRankItem {
uid: json['uid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
- rank: json['rank'] as int?,
score: json['score'] as int?,
uinfoMedal: json['uinfo']?['medal'] == null
? null
diff --git a/lib/models_new/live/live_feed_index/card_data_list_item.dart b/lib/models_new/live/live_feed_index/card_data_list_item.dart
index 066924d78e..16e561fd0d 100644
--- a/lib/models_new/live/live_feed_index/card_data_list_item.dart
+++ b/lib/models_new/live/live_feed_index/card_data_list_item.dart
@@ -10,11 +10,8 @@ class CardLiveItem {
String? _systemCover;
String? get systemCover => _systemCover ?? cover;
String? title;
- int? liveTime;
String? areaName;
int? areaV2Id;
- String? areaV2Name;
- String? areaV2ParentName;
int? areaV2ParentId;
WatchedShow? watchedShow;
@@ -26,11 +23,8 @@ class CardLiveItem {
this.cover,
String? systemCover,
this.title,
- this.liveTime,
this.areaName,
this.areaV2Id,
- this.areaV2Name,
- this.areaV2ParentName,
this.areaV2ParentId,
this.watchedShow,
}) : _systemCover = noneNullOrEmptyString(systemCover);
@@ -43,11 +37,8 @@ class CardLiveItem {
cover: json['cover'] as String?,
systemCover: json['system_cover'],
title: json['title'] as String?,
- liveTime: json['live_time'] as int?,
areaName: json['area_name'] as String?,
areaV2Id: json['area_v2_id'] as int?,
- areaV2Name: json['area_v2_name'] as String?,
- areaV2ParentName: json['area_v2_parent_name'] as String?,
areaV2ParentId: json['area_v2_parent_id'] as int?,
watchedShow: json['watched_show'] == null
? null
diff --git a/lib/models_new/live/live_follow/item.dart b/lib/models_new/live/live_follow/item.dart
index 4472d97ed3..3163aa0717 100644
--- a/lib/models_new/live/live_follow/item.dart
+++ b/lib/models_new/live/live_follow/item.dart
@@ -1,37 +1,25 @@
class LiveFollowItem {
int? roomid;
- int? uid;
String? uname;
String? title;
- String? face;
- int? liveStatus;
String? areaName;
- String? areaNameV2;
String? textSmall;
String? roomCover;
LiveFollowItem({
this.roomid,
- this.uid,
this.uname,
this.title,
- this.face,
- this.liveStatus,
this.areaName,
- this.areaNameV2,
this.textSmall,
this.roomCover,
});
factory LiveFollowItem.fromJson(Map json) => LiveFollowItem(
roomid: json['roomid'] as int?,
- uid: json['uid'] as int?,
uname: json['uname'] as String?,
title: json['title'] as String?,
- face: json['face'] as String?,
- liveStatus: json['live_status'] as int?,
areaName: json['area_name'] as String?,
- areaNameV2: json['area_name_v2'] as String?,
textSmall: json['text_small'] as String?,
roomCover: json['room_cover'] as String?,
);
diff --git a/lib/models_new/live/live_medal_wall/data.dart b/lib/models_new/live/live_medal_wall/data.dart
index 9c37865aeb..02b1f844a9 100644
--- a/lib/models_new/live/live_medal_wall/data.dart
+++ b/lib/models_new/live/live_medal_wall/data.dart
@@ -5,16 +5,12 @@ class MedalWallData {
int? count;
String? name;
String? icon;
- int? uid;
- int? level;
MedalWallData({
this.list,
this.count,
this.name,
this.icon,
- this.uid,
- this.level,
});
factory MedalWallData.fromJson(Map json) => MedalWallData(
@@ -24,7 +20,5 @@ class MedalWallData {
count: json['count'] as int?,
name: json['name'] as String?,
icon: json['icon'] as String?,
- uid: json['uid'] as int?,
- level: json['level'] as int?,
);
}
diff --git a/lib/models_new/live/live_room_info_h5/room_info.dart b/lib/models_new/live/live_room_info_h5/room_info.dart
index 9b575d5849..7d7124bc79 100644
--- a/lib/models_new/live/live_room_info_h5/room_info.dart
+++ b/lib/models_new/live/live_room_info_h5/room_info.dart
@@ -1,35 +1,20 @@
class RoomInfo {
int? uid;
- int? roomId;
String? title;
String? cover;
- int? liveStatus;
- int? liveStartTime;
- int? online;
String? appBackground;
- String? subSessionKey;
RoomInfo({
this.uid,
- this.roomId,
this.title,
this.cover,
- this.liveStatus,
- this.liveStartTime,
- this.online,
this.appBackground,
- this.subSessionKey,
});
factory RoomInfo.fromJson(Map json) => RoomInfo(
uid: json['uid'] as int?,
- roomId: json['room_id'] as int?,
title: json['title'] as String?,
cover: json['cover'] as String?,
- liveStatus: json['live_status'] as int?,
- liveStartTime: json['live_start_time'] as int?,
- online: json['online'] as int?,
appBackground: json['app_background'] as String?,
- subSessionKey: json['sub_session_key'] as String?,
);
}
diff --git a/lib/models_new/live/live_room_play_info/codec.dart b/lib/models_new/live/live_room_play_info/codec.dart
index f918cf1c18..1f295cde20 100644
--- a/lib/models_new/live/live_room_play_info/codec.dart
+++ b/lib/models_new/live/live_room_play_info/codec.dart
@@ -2,39 +2,24 @@ import 'package:PiliPlus/models_new/live/live_room_play_info/url_info.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
class CodecItem {
- String? codecName;
int? currentQn;
List? acceptQn;
String? baseUrl;
List? urlInfo;
- dynamic hdrQn;
- int? dolbyType;
- String? attrName;
- int? hdrType;
CodecItem({
- this.codecName,
this.currentQn,
this.acceptQn,
this.baseUrl,
this.urlInfo,
- this.hdrQn,
- this.dolbyType,
- this.attrName,
- this.hdrType,
});
factory CodecItem.fromJson(Map json) => CodecItem(
- codecName: json['codec_name'] as String?,
currentQn: json['current_qn'] as int?,
acceptQn: (json['accept_qn'] as List?)?.fromCast(),
baseUrl: json['base_url'] as String?,
urlInfo: (json['url_info'] as List?)
?.map((e) => UrlInfo.fromJson(e as Map))
.toList(),
- hdrQn: json['hdr_qn'] as dynamic,
- dolbyType: json['dolby_type'] as int?,
- attrName: json['attr_name'] as String?,
- hdrType: json['hdr_type'] as int?,
);
}
diff --git a/lib/models_new/live/live_room_play_info/format.dart b/lib/models_new/live/live_room_play_info/format.dart
index 25d0578d88..afd8de5c53 100644
--- a/lib/models_new/live/live_room_play_info/format.dart
+++ b/lib/models_new/live/live_room_play_info/format.dart
@@ -1,17 +1,13 @@
import 'package:PiliPlus/models_new/live/live_room_play_info/codec.dart';
class Format {
- String? formatName;
List? codec;
- String? masterUrl;
- Format({this.formatName, this.codec, this.masterUrl});
+ Format({this.codec});
factory Format.fromJson(Map json) => Format(
- formatName: json['format_name'] as String?,
codec: (json['codec'] as List?)
?.map((e) => CodecItem.fromJson(e as Map))
.toList(),
- masterUrl: json['master_url'] as String?,
);
}
diff --git a/lib/models_new/live/live_room_play_info/playurl.dart b/lib/models_new/live/live_room_play_info/playurl.dart
index f8b220fb9e..07977bb3d0 100644
--- a/lib/models_new/live/live_room_play_info/playurl.dart
+++ b/lib/models_new/live/live_room_play_info/playurl.dart
@@ -1,16 +1,13 @@
import 'package:PiliPlus/models_new/live/live_room_play_info/stream.dart';
class Playurl {
- int? cid;
List? stream;
Playurl({
- this.cid,
this.stream,
});
factory Playurl.fromJson(Map json) => Playurl(
- cid: json['cid'] as int?,
stream: (json['stream'] as List?)
?.map((e) => Stream.fromJson(e as Map))
.toList(),
diff --git a/lib/models_new/live/live_room_play_info/stream.dart b/lib/models_new/live/live_room_play_info/stream.dart
index 189d6eddec..18b3a6578c 100644
--- a/lib/models_new/live/live_room_play_info/stream.dart
+++ b/lib/models_new/live/live_room_play_info/stream.dart
@@ -1,13 +1,11 @@
import 'package:PiliPlus/models_new/live/live_room_play_info/format.dart';
class Stream {
- String? protocolName;
List? format;
- Stream({this.protocolName, this.format});
+ Stream({this.format});
factory Stream.fromJson(Map json) => Stream(
- protocolName: json['protocol_name'] as String?,
format: (json['format'] as List?)
?.map((e) => Format.fromJson(e as Map))
.toList(),
diff --git a/lib/models_new/live/live_room_play_info/url_info.dart b/lib/models_new/live/live_room_play_info/url_info.dart
index 1252553a00..d32d111d31 100644
--- a/lib/models_new/live/live_room_play_info/url_info.dart
+++ b/lib/models_new/live/live_room_play_info/url_info.dart
@@ -1,13 +1,11 @@
class UrlInfo {
String? host;
String? extra;
- int? streamTtl;
- UrlInfo({this.host, this.extra, this.streamTtl});
+ UrlInfo({this.host, this.extra});
factory UrlInfo.fromJson(Map