Merge branch 'main' into fix-seasonChange
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
@ -21,9 +23,6 @@ if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
def keystoreProperties = new Properties()
|
||||
@ -37,8 +36,9 @@ def _keyAlias = System.getenv("KEY_ALIAS") ?: keystoreProperties["keyAlias"]
|
||||
def _keyPassword = System.getenv("KEY_PASSWORD") ?: keystoreProperties["keyPassword"]
|
||||
|
||||
android {
|
||||
namespace "com.guozhigq.pilipala"
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
ndkVersion flutter.ndkVersion
|
||||
ndkVersion "27.0.12077973"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
@ -91,9 +91,6 @@ flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
|
||||
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
||||
import com.android.build.OutputFile
|
||||
|
4
android/app/proguard-rules.pro
vendored
Normal file
4
android/app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# missing R8 error
|
||||
-dontwarn javax.annotation.Nullable
|
||||
-dontwarn org.conscrypt.Conscrypt
|
||||
-dontwarn org.conscrypt.OpenSSLProvider
|
@ -12,7 +12,6 @@
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" />
|
||||
</intent>
|
||||
|
||||
</queries>
|
||||
<queries>
|
||||
<intent>
|
||||
@ -20,7 +19,6 @@
|
||||
"android.support.customtabs.action.CustomTabsService" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<queries>
|
||||
<!-- If your app checks for http support -->
|
||||
<intent>
|
||||
@ -34,7 +32,6 @@
|
||||
<data android:scheme="https" />
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<application
|
||||
android:label="PiliPala"
|
||||
android:name="${applicationName}"
|
||||
@ -144,102 +141,55 @@
|
||||
<data android:scheme="bilibili" android:host="assistant" />
|
||||
<data android:scheme="bilibili" android:host="feedback" />
|
||||
<data android:scheme="bilibili" android:host="auth" android:path="/launch" />
|
||||
|
||||
<data android:scheme="http" android:host="live.bilibili.com"
|
||||
android:pathPattern="/live/.*" />
|
||||
<data android:scheme="https" android:host="live.bilibili.com"
|
||||
android:pathPattern="/live/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.tv"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.tv"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/video/.*" />
|
||||
<data android:scheme="http" android:host="m.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="m.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/story/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/story/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/bangumi/i/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/bangumi/i/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/bangumi/i/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/bangumi/i/.*" />
|
||||
<data android:scheme="http" android:host="bangumi.bilibili.com"
|
||||
android:pathPattern="/.*" />
|
||||
<data android:scheme="https" android:host="bangumi.bilibili.com"
|
||||
android:pathPattern="/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/bangumi/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/bangumi/.*" />
|
||||
<data android:scheme="http" android:host="m.bilibili.com"
|
||||
android:pathPattern="/bangumi/.*" />
|
||||
<data android:scheme="https" android:host="m.bilibili.com"
|
||||
android:pathPattern="/bangumi/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ss.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ss.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ep.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ep.*" />
|
||||
<data android:scheme="http" android:host="m.bilibili.com"
|
||||
android:pathPattern="/bangumi/play/ss.*" />
|
||||
<data android:scheme="https" android:host="m.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ss.*" />
|
||||
<data android:scheme="http" android:host="m.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ep.*" />
|
||||
<data android:scheme="https" android:host="m.bilibili.com"
|
||||
android:pathPattern="/cheese/play/ep.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/read/cv.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/read/cv.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com" android:path="/review/" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com" android:path="/review/" />
|
||||
<data android:scheme="http" android:host="bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.cn"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/video/.*" />
|
||||
<data android:scheme="http" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/video/.*" />
|
||||
<data android:scheme="https" android:host="www.bilibili.com"
|
||||
android:pathPattern="/mobile/video/.*" />
|
||||
<data android:scheme="https" android:host="b23.tv"
|
||||
android:pathPattern="/*" />
|
||||
<data android:scheme="https" android:host="space.bilibili.com"
|
||||
android:pathPattern="/*" />
|
||||
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<service
|
||||
@ -251,7 +201,6 @@
|
||||
<action android:name="android.media.browse.MediaBrowserService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name="com.ryanheise.audioservice.MediaButtonReceiver"
|
||||
android:exported="true"
|
||||
@ -259,7 +208,7 @@
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</receiver>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
@ -281,4 +230,4 @@
|
||||
-->
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
</manifest>
|
||||
</manifest>
|
@ -1,15 +1,3 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.9.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
@ -20,6 +8,15 @@ allprojects {
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
afterEvaluate { project ->
|
||||
if (project.hasProperty('android')) {
|
||||
project.android {
|
||||
if (namespace == null) {
|
||||
namespace project.group
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
|
||||
|
@ -1,11 +1,25 @@
|
||||
include ':app'
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}()
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.7.2" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
BIN
assets/images/video/dlna.png
Executable file
BIN
assets/images/video/dlna.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/images/video/fullscreen.png
Executable file
BIN
assets/images/video/fullscreen.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 274 B |
BIN
assets/images/video/fullscreen_exit.png
Executable file
BIN
assets/images/video/fullscreen_exit.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 246 B |
BIN
assets/images/video/pip.png
Executable file
BIN
assets/images/video/pip.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@ -1,8 +1,6 @@
|
||||
PODS:
|
||||
- app_links (0.0.2):
|
||||
- Flutter
|
||||
- appscheme (1.0.4):
|
||||
- Flutter
|
||||
- audio_service (0.0.1):
|
||||
- Flutter
|
||||
- audio_session (0.0.1):
|
||||
@ -71,7 +69,6 @@ PODS:
|
||||
|
||||
DEPENDENCIES:
|
||||
- app_links (from `.symlinks/plugins/app_links/ios`)
|
||||
- appscheme (from `.symlinks/plugins/appscheme/ios`)
|
||||
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
||||
@ -110,8 +107,6 @@ SPEC REPOS:
|
||||
EXTERNAL SOURCES:
|
||||
app_links:
|
||||
:path: ".symlinks/plugins/app_links/ios"
|
||||
appscheme:
|
||||
:path: ".symlinks/plugins/appscheme/ios"
|
||||
audio_service:
|
||||
:path: ".symlinks/plugins/audio_service/ios"
|
||||
audio_session:
|
||||
@ -171,7 +166,6 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
|
||||
appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8
|
||||
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
|
@ -411,17 +411,29 @@ class TitleBar extends StatelessWidget {
|
||||
toolbarHeight: 45,
|
||||
automaticallyImplyLeading: false,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
elevation: 1,
|
||||
scrolledUnderElevation: 1,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
actions: !isFullScreen
|
||||
? [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
const SizedBox(width: 8),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
@ -482,7 +494,7 @@ class EpisodeListItem extends StatelessWidget {
|
||||
dense: false,
|
||||
leading: isCurrentIndex
|
||||
? Image.asset(
|
||||
'assets/images/live.gif',
|
||||
'assets/images/live.png',
|
||||
color: primary,
|
||||
height: 12,
|
||||
)
|
||||
|
126
lib/common/skeleton/video_intro.dart
Normal file
126
lib/common/skeleton/video_intro.dart
Normal file
@ -0,0 +1,126 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../constants.dart';
|
||||
import 'skeleton.dart';
|
||||
|
||||
class VideoIntroSkeleton extends StatelessWidget {
|
||||
const VideoIntroSkeleton({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color bgColor = Theme.of(context).colorScheme.onInverseSurface;
|
||||
return Skeleton(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 18),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 20,
|
||||
margin: const EdgeInsets.only(bottom: 6),
|
||||
color: bgColor,
|
||||
),
|
||||
Container(
|
||||
width: 220,
|
||||
height: 20,
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
color: bgColor,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 35,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
LayoutBuilder(builder: (context, constraints) {
|
||||
// 并列5个正方形
|
||||
double width = (constraints.maxWidth - 30) / 5;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: List.generate(5, (index) {
|
||||
return Container(
|
||||
width: width - 24,
|
||||
height: width - 24,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 30,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
color: bgColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Container(
|
||||
width: 50,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 35,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 55,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
const CustomToast({super.key, required this.msg});
|
||||
|
25
lib/common/widgets/drag_handle.dart
Normal file
25
lib/common/widgets/drag_handle.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DragHandle extends StatelessWidget {
|
||||
const DragHandle({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: Navigator.of(context).pop,
|
||||
child: SizedBox(
|
||||
height: 36,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ import 'package:pilipala/plugin/pl_gallery/hero_dialog_route.dart';
|
||||
import 'package:pilipala/plugin/pl_gallery/interactiveviewer_gallery.dart';
|
||||
import 'package:pilipala/utils/highlight.dart';
|
||||
|
||||
import '../../utils/global_data_cache.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class HtmlRender extends StatelessWidget {
|
||||
const HtmlRender({
|
||||
@ -41,6 +43,8 @@ class HtmlRender extends StatelessWidget {
|
||||
TagExtension(
|
||||
tagsToExtend: <String>{'img'},
|
||||
builder: (ExtensionContext extensionContext) {
|
||||
int defaultImgQuality = 10;
|
||||
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||
try {
|
||||
final Map<String, dynamic> attributes =
|
||||
extensionContext.attributes;
|
||||
@ -99,13 +103,13 @@ class HtmlRender extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: CachedNetworkImage(imageUrl: imgUrl),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: '$imgUrl@${defaultImgQuality}q.webp',
|
||||
),
|
||||
),
|
||||
);
|
||||
// return NetworkImgLayer(
|
||||
// width: isEmote ? 22 : Get.size.width - 24,
|
||||
// height: isEmote ? 22 : 200,
|
||||
// src: imgUrl,
|
||||
// );
|
||||
} catch (err) {
|
||||
return const SizedBox();
|
||||
}
|
||||
@ -138,6 +142,14 @@ class HtmlRender extends StatelessWidget {
|
||||
textAlign: TextAlign.justify,
|
||||
),
|
||||
'img': Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||
'figcaption': Style(
|
||||
textAlign: TextAlign.center,
|
||||
margin: Margins.only(top: 8, bottom: 20),
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
'figure': Style(
|
||||
margin: Margins.zero,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import '../../utils/storage.dart';
|
||||
import '../constants.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class NetworkImgLayer extends StatelessWidget {
|
||||
const NetworkImgLayer({
|
||||
@ -48,7 +48,7 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
int defaultImgQuality = 10;
|
||||
try {
|
||||
defaultImgQuality = GlobalDataCache().imgQuality;
|
||||
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||
} catch (_) {}
|
||||
|
||||
if (src == '' || src == null) {
|
||||
|
@ -12,6 +12,7 @@ import '../../http/video.dart';
|
||||
import '../../utils/utils.dart';
|
||||
import '../constants.dart';
|
||||
import 'badge.dart';
|
||||
import 'drag_handle.dart';
|
||||
import 'network_img_layer.dart';
|
||||
import 'stat/danmu.dart';
|
||||
import 'stat/view.dart';
|
||||
@ -373,27 +374,12 @@ class MorePanel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
ListTile(
|
||||
onTap: () async => await menuActionHandler('block'),
|
||||
minLeadingWidth: 0,
|
||||
|
@ -5,6 +5,7 @@ import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/image_save.dart';
|
||||
import 'package:pilipala/utils/route_push.dart';
|
||||
import '../../models/model_rec_video_item.dart';
|
||||
import 'drag_handle.dart';
|
||||
import 'stat/danmu.dart';
|
||||
import 'stat/view.dart';
|
||||
import '../../http/dynamics.dart';
|
||||
@ -368,27 +369,12 @@ class MorePanel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
ListTile(
|
||||
onTap: () async => await menuActionHandler('block'),
|
||||
minLeadingWidth: 0,
|
||||
|
@ -615,4 +615,15 @@ class Api {
|
||||
|
||||
/// 订阅状态
|
||||
static const String videoRelation = '/x/web-interface/archive/relation';
|
||||
|
||||
/// 获取空降区间
|
||||
static const String getSkipSegments =
|
||||
'${HttpString.sponsorBlockBaseUrl}/api/skipSegments';
|
||||
|
||||
/// 视频标签
|
||||
static const String videoTag = '/x/tag/archive/tags';
|
||||
|
||||
/// 修复标题和海报
|
||||
// /api/view?id=${aid} /all/video/av${aid} /video/av${aid}/
|
||||
static const String fixTitleAndPic = '${HttpString.biliplusBaseUrl}/api/view';
|
||||
}
|
||||
|
@ -1,6 +1,15 @@
|
||||
import 'package:pilipala/models/common/invalid_video.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pilipala/models/sponsor_block/segment.dart';
|
||||
|
||||
import 'index.dart';
|
||||
|
||||
class CommonHttp {
|
||||
static final RegExp spmPrefixExp =
|
||||
RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
||||
static Future unReadDynamic() async {
|
||||
var res = await Request().get(Api.getUnreadDynamic,
|
||||
data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0});
|
||||
@ -14,4 +23,95 @@ class CommonHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future querySkipSegments({required String bvid}) async {
|
||||
var res = await Request().getWithoutCookie(Api.getSkipSegments, data: {
|
||||
'videoID': bvid,
|
||||
});
|
||||
if (res.data is List && res.data.isNotEmpty) {
|
||||
try {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data
|
||||
.map<SegmentDataModel>((e) => SegmentDataModel.fromJson(e))
|
||||
.toList(),
|
||||
};
|
||||
} catch (err) {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': 'sponsorBlock数据解析失败: $err',
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future fixVideoPicAndTitle({required int aid}) async {
|
||||
var res = await Request().getWithoutCookie(Api.fixTitleAndPic, data: {
|
||||
'id': aid,
|
||||
});
|
||||
if (res != null) {
|
||||
if (res.data['code'] == -404) {
|
||||
return {
|
||||
'status': false,
|
||||
'data': null,
|
||||
'msg': '没有相关信息',
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': true,
|
||||
'data': InvalidVideoModel.fromJson(res.data),
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': null,
|
||||
'msg': '没有相关信息',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future buvidActivate() async {
|
||||
try {
|
||||
// 获取 HTML 数据
|
||||
var html = await Request().get(Api.dynamicSpmPrefix);
|
||||
|
||||
// 提取 spmPrefix
|
||||
String spmPrefix = spmPrefixExp.firstMatch(html.data)?.group(1) ?? '';
|
||||
|
||||
// 生成随机 PNG 结束部分
|
||||
Random rand = Random();
|
||||
String randPngEnd = base64.encode(
|
||||
List<int>.generate(32, (_) => rand.nextInt(256))
|
||||
..addAll(List<int>.filled(4, 0))
|
||||
..addAll([73, 69, 78, 68])
|
||||
..addAll(List<int>.generate(4, (_) => rand.nextInt(256))),
|
||||
);
|
||||
|
||||
// 构建 JSON 数据
|
||||
String jsonData = json.encode({
|
||||
'3064': 1,
|
||||
'39c8': '$spmPrefix.fp.risk',
|
||||
'3c43': {
|
||||
'adca': 'Linux',
|
||||
'bfe9': randPngEnd.substring(randPngEnd.length - 50),
|
||||
},
|
||||
});
|
||||
|
||||
// 发送 POST 请求
|
||||
await Request().post(
|
||||
Api.activateBuvidApi,
|
||||
data: {'payload': jsonData},
|
||||
options: Options(contentType: 'application/json'),
|
||||
);
|
||||
} catch (err) {
|
||||
debugPrint('buvidActivate error: $err');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ class HttpString {
|
||||
static const String passBaseUrl = 'https://passport.bilibili.com';
|
||||
static const String messageBaseUrl = 'https://message.bilibili.com';
|
||||
static const String bangumiBaseUrl = 'https://bili.meark.me';
|
||||
static const String sponsorBlockBaseUrl = 'https://www.bsbsb.top';
|
||||
static const String biliplusBaseUrl = 'https://www.biliplus.com';
|
||||
|
||||
static const List<int> validateStatusCodes = [
|
||||
302,
|
||||
304,
|
||||
|
@ -17,7 +17,9 @@ class DanmakaHttp {
|
||||
var response = await Request().get(
|
||||
Api.webDanmaku,
|
||||
data: params,
|
||||
extra: {'resType': ResponseType.bytes},
|
||||
options: Options(
|
||||
responseType: ResponseType.bytes,
|
||||
),
|
||||
);
|
||||
return DmSegMobileReply.fromBuffer(response.data);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class DynamicsHttp {
|
||||
|
||||
//
|
||||
static Future dynamicDetail({
|
||||
String? id,
|
||||
required String id,
|
||||
}) async {
|
||||
var res = await Request().get(Api.dynamicDetail, data: {
|
||||
'timezone_offset': -480,
|
||||
|
@ -1,18 +1,16 @@
|
||||
// ignore_for_file: avoid_print
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:math' show Random;
|
||||
import 'package:cookie_jar/cookie_jar.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/id_utils.dart';
|
||||
import '../utils/storage.dart';
|
||||
import '../utils/utils.dart';
|
||||
import 'api.dart';
|
||||
import 'constants.dart';
|
||||
import 'interceptor.dart';
|
||||
|
||||
@ -21,19 +19,17 @@ class Request {
|
||||
static late CookieManager cookieManager;
|
||||
static late final Dio dio;
|
||||
factory Request() => _instance;
|
||||
Box setting = GStrorage.setting;
|
||||
static Box localCache = GStrorage.localCache;
|
||||
Box setting = GStorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
late bool enableSystemProxy;
|
||||
late String systemProxyHost;
|
||||
late String systemProxyPort;
|
||||
static final RegExp spmPrefixExp =
|
||||
RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
||||
static String? buvid;
|
||||
|
||||
/// 设置cookie
|
||||
static setCookie() async {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
final String cookiePath = await Utils.getCookiePath();
|
||||
final PersistCookieJar cookieJar = PersistCookieJar(
|
||||
ignoreExpires: true,
|
||||
@ -43,7 +39,7 @@ class Request {
|
||||
dio.interceptors.add(cookieManager);
|
||||
final List<Cookie> cookie = await cookieManager.cookieJar
|
||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||
final userInfo = userInfoCache.get('userInfoCache');
|
||||
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||
if (userInfo != null && userInfo.mid != null) {
|
||||
final List<Cookie> cookie2 = await cookieManager.cookieJar
|
||||
.loadForRequest(Uri.parse(HttpString.tUrl));
|
||||
@ -61,11 +57,6 @@ class Request {
|
||||
baseUrlType = 'bangumi';
|
||||
}
|
||||
setBaseUrl(type: baseUrlType);
|
||||
try {
|
||||
await buvidActivate();
|
||||
} catch (e) {
|
||||
log("setCookie, ${e.toString()}");
|
||||
}
|
||||
|
||||
final String cookieString = cookie
|
||||
.map((Cookie cookie) => '${cookie.name}=${cookie.value}')
|
||||
@ -77,7 +68,7 @@ class Request {
|
||||
// 从cookie中获取 csrf token
|
||||
static Future<String> getCsrf() async {
|
||||
List<Cookie> cookies = await cookieManager.cookieJar
|
||||
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
|
||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||
String token = '';
|
||||
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
|
||||
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
|
||||
@ -91,9 +82,12 @@ class Request {
|
||||
}
|
||||
|
||||
final List<Cookie> cookies = await cookieManager.cookieJar
|
||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||
buvid = cookies.firstWhere((cookie) => cookie.name == 'buvid3').value;
|
||||
if (buvid == null) {
|
||||
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
|
||||
buvid = cookies
|
||||
.firstWhere((cookie) => cookie.name == 'buvid3',
|
||||
orElse: () => Cookie('buvid3', ''))
|
||||
.value;
|
||||
if (buvid == null || buvid!.isEmpty) {
|
||||
try {
|
||||
var result = await Request().get(
|
||||
"${HttpString.apiBaseUrl}/x/frontend/finger/spi",
|
||||
@ -121,30 +115,6 @@ class Request {
|
||||
dio.options.headers['referer'] = 'https://www.bilibili.com/';
|
||||
}
|
||||
|
||||
static Future buvidActivate() async {
|
||||
var html = await Request().get(Api.dynamicSpmPrefix);
|
||||
String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
||||
Random rand = Random();
|
||||
String rand_png_end = base64.encode(
|
||||
List<int>.generate(32, (_) => rand.nextInt(256)) +
|
||||
List<int>.filled(4, 0) +
|
||||
[73, 69, 78, 68] +
|
||||
List<int>.generate(4, (_) => rand.nextInt(256)));
|
||||
|
||||
String jsonData = json.encode({
|
||||
'3064': 1,
|
||||
'39c8': '${spmPrefix}.fp.risk',
|
||||
'3c43': {
|
||||
'adca': 'Linux',
|
||||
'bfe9': rand_png_end.substring(rand_png_end.length - 50),
|
||||
},
|
||||
});
|
||||
|
||||
await Request().post(Api.activateBuvidApi,
|
||||
data: {'payload': jsonData},
|
||||
options: Options(contentType: 'application/json'));
|
||||
}
|
||||
|
||||
/*
|
||||
* config it and create
|
||||
*/
|
||||
@ -209,17 +179,13 @@ class Request {
|
||||
*/
|
||||
get(url, {data, Options? options, cancelToken, extra}) async {
|
||||
Response response;
|
||||
options ??= Options(); // 如果 options 为 null,则初始化一个新的 Options 对象
|
||||
ResponseType resType = ResponseType.json;
|
||||
|
||||
if (extra != null) {
|
||||
resType = extra['resType'] ?? ResponseType.json;
|
||||
if (extra['ua'] != null) {
|
||||
options.headers = {'user-agent': headerUa(type: extra['ua'])};
|
||||
options ??= Options();
|
||||
options.headers ??= <String, dynamic>{};
|
||||
options.headers?['user-agent'] = headerUa(type: extra['ua']);
|
||||
}
|
||||
}
|
||||
options.responseType = resType;
|
||||
|
||||
try {
|
||||
response = await dio.get(
|
||||
url,
|
||||
|
@ -4,6 +4,7 @@ import 'package:hive/hive.dart';
|
||||
import 'package:html/parser.dart';
|
||||
import 'package:pilipala/models/member/article.dart';
|
||||
import 'package:pilipala/models/member/like.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import '../common/constants.dart';
|
||||
import '../models/dynamics/result.dart';
|
||||
@ -25,7 +26,7 @@ class MemberHttp {
|
||||
}) async {
|
||||
String? wWebid;
|
||||
if ((await getWWebid(mid: mid))['status']) {
|
||||
wWebid = GlobalDataCache().wWebid;
|
||||
wWebid = GlobalDataCache.wWebid;
|
||||
}
|
||||
|
||||
Map params = await WbiSign().makSign({
|
||||
@ -470,11 +471,11 @@ class MemberHttp {
|
||||
SmartDialog.dismiss();
|
||||
if (res.data['code'] == 0) {
|
||||
String accessKey = res.data['data']['access_token'];
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
var userInfo = userInfoCache.get('userInfoCache');
|
||||
Box localCache = GStorage.localCache;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||
localCache.put(
|
||||
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});
|
||||
LocalCacheKey.accessKey, {'mid': userInfo!.mid, 'value': accessKey});
|
||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
||||
} else {
|
||||
return {
|
||||
@ -573,7 +574,7 @@ class MemberHttp {
|
||||
}
|
||||
|
||||
static Future getWWebid({required int mid}) async {
|
||||
String? wWebid = GlobalDataCache().wWebid;
|
||||
String? wWebid = GlobalDataCache.wWebid;
|
||||
if (wWebid != null) {
|
||||
return {'status': true, 'data': wWebid};
|
||||
}
|
||||
@ -587,7 +588,7 @@ class MemberHttp {
|
||||
final content = match.group(1);
|
||||
String decodedString = Uri.decodeComponent(content!);
|
||||
Map<String, dynamic> map = jsonDecode(decodedString);
|
||||
GlobalDataCache().wWebid = map['access_id'];
|
||||
GlobalDataCache.wWebid = map['access_id'];
|
||||
return {'status': true, 'data': map['access_id']};
|
||||
} else {
|
||||
return {'status': false, 'data': '请检查登录状态'};
|
||||
@ -604,7 +605,7 @@ class MemberHttp {
|
||||
}) async {
|
||||
String? wWebid;
|
||||
if ((await getWWebid(mid: mid))['status']) {
|
||||
wWebid = GlobalDataCache().wWebid;
|
||||
wWebid = GlobalDataCache.wWebid;
|
||||
}
|
||||
Map params = await WbiSign().makSign({
|
||||
'host_mid': mid,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:html/parser.dart';
|
||||
import 'package:pilipala/models/read/opus.dart';
|
||||
import 'package:pilipala/models/read/read.dart';
|
||||
@ -65,6 +66,11 @@ class ReadHttp {
|
||||
var res = await Request().get(
|
||||
'https://www.bilibili.com/read/cv$id',
|
||||
extra: {'ua': 'pc'},
|
||||
options: Options(
|
||||
headers: {
|
||||
'cookie': 'opus-goback=1',
|
||||
},
|
||||
),
|
||||
);
|
||||
String scriptContent =
|
||||
extractScriptContents(parse(res.data).body!.outerHtml)[0];
|
||||
|
@ -11,7 +11,7 @@ import '../utils/storage.dart';
|
||||
import 'index.dart';
|
||||
|
||||
class SearchHttp {
|
||||
static Box setting = GStrorage.setting;
|
||||
static Box setting = GStorage.setting;
|
||||
static Future hotSearchList() async {
|
||||
var res = await Request().get(Api.hotSearchList);
|
||||
if (res.data is String) {
|
||||
|
@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/id_utils.dart';
|
||||
import 'package:pilipala/models/video/tags.dart';
|
||||
import '../common/constants.dart';
|
||||
import '../models/common/reply_type.dart';
|
||||
import '../models/home/rcmd/result.dart';
|
||||
@ -25,11 +26,11 @@ import 'init.dart';
|
||||
/// 返回{'status': bool, 'data': List}
|
||||
/// view层根据 status 判断渲染逻辑
|
||||
class VideoHttp {
|
||||
static Box localCache = GStrorage.localCache;
|
||||
static Box setting = GStrorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
static Box setting = GStorage.setting;
|
||||
static bool enableRcmdDynamic =
|
||||
setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true);
|
||||
static Box userInfoCache = GStrorage.userInfo;
|
||||
static Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
// 首页推荐视频
|
||||
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
|
||||
@ -607,4 +608,19 @@ class VideoHttp {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 获取视频标签
|
||||
static Future getVideoTag({required String bvid}) async {
|
||||
var res = await Request().get(Api.videoTag, data: {'bvid': bvid});
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': res.data['data'].map<VideoTagItem>((e) {
|
||||
return VideoTagItem.fromJson(e);
|
||||
}).toList()
|
||||
};
|
||||
} else {
|
||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/custom_toast.dart';
|
||||
import 'package:pilipala/http/common.dart';
|
||||
import 'package:pilipala/http/init.dart';
|
||||
import 'package:pilipala/models/common/color_type.dart';
|
||||
import 'package:pilipala/models/common/theme_type.dart';
|
||||
@ -32,7 +33,7 @@ void main() async {
|
||||
MediaKit.ensureInitialized();
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
|
||||
await GStrorage.init();
|
||||
await GStorage.init();
|
||||
clearLogs();
|
||||
Request();
|
||||
await Request.setCookie();
|
||||
@ -65,7 +66,8 @@ void main() async {
|
||||
}
|
||||
|
||||
PiliSchame.init();
|
||||
await GlobalDataCache().initialize();
|
||||
await GlobalDataCache.initialize();
|
||||
CommonHttp.buvidActivate();
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@ -73,7 +75,7 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
// 主题色
|
||||
Color defaultColor =
|
||||
colorThemeTypes[setting.get(SettingBoxKey.customColor, defaultValue: 0)]
|
||||
@ -222,13 +224,23 @@ class BuildMainApp extends StatelessWidget {
|
||||
elevation: 20,
|
||||
);
|
||||
|
||||
return GetMaterialApp(
|
||||
title: 'PiliPala',
|
||||
theme: ThemeData(
|
||||
colorScheme: currentThemeValue == ThemeType.dark
|
||||
? darkColorScheme
|
||||
: lightColorScheme,
|
||||
AppBarTheme appBarTheme(ColorScheme colorScheme) {
|
||||
return AppBarTheme(
|
||||
backgroundColor: colorScheme.surface,
|
||||
foregroundColor: colorScheme.onSurface,
|
||||
elevation: 0,
|
||||
titleSpacing: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
// titleTextStyle: TextStyle(
|
||||
// fontSize: Theme.of(context).textTheme.titleLarge!.fontSize),
|
||||
);
|
||||
}
|
||||
|
||||
ThemeData buildThemeData(ColorScheme colorScheme) {
|
||||
return ThemeData(
|
||||
colorScheme: colorScheme,
|
||||
snackBarTheme: snackBarTheme,
|
||||
appBarTheme: appBarTheme(colorScheme),
|
||||
pageTransitionsTheme: const PageTransitionsTheme(
|
||||
builders: <TargetPlatform, PageTransitionsBuilder>{
|
||||
TargetPlatform.android: ZoomPageTransitionsBuilder(
|
||||
@ -236,12 +248,20 @@ class BuildMainApp extends StatelessWidget {
|
||||
),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return GetMaterialApp(
|
||||
title: 'PiliPala',
|
||||
theme: buildThemeData(
|
||||
currentThemeValue == ThemeType.dark
|
||||
? darkColorScheme
|
||||
: lightColorScheme,
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
colorScheme: currentThemeValue == ThemeType.light
|
||||
darkTheme: buildThemeData(
|
||||
currentThemeValue == ThemeType.light
|
||||
? lightColorScheme
|
||||
: darkColorScheme,
|
||||
snackBarTheme: snackBarTheme,
|
||||
),
|
||||
localizationsDelegates: const [
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
|
18
lib/models/common/comment_range_type.dart
Normal file
18
lib/models/common/comment_range_type.dart
Normal file
@ -0,0 +1,18 @@
|
||||
enum CommentRangeType {
|
||||
video,
|
||||
bangumi,
|
||||
// dynamic,
|
||||
}
|
||||
|
||||
extension ActionTypeExtension on CommentRangeType {
|
||||
String get value => [
|
||||
'video',
|
||||
'bangumi',
|
||||
// 'dynamic',
|
||||
][index];
|
||||
String get label => [
|
||||
'视频',
|
||||
'番剧',
|
||||
// '动态',
|
||||
][index];
|
||||
}
|
73
lib/models/common/invalid_video.dart
Normal file
73
lib/models/common/invalid_video.dart
Normal file
@ -0,0 +1,73 @@
|
||||
class InvalidVideoModel {
|
||||
final int? id;
|
||||
final int? ver;
|
||||
final int? aid;
|
||||
final String? lastupdate;
|
||||
final int? lastupdatets;
|
||||
final String? title;
|
||||
final String? description;
|
||||
final String? pic;
|
||||
final int? tid;
|
||||
final String? typename;
|
||||
final int? created;
|
||||
final String? createdAt;
|
||||
final String? author;
|
||||
final int? mid;
|
||||
final String? play;
|
||||
final String? coins;
|
||||
final String? review;
|
||||
final String? videoReview;
|
||||
final String? favorites;
|
||||
final String? tag;
|
||||
final List<String>? tagList;
|
||||
|
||||
InvalidVideoModel({
|
||||
this.id,
|
||||
this.ver,
|
||||
this.aid,
|
||||
this.lastupdate,
|
||||
this.lastupdatets,
|
||||
this.title,
|
||||
this.description,
|
||||
this.pic,
|
||||
this.tid,
|
||||
this.typename,
|
||||
this.created,
|
||||
this.createdAt,
|
||||
this.author,
|
||||
this.mid,
|
||||
this.play,
|
||||
this.coins,
|
||||
this.review,
|
||||
this.videoReview,
|
||||
this.favorites,
|
||||
this.tag,
|
||||
this.tagList,
|
||||
});
|
||||
|
||||
factory InvalidVideoModel.fromJson(Map<String, dynamic> json) {
|
||||
return InvalidVideoModel(
|
||||
id: json['id'],
|
||||
ver: json['ver'],
|
||||
aid: json['aid'],
|
||||
lastupdate: json['lastupdate'],
|
||||
lastupdatets: json['lastupdatets'],
|
||||
title: json['title'],
|
||||
description: json['description'],
|
||||
pic: json['pic'],
|
||||
tid: json['tid'],
|
||||
typename: json['typename'],
|
||||
created: json['created'],
|
||||
createdAt: json['created_at'],
|
||||
author: json['author'],
|
||||
mid: json['mid'],
|
||||
play: json['play'],
|
||||
coins: json['coins'],
|
||||
review: json['review'],
|
||||
videoReview: json['video_review'],
|
||||
favorites: json['favorites'],
|
||||
tag: json['tag'],
|
||||
tagList: json['tag'].toString().split(',').toList(),
|
||||
);
|
||||
}
|
||||
}
|
26
lib/models/sponsor_block/action_type.dart
Normal file
26
lib/models/sponsor_block/action_type.dart
Normal file
@ -0,0 +1,26 @@
|
||||
// 片段类型枚举
|
||||
enum ActionType {
|
||||
skip,
|
||||
mute,
|
||||
full,
|
||||
poi,
|
||||
chapter,
|
||||
}
|
||||
|
||||
extension ActionTypeExtension on ActionType {
|
||||
String get value => [
|
||||
'skip',
|
||||
'mute',
|
||||
'full',
|
||||
'poi',
|
||||
'chapter',
|
||||
][index];
|
||||
|
||||
String get label => [
|
||||
'跳过',
|
||||
'静音',
|
||||
'完整观看',
|
||||
'亮点',
|
||||
'章节切换',
|
||||
][index];
|
||||
}
|
43
lib/models/sponsor_block/segment.dart
Normal file
43
lib/models/sponsor_block/segment.dart
Normal file
@ -0,0 +1,43 @@
|
||||
import 'action_type.dart';
|
||||
import 'segment_type.dart';
|
||||
|
||||
class SegmentDataModel {
|
||||
final SegmentType? category;
|
||||
final ActionType? actionType;
|
||||
final List? segment;
|
||||
final String? uuid;
|
||||
final num? videoDuration;
|
||||
final int? locked;
|
||||
final int? votes;
|
||||
final String? description;
|
||||
// 是否已经跳过
|
||||
bool isSkip = false;
|
||||
|
||||
SegmentDataModel({
|
||||
this.category,
|
||||
this.actionType,
|
||||
this.segment,
|
||||
this.uuid,
|
||||
this.videoDuration,
|
||||
this.locked,
|
||||
this.votes,
|
||||
this.description,
|
||||
});
|
||||
|
||||
factory SegmentDataModel.fromJson(Map<String, dynamic> json) {
|
||||
return SegmentDataModel(
|
||||
category: SegmentType.values.firstWhere(
|
||||
(e) => e.value == json['category'],
|
||||
orElse: () => SegmentType.sponsor),
|
||||
actionType: ActionType.values.firstWhere(
|
||||
(e) => e.value == json['actionType'],
|
||||
orElse: () => ActionType.skip),
|
||||
segment: json['segment'],
|
||||
uuid: json['UUID'],
|
||||
videoDuration: json['videoDuration'],
|
||||
locked: json['locked'],
|
||||
votes: json['votes'],
|
||||
description: json['description'],
|
||||
);
|
||||
}
|
||||
}
|
46
lib/models/sponsor_block/segment_type.dart
Normal file
46
lib/models/sponsor_block/segment_type.dart
Normal file
@ -0,0 +1,46 @@
|
||||
// 片段类型枚举
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
enum SegmentType {
|
||||
sponsor,
|
||||
intro,
|
||||
outro,
|
||||
interaction,
|
||||
selfpromo,
|
||||
music_offtopic,
|
||||
preview,
|
||||
poi_highlight,
|
||||
filler,
|
||||
exclusive_access,
|
||||
chapter,
|
||||
}
|
||||
|
||||
extension SegmentTypeExtension on SegmentType {
|
||||
String get value => [
|
||||
'sponsor',
|
||||
'intro',
|
||||
'outro',
|
||||
'interaction',
|
||||
'selfpromo',
|
||||
'music_offtopic',
|
||||
'preview',
|
||||
'poi_highlight',
|
||||
'filler',
|
||||
'exclusive_access',
|
||||
'chapter',
|
||||
][index];
|
||||
|
||||
String get label => [
|
||||
'赞助',
|
||||
'开场介绍',
|
||||
'片尾致谢',
|
||||
'互动',
|
||||
'自我推广',
|
||||
'音乐',
|
||||
'预览',
|
||||
'亮点',
|
||||
'无效填充',
|
||||
'独家访问',
|
||||
'章节',
|
||||
][index];
|
||||
}
|
@ -125,6 +125,7 @@ class ReplyControl {
|
||||
this.upLike,
|
||||
this.isShow,
|
||||
this.entryText,
|
||||
this.entryTextNum,
|
||||
this.titleText,
|
||||
this.time,
|
||||
this.location,
|
||||
@ -135,6 +136,7 @@ class ReplyControl {
|
||||
bool? upLike;
|
||||
bool? isShow;
|
||||
String? entryText;
|
||||
int? entryTextNum;
|
||||
String? titleText;
|
||||
String? time;
|
||||
String? location;
|
||||
@ -155,6 +157,10 @@ class ReplyControl {
|
||||
}
|
||||
|
||||
entryText = json['sub_reply_entry_text'];
|
||||
// 正则匹配
|
||||
entryTextNum = json['sub_reply_entry_text'] != null
|
||||
? int.parse(RegExp(r"\d+").stringMatch(json['sub_reply_entry_text']!)!)
|
||||
: 0;
|
||||
titleText = json['sub_reply_title_text'];
|
||||
time = json['time_desc'];
|
||||
location = json['location'] != null ? json['location'].split(':')[1] : '';
|
||||
|
@ -29,7 +29,7 @@ class ReplyMember {
|
||||
avatar = json['avatar'];
|
||||
level = json['level_info']['current_level'];
|
||||
pendant = Pendant.fromJson(json['pendant']);
|
||||
officialVerify = json['officia_verify'];
|
||||
officialVerify = json['official_verify'];
|
||||
vip = json['vip'];
|
||||
fansDetail = json['fans_detail'];
|
||||
userSailing = json['user_sailing'] != null
|
||||
|
17
lib/models/video/tags.dart
Normal file
17
lib/models/video/tags.dart
Normal file
@ -0,0 +1,17 @@
|
||||
class VideoTagItem {
|
||||
String? tagName;
|
||||
int? tagId;
|
||||
int? tagType;
|
||||
|
||||
VideoTagItem({
|
||||
this.tagName,
|
||||
this.tagId,
|
||||
this.tagType,
|
||||
});
|
||||
|
||||
VideoTagItem.fromJson(Map<String, dynamic> json) {
|
||||
tagName = json['tag_name'];
|
||||
tagId = json['tag_id'];
|
||||
tagType = json['type'];
|
||||
}
|
||||
}
|
@ -39,9 +39,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
TextStyle subTitleStyle =
|
||||
TextStyle(fontSize: 13, color: Theme.of(context).colorScheme.outline);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('关于', style: Theme.of(context).textTheme.titleMedium),
|
||||
),
|
||||
appBar: AppBar(title: const Text('关于')),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
|
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/bangumi.dart';
|
||||
import 'package:pilipala/models/bangumi/list.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class BangumiController extends GetxController {
|
||||
@ -12,17 +13,17 @@ class BangumiController extends GetxController {
|
||||
RxInt total = 0.obs;
|
||||
int _currentPage = 1;
|
||||
bool isLoadingMore = true;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
late int mid;
|
||||
var userInfo;
|
||||
UserInfoData? userInfo;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
if (userInfo != null) {
|
||||
mid = userInfo.mid;
|
||||
mid = userInfo!.mid!;
|
||||
}
|
||||
userLogin.value = userInfo != null;
|
||||
}
|
||||
@ -55,7 +56,7 @@ class BangumiController extends GetxController {
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
}
|
||||
var result = await BangumiHttp.getRecentBangumi(mid: userInfo.mid);
|
||||
var result = await BangumiHttp.getRecentBangumi(mid: userInfo!.mid!);
|
||||
if (result['status']) {
|
||||
bangumiFollowList.value = result['data'].list;
|
||||
total.value = result['data'].total;
|
||||
|
@ -8,6 +8,7 @@ import 'package:pilipala/http/search.dart';
|
||||
import 'package:pilipala/http/video.dart';
|
||||
import 'package:pilipala/models/bangumi/info.dart';
|
||||
import 'package:pilipala/models/user/fav_folder.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/pages/video/detail/index.dart';
|
||||
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||
@ -48,7 +49,7 @@ class BangumiIntroController extends GetxController {
|
||||
RxBool hasCoin = false.obs;
|
||||
// 是否收藏
|
||||
RxBool hasFav = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
bool userLogin = false;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
List addMediaIdsNew = [];
|
||||
@ -57,7 +58,7 @@ class BangumiIntroController extends GetxController {
|
||||
RxBool isFollowed = false.obs;
|
||||
RxInt followStatus = 1.obs;
|
||||
int _tempThemeValue = -1;
|
||||
var userInfo;
|
||||
UserInfoData? userInfo;
|
||||
PersistentBottomSheetController? bottomSheetController;
|
||||
List<Map<String, dynamic>> followStatusList = [
|
||||
{'title': '标记为 「想看」', 'status': 1},
|
||||
@ -259,7 +260,7 @@ class BangumiIntroController extends GetxController {
|
||||
|
||||
Future queryVideoInFolder() async {
|
||||
var result = await VideoHttp.videoInFolder(
|
||||
mid: userInfo.mid, rid: IdUtils.bv2av(bvid));
|
||||
mid: userInfo!.mid!, rid: IdUtils.bv2av(bvid));
|
||||
if (result['status']) {
|
||||
favFolderData.value = result['data'];
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/constants.dart';
|
||||
import 'package:pilipala/common/widgets/badge.dart';
|
||||
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||
@ -116,7 +117,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
String heroTag = Get.arguments['heroTag'];
|
||||
late final BangumiIntroController bangumiIntroController;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
late double sheetHeight;
|
||||
int? cid;
|
||||
bool isProcessing = false;
|
||||
@ -148,7 +149,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
|
||||
// 收藏
|
||||
showFavBottomSheet() async {
|
||||
if (bangumiIntroController.userInfo.mid == null) {
|
||||
if (bangumiIntroController.userInfo?.mid == null) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
@ -445,27 +446,12 @@ class BangumiStatusWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget morePanel(BuildContext context, BangumiIntroController ctr) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
...ctr.followStatusList
|
||||
.map(
|
||||
(e) => ListTile(
|
||||
|
@ -1,10 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
late double sheetHeight;
|
||||
|
||||
class IntroDetail extends StatelessWidget {
|
||||
@ -23,94 +24,81 @@ class IntroDetail extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
);
|
||||
return Container(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
height: sheetHeight,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSecondaryContainer
|
||||
.withOpacity(0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bangumiDetail!.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bangumiDetail!.title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
StatView(
|
||||
view: bangumiDetail!.stat!['views'],
|
||||
size: 'medium',
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
StatDanMu(
|
||||
danmu: bangumiDetail!.stat!['danmakus'],
|
||||
size: 'medium',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
bangumiDetail!.areas!.first['name'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
bangumiDetail!.publish!['pub_time_show'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
bangumiDetail!.newEp!['desc'],
|
||||
style: smallTitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'简介:',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'${bangumiDetail!.evaluate!}',
|
||||
style: smallTitle.copyWith(fontSize: 13),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'声优:',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
bangumiDetail.actors,
|
||||
style: smallTitle.copyWith(fontSize: 13),
|
||||
),
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 20)
|
||||
],
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
StatView(
|
||||
view: bangumiDetail!.stat!['views'],
|
||||
size: 'medium',
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
StatDanMu(
|
||||
danmu: bangumiDetail!.stat!['danmakus'],
|
||||
size: 'medium',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
bangumiDetail!.areas!.first['name'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
bangumiDetail!.publish!['pub_time_show'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
bangumiDetail!.newEp!['desc'],
|
||||
style: smallTitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'简介:',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'${bangumiDetail!.evaluate!}',
|
||||
style: smallTitle.copyWith(fontSize: 13),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'声优:',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
bangumiDetail.actors,
|
||||
style: smallTitle.copyWith(fontSize: 13),
|
||||
),
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 20)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@ -5,6 +5,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/models/bangumi/info.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/pages/video/detail/index.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import '../../../common/pages_bottom_sheet.dart';
|
||||
@ -36,8 +37,8 @@ class BangumiPanel extends StatefulWidget {
|
||||
class _BangumiPanelState extends State<BangumiPanel> {
|
||||
late RxInt currentIndex = (-1).obs;
|
||||
final ScrollController listViewScrollCtr = ScrollController();
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
dynamic userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
// 默认未开通
|
||||
int vipStatus = 0;
|
||||
late int cid;
|
||||
@ -63,7 +64,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
/// 获取大会员状态
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
if (userInfo != null) {
|
||||
vipStatus = userInfo.vipStatus;
|
||||
vipStatus = userInfo!.vipStatus!;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class _BlackListPageState extends State<BlackListPage> {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Future? _futureBuilderFuture;
|
||||
bool _isLoadingMore = false;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -55,14 +55,9 @@ class _BlackListPageState extends State<BlackListPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(
|
||||
() => Text(
|
||||
'黑名单管理 ${_blackListController.total.value == 0 ? '' : '- ${_blackListController.total.value}'}',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -32,7 +32,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
late PlDanmakuController _plDanmakuController;
|
||||
DanmakuController? _controller;
|
||||
// bool danmuPlayStatus = true;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late bool enableShowDanmaku;
|
||||
late List blockTypes;
|
||||
late double showArea;
|
||||
|
@ -10,6 +10,7 @@ import 'package:pilipala/models/common/dynamics_type.dart';
|
||||
import 'package:pilipala/models/dynamics/result.dart';
|
||||
import 'package:pilipala/models/dynamics/up.dart';
|
||||
import 'package:pilipala/models/live/item.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/id_utils.dart';
|
||||
import 'package:pilipala/utils/route_push.dart';
|
||||
@ -50,11 +51,11 @@ class DynamicsController extends GetxController {
|
||||
];
|
||||
bool flag = false;
|
||||
RxInt initialValue = 0.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
var userInfo;
|
||||
UserInfoData? userInfo;
|
||||
RxBool isLoadingDynamic = false.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@ -246,7 +247,7 @@ class DynamicsController extends GetxController {
|
||||
}
|
||||
upData.value.upList!.insertAll(0, [
|
||||
UpItem(face: '', uname: '全部动态', mid: -1),
|
||||
UpItem(face: userInfo.face, uname: '我', mid: userInfo.mid),
|
||||
UpItem(face: userInfo!.face, uname: '我', mid: userInfo!.mid),
|
||||
]);
|
||||
}
|
||||
return res;
|
||||
|
@ -24,7 +24,7 @@ class DynamicDetailController extends GetxController {
|
||||
ReplySortType _sortType = ReplySortType.time;
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
RxInt replyReqCode = 200.obs;
|
||||
bool isEnd = false;
|
||||
|
||||
@ -37,13 +37,13 @@ class DynamicDetailController extends GetxController {
|
||||
acount.value =
|
||||
int.parse(item!.modules!.moduleStat!.comment!.count ?? '0');
|
||||
}
|
||||
int deaultReplySortIndex =
|
||||
int defaultReplySortIndex =
|
||||
setting.get(SettingBoxKey.replySortType, defaultValue: 0);
|
||||
if (deaultReplySortIndex == 2) {
|
||||
if (defaultReplySortIndex == 2) {
|
||||
setting.put(SettingBoxKey.replySortType, 0);
|
||||
deaultReplySortIndex = 0;
|
||||
defaultReplySortIndex = 0;
|
||||
}
|
||||
_sortType = ReplySortType.values[deaultReplySortIndex];
|
||||
_sortType = ReplySortType.values[defaultReplySortIndex];
|
||||
sortTypeTitle.value = _sortType.titles;
|
||||
sortTypeLabel.value = _sortType.labels;
|
||||
}
|
||||
@ -123,4 +123,15 @@ class DynamicDetailController extends GetxController {
|
||||
Future onLoad() async {
|
||||
queryReplyList(reqType: 'onLoad');
|
||||
}
|
||||
|
||||
Future removeReply(int? rpid, int? frpid) async {
|
||||
// 移除一楼评论
|
||||
if (rpid != null) {
|
||||
replyList.removeWhere((item) {
|
||||
return item.rpid == rpid;
|
||||
});
|
||||
}
|
||||
|
||||
/// TODO 移除二楼评论
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import '../../../models/video/reply/item.dart';
|
||||
import '../widgets/dynamic_panel.dart';
|
||||
|
||||
class DynamicDetailPage extends StatefulWidget {
|
||||
// const DynamicDetailPage({super.key});
|
||||
const DynamicDetailPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -90,19 +89,22 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
_dynamicDetailController = Get.put(
|
||||
DynamicDetailController(oid, replyType),
|
||||
tag: opusId.toString());
|
||||
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
||||
await _dynamicDetailController.reqHtmlByOpusId(opusId!);
|
||||
setState(() {});
|
||||
}
|
||||
} else {
|
||||
oid = moduleDynamic.major!.draw!.id!;
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (err) {
|
||||
print('err:${err.toString()}');
|
||||
}
|
||||
}
|
||||
if (!isOpusId) {
|
||||
_dynamicDetailController =
|
||||
Get.put(DynamicDetailController(oid, replyType), tag: oid.toString());
|
||||
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
||||
}
|
||||
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
||||
}
|
||||
|
||||
// 查看二级评论
|
||||
@ -111,14 +113,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
int rpid = replyItem.rpid!;
|
||||
Get.to(
|
||||
() => Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
'评论详情',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
appBar: AppBar(title: const Text('评论详情')),
|
||||
body: VideoReplyReplyPanel(
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
@ -139,7 +134,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
// 分页加载
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 300) {
|
||||
EasyThrottle.throttle('replylist', const Duration(seconds: 2), () {
|
||||
EasyThrottle.throttle('replyList', const Duration(seconds: 2), () {
|
||||
_dynamicDetailController.onLoad();
|
||||
});
|
||||
}
|
||||
@ -192,10 +187,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 1,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: StreamBuilder(
|
||||
stream: titleStreamC.stream,
|
||||
initialData: false,
|
||||
@ -335,6 +327,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
||||
.replies!
|
||||
.add(replyItem);
|
||||
},
|
||||
onDelete:
|
||||
_dynamicDetailController.removeReply,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -47,7 +47,7 @@ class _DynamicForwardPageState extends State<DynamicForwardPage> {
|
||||
widget.cb?.call();
|
||||
_onClose();
|
||||
} else {
|
||||
SmartDialog.showToast(res['message']);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
final MineController mineController = Get.put(MineController());
|
||||
late Future _futureBuilderFuture;
|
||||
late Future _futureBuilderFutureUp;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late ScrollController scrollController;
|
||||
|
||||
@override
|
||||
@ -78,8 +78,6 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
title: SizedBox(
|
||||
height: 34,
|
||||
child: Stack(
|
||||
|
@ -90,7 +90,7 @@ class _ActionPanelState extends State<ActionPanel>
|
||||
SmartDialog.showToast('请先登录');
|
||||
return;
|
||||
}
|
||||
int mid = userInfo.mid;
|
||||
int mid = userInfo.mid!;
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
enableDrag: true,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
import 'package:pilipala/utils/feed_back.dart';
|
||||
@ -108,28 +109,12 @@ class MorePanel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
// clipBehavior: Clip.hardEdge,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
ListTile(
|
||||
onTap: () async {
|
||||
try {
|
||||
|
@ -34,6 +34,7 @@ class _UpPanelState extends State<UpPanel> {
|
||||
List<LiveUserItem> liveList = [];
|
||||
static const itemPadding = EdgeInsets.symmetric(horizontal: 5, vertical: 0);
|
||||
late MyInfo userInfo;
|
||||
RxBool showLiveUser = false.obs;
|
||||
|
||||
void listFormat() {
|
||||
userInfo = widget.upData.myInfo!;
|
||||
@ -131,21 +132,70 @@ class _UpPanelState extends State<UpPanel> {
|
||||
children: [
|
||||
const SizedBox(width: 10),
|
||||
if (liveList.isNotEmpty) ...[
|
||||
for (int i = 0; i < liveList.length; i++) ...[
|
||||
upItemBuild(liveList[i], i)
|
||||
],
|
||||
VerticalDivider(
|
||||
indent: 20,
|
||||
endIndent: 40,
|
||||
width: 26,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
.withOpacity(0.5),
|
||||
Obx(
|
||||
() => AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder: (Widget child,
|
||||
Animation<double> animation) {
|
||||
return FadeTransition(
|
||||
opacity: animation, child: child);
|
||||
},
|
||||
child: showLiveUser.value
|
||||
? Row(
|
||||
key: ValueKey<bool>(showLiveUser.value),
|
||||
children: [
|
||||
for (int i = 0;
|
||||
i < liveList.length;
|
||||
i++)
|
||||
UpItemWidget(
|
||||
data: liveList[i],
|
||||
index: i,
|
||||
currentMid: currentMid,
|
||||
onClickUp: onClickUp,
|
||||
onClickUpAni: onClickUpAni,
|
||||
itemPadding: itemPadding,
|
||||
contentWidth: contentWidth,
|
||||
)
|
||||
],
|
||||
)
|
||||
: SizedBox.shrink(
|
||||
key: ValueKey<bool>(showLiveUser.value),
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => IconButton(
|
||||
onPressed: () {
|
||||
showLiveUser.value = !showLiveUser.value;
|
||||
},
|
||||
icon: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
transitionBuilder: (Widget child,
|
||||
Animation<double> animation) {
|
||||
return ScaleTransition(
|
||||
scale: animation, child: child);
|
||||
},
|
||||
child: Icon(
|
||||
!showLiveUser.value
|
||||
? Icons.arrow_forward_ios_rounded
|
||||
: Icons.arrow_back_ios_rounded,
|
||||
key: ValueKey<bool>(showLiveUser.value),
|
||||
size: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
for (int i = 0; i < upList.length; i++) ...[
|
||||
upItemBuild(upList[i], i)
|
||||
UpItemWidget(
|
||||
data: upList[i],
|
||||
index: i,
|
||||
currentMid: currentMid,
|
||||
onClickUp: onClickUp,
|
||||
onClickUpAni: onClickUpAni,
|
||||
itemPadding: itemPadding,
|
||||
contentWidth: contentWidth,
|
||||
)
|
||||
],
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
@ -165,18 +215,103 @@ class _UpPanelState extends State<UpPanel> {
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget upItemBuild(data, i) {
|
||||
class _SliverHeaderDelegate extends SliverPersistentHeaderDelegate {
|
||||
_SliverHeaderDelegate({required this.height, required this.child});
|
||||
|
||||
final double height;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(
|
||||
BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
return child;
|
||||
}
|
||||
|
||||
@override
|
||||
double get maxExtent => height;
|
||||
|
||||
@override
|
||||
double get minExtent => height;
|
||||
|
||||
@override
|
||||
bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) =>
|
||||
true;
|
||||
}
|
||||
|
||||
class UpPanelSkeleton extends StatelessWidget {
|
||||
const UpPanelSkeleton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: 10,
|
||||
itemBuilder: ((context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 6),
|
||||
width: 45,
|
||||
height: 12,
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class UpItemWidget extends StatelessWidget {
|
||||
final dynamic data;
|
||||
final int index;
|
||||
final RxInt currentMid;
|
||||
final Function(dynamic, int) onClickUp;
|
||||
final Function(dynamic, int) onClickUpAni;
|
||||
// final Function() feedBack;
|
||||
final EdgeInsets itemPadding;
|
||||
final double contentWidth;
|
||||
|
||||
const UpItemWidget({
|
||||
Key? key,
|
||||
required this.data,
|
||||
required this.index,
|
||||
required this.currentMid,
|
||||
required this.onClickUp,
|
||||
required this.onClickUpAni,
|
||||
// required this.feedBack,
|
||||
required this.itemPadding,
|
||||
required this.contentWidth,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
feedBack();
|
||||
if (data.type == 'up') {
|
||||
EasyThrottle.throttle('follow', const Duration(milliseconds: 300),
|
||||
() {
|
||||
if (GlobalDataCache().enableDynamicSwitch) {
|
||||
onClickUp(data, i);
|
||||
if (GlobalDataCache.enableDynamicSwitch) {
|
||||
onClickUp(data, index);
|
||||
} else {
|
||||
onClickUpAni(data, i);
|
||||
onClickUpAni(data, index);
|
||||
}
|
||||
});
|
||||
} else if (data.type == 'live') {
|
||||
@ -251,13 +386,12 @@ class _UpPanelState extends State<UpPanel> {
|
||||
softWrap: false,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: currentMid.value == data.mid
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
fontSize: Theme.of(context)
|
||||
.textTheme
|
||||
.labelMedium!
|
||||
.fontSize),
|
||||
color: currentMid.value == data.mid
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.outline,
|
||||
fontSize:
|
||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -269,64 +403,3 @@ class _UpPanelState extends State<UpPanel> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SliverHeaderDelegate extends SliverPersistentHeaderDelegate {
|
||||
_SliverHeaderDelegate({required this.height, required this.child});
|
||||
|
||||
final double height;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(
|
||||
BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
return child;
|
||||
}
|
||||
|
||||
@override
|
||||
double get maxExtent => height;
|
||||
|
||||
@override
|
||||
double get minExtent => height;
|
||||
|
||||
@override
|
||||
bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) =>
|
||||
true;
|
||||
}
|
||||
|
||||
class UpPanelSkeleton extends StatelessWidget {
|
||||
const UpPanelSkeleton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: 10,
|
||||
itemBuilder: ((context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 6),
|
||||
width: 45,
|
||||
height: 12,
|
||||
color: Theme.of(context).colorScheme.onInverseSurface,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,17 +3,18 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/fan.dart';
|
||||
import 'package:pilipala/models/fans/result.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class FansController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
RxList<FansItemModel> fansList = <FansItemModel>[].obs;
|
||||
late int mid;
|
||||
late String name;
|
||||
var userInfo;
|
||||
UserInfoData? userInfo;
|
||||
RxString loadingText = '加载中...'.obs;
|
||||
RxBool isOwner = false.obs;
|
||||
|
||||
@ -23,9 +24,9 @@ class FansController extends GetxController {
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
mid = Get.parameters['mid'] != null
|
||||
? int.parse(Get.parameters['mid']!)
|
||||
: userInfo.mid;
|
||||
isOwner.value = mid == userInfo.mid;
|
||||
name = Get.parameters['name'] ?? userInfo.uname;
|
||||
: userInfo!.mid!;
|
||||
isOwner.value = mid == userInfo?.mid;
|
||||
name = Get.parameters['name'] ?? userInfo?.uname ?? '';
|
||||
}
|
||||
|
||||
Future queryFans(type) async {
|
||||
|
@ -49,13 +49,8 @@ class _FansPageState extends State<FansPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
_fansController.isOwner.value ? '我的粉丝' : '${_fansController.name}的粉丝',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
body: RefreshIndicator(
|
||||
|
@ -11,7 +11,7 @@ class FavController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
RxList<FavFolderItemData> favFolderList = <FavFolderItemData>[].obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
int currentPage = 1;
|
||||
int pageSize = 60;
|
||||
|
@ -40,11 +40,8 @@ class _FavPageState extends State<FavPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Obx(() => Text(
|
||||
'${_favController.isOwner.value ? '我' : 'Ta'}的收藏',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
)),
|
||||
actions: [
|
||||
Obx(() => !_favController.isOwner.value
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/http/common.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
import 'package:pilipala/http/video.dart';
|
||||
import 'package:pilipala/models/user/fav_detail.dart';
|
||||
@ -8,6 +9,8 @@ import 'package:pilipala/models/user/fav_folder.dart';
|
||||
import 'package:pilipala/pages/fav/index.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
|
||||
import 'widget/invalid_video_card.dart';
|
||||
|
||||
class FavDetailController extends GetxController {
|
||||
FavFolderItemData? item;
|
||||
RxString title = ''.obs;
|
||||
@ -131,8 +134,9 @@ class FavDetailController extends GetxController {
|
||||
'privacy': [22, 0].contains(item!.attr) ? 0 : 1,
|
||||
},
|
||||
);
|
||||
title.value = res['title'];
|
||||
print(title);
|
||||
if (res != null) {
|
||||
title.value = res['title'];
|
||||
}
|
||||
}
|
||||
|
||||
Future toViewPlayAll() async {
|
||||
@ -152,4 +156,22 @@ class FavDetailController extends GetxController {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 查看无效视频信息
|
||||
Future toViewInvalidVideo(FavDetailItemData item) async {
|
||||
SmartDialog.showLoading(msg: '加载中...');
|
||||
var res = await CommonHttp.fixVideoPicAndTitle(aid: item.id!);
|
||||
SmartDialog.dismiss();
|
||||
if (res['status']) {
|
||||
showModalBottomSheet(
|
||||
context: Get.context!,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return InvalidVideoCard(videoInfo: res['data']);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -226,6 +226,8 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
isOwner: _favDetailController.isOwner,
|
||||
callFn: () => _favDetailController
|
||||
.onCancelFav(favList[index].id),
|
||||
viewInvalidVideoCb: () => _favDetailController
|
||||
.toViewInvalidVideo(favList[index]),
|
||||
);
|
||||
}, childCount: favList.length),
|
||||
),
|
||||
|
@ -19,6 +19,7 @@ class FavVideoCardH extends StatelessWidget {
|
||||
final Function? callFn;
|
||||
final int? searchType;
|
||||
final String isOwner;
|
||||
final Function? viewInvalidVideoCb;
|
||||
|
||||
const FavVideoCardH({
|
||||
Key? key,
|
||||
@ -26,6 +27,7 @@ class FavVideoCardH extends StatelessWidget {
|
||||
this.callFn,
|
||||
this.searchType,
|
||||
required this.isOwner,
|
||||
this.viewInvalidVideoCb,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -36,6 +38,10 @@ class FavVideoCardH extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
// int? seasonId;
|
||||
if (videoItem.title == '已失效视频') {
|
||||
viewInvalidVideoCb?.call();
|
||||
return;
|
||||
}
|
||||
String? epId;
|
||||
if (videoItem.ogv != null &&
|
||||
(videoItem.ogv['type_name'] == '番剧' ||
|
||||
@ -65,11 +71,17 @@ class FavVideoCardH extends StatelessWidget {
|
||||
epId != null ? SearchType.media_bangumi : SearchType.video,
|
||||
});
|
||||
},
|
||||
onLongPress: () => imageSaveDialog(
|
||||
context,
|
||||
videoItem,
|
||||
SmartDialog.dismiss,
|
||||
),
|
||||
onLongPress: () {
|
||||
if (videoItem.title == '已失效视频') {
|
||||
SmartDialog.showToast('视频已失效');
|
||||
return;
|
||||
}
|
||||
imageSaveDialog(
|
||||
context,
|
||||
videoItem,
|
||||
SmartDialog.dismiss,
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
97
lib/pages/fav_detail/widget/invalid_video_card.dart
Normal file
97
lib/pages/fav_detail/widget/invalid_video_card.dart
Normal file
@ -0,0 +1,97 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/models/common/invalid_video.dart';
|
||||
|
||||
class InvalidVideoCard extends StatelessWidget {
|
||||
const InvalidVideoCard({required this.videoInfo, Key? key}) : super(key: key);
|
||||
final InvalidVideoModel videoInfo;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const TextStyle textStyle = TextStyle(fontSize: 14.0);
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
12,
|
||||
14,
|
||||
12,
|
||||
MediaQuery.of(context).padding.bottom + 20,
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
double maxWidth = constraints.maxWidth;
|
||||
double maxHeight = maxWidth * 9 / 16;
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
src: videoInfo.pic,
|
||||
radius: 20,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SelectableText(
|
||||
videoInfo.title!,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
SelectableText(videoInfo.author!, style: textStyle),
|
||||
const SizedBox(height: 2),
|
||||
SelectableText('创建时间:${videoInfo.createdAt}', style: textStyle),
|
||||
SelectableText('更新时间:${videoInfo.lastupdate}',
|
||||
style: textStyle),
|
||||
SelectableText('分类:${videoInfo.typename}', style: textStyle),
|
||||
SelectableText(
|
||||
'投币:${videoInfo.coins} 收藏:${videoInfo.favorites}',
|
||||
style: textStyle),
|
||||
if (videoInfo.tagList != null &&
|
||||
videoInfo.tagList!.isNotEmpty) ...[
|
||||
const SizedBox(height: 6),
|
||||
_buildTags(context, videoInfo.tagList),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTags(BuildContext context, List<String>? videoTags) {
|
||||
final ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||
return Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 6,
|
||||
direction: Axis.horizontal,
|
||||
textDirection: TextDirection.ltr,
|
||||
children: videoTags!.map((tag) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed('/searchResult', parameters: {'keyword': tag});
|
||||
},
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.surfaceVariant.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 10),
|
||||
child: Text(
|
||||
tag,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
@ -53,6 +53,7 @@ class FavEditController extends GetxController {
|
||||
intro: intro,
|
||||
mediaId: mediaId!,
|
||||
cover: cover,
|
||||
privacy: privacy.value,
|
||||
);
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast('编辑成功');
|
||||
@ -74,4 +75,14 @@ class FavEditController extends GetxController {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
void togglePrivacy() {
|
||||
if (privacy.value == 0) {
|
||||
privacy.value = 1;
|
||||
SmartDialog.showToast('设置为私密后,只有自己可见');
|
||||
} else {
|
||||
privacy.value = 0;
|
||||
SmartDialog.showToast('设置为公开后,所有人可见');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,36 +19,24 @@ class _FavEditPageState extends State<FavEditPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
title: Obx(
|
||||
() => _favEditController.type.value == 'add'
|
||||
? Text(
|
||||
'新建收藏夹',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
)
|
||||
: Text(
|
||||
'编辑收藏夹',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
? const Text('新建收藏夹')
|
||||
: const Text('编辑收藏夹'),
|
||||
),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
Obx(
|
||||
() => _favEditController.privacy.value == 0
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
_favEditController.privacy.value = 1;
|
||||
},
|
||||
icon: const Icon(Icons.lock_open_outlined))
|
||||
: IconButton(
|
||||
onPressed: () {
|
||||
_favEditController.privacy.value = 0;
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.lock_outlined,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
)),
|
||||
() => IconButton(
|
||||
onPressed: _favEditController.togglePrivacy,
|
||||
icon: Icon(
|
||||
_favEditController.privacy.value == 0
|
||||
? Icons.lock_open_outlined
|
||||
: Icons.lock_outlined,
|
||||
color: _favEditController.privacy.value == 0
|
||||
? null
|
||||
: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: _favEditController.onSubmit, child: const Text('保存')),
|
||||
|
@ -47,7 +47,6 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => _favSearchCtr.submit(),
|
||||
|
@ -6,19 +6,20 @@ import 'package:pilipala/http/follow.dart';
|
||||
import 'package:pilipala/http/member.dart';
|
||||
import 'package:pilipala/models/follow/result.dart';
|
||||
import 'package:pilipala/models/member/tags.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
/// 查看自己的关注时,可以查看分类
|
||||
/// 查看其他人的关注时,只可以看全部
|
||||
class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
RxList<FollowItemModel> followList = <FollowItemModel>[].obs;
|
||||
late int mid;
|
||||
late String name;
|
||||
var userInfo;
|
||||
UserInfoData? userInfo;
|
||||
RxString loadingText = '加载中...'.obs;
|
||||
RxBool isOwner = false.obs;
|
||||
late List<MemberTagItemModel> followTags;
|
||||
@ -30,9 +31,9 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
mid = Get.parameters['mid'] != null
|
||||
? int.parse(Get.parameters['mid']!)
|
||||
: userInfo.mid;
|
||||
isOwner.value = mid == userInfo.mid;
|
||||
name = Get.parameters['name'] ?? userInfo.uname;
|
||||
: userInfo!.mid!;
|
||||
isOwner.value = mid == userInfo?.mid;
|
||||
name = Get.parameters['name'] ?? userInfo?.uname ?? '';
|
||||
}
|
||||
|
||||
Future queryFollowings(type) async {
|
||||
@ -68,7 +69,7 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
// 当查看当前用户的关注时,请求关注分组
|
||||
Future followUpTags() async {
|
||||
if (userInfo != null && mid == userInfo.mid) {
|
||||
if (userInfo != null && mid == userInfo!.mid) {
|
||||
var res = await MemberHttp.followUpTags();
|
||||
if (res['status']) {
|
||||
followTags = res['data'];
|
||||
|
@ -27,15 +27,10 @@ class _FollowPageState extends State<FollowPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
_followController.isOwner.value
|
||||
? '我的关注'
|
||||
: '${_followController.name}的关注',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
|
@ -47,7 +47,6 @@ class _FollowSearchPageState extends State<FollowSearchPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: reRequest,
|
||||
|
@ -12,11 +12,11 @@ class HistoryController extends GetxController {
|
||||
RxList<HisListItem> historyList = <HisListItem>[].obs;
|
||||
RxBool isLoadingMore = false.obs;
|
||||
RxBool pauseStatus = false.obs;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
RxBool isLoading = false.obs;
|
||||
RxBool enableMultiple = false.obs;
|
||||
RxInt checkedCount = 0.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
|
||||
@override
|
||||
|
@ -69,12 +69,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
appBar: AppBarWidget(
|
||||
visible: _historyController.enableMultiple.value,
|
||||
child1: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
'观看记录',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
title: const Text('观看记录'),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => Get.toNamed('/historySearch'),
|
||||
@ -127,8 +122,6 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
],
|
||||
),
|
||||
child2: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
_historyController.enableMultiple.value = false;
|
||||
@ -143,7 +136,6 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
title: Obx(
|
||||
() => Text(
|
||||
'已选择${_historyController.checkedCount.value}项',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
|
@ -45,7 +45,6 @@ class _HistorySearchPageState extends State<HistorySearchPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => _hisCtr.submit(),
|
||||
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/models/common/tab_type.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import '../../http/index.dart';
|
||||
|
||||
@ -14,12 +15,12 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
late TabController tabController;
|
||||
late List tabsCtrList;
|
||||
late List<Widget> tabsPageList;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box settingStorage = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box settingStorage = GStorage.setting;
|
||||
RxBool userLogin = false.obs;
|
||||
RxString userFace = ''.obs;
|
||||
var userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
UserInfoData? userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
late final StreamController<bool> searchBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
late bool hideSearchBar;
|
||||
@ -33,7 +34,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
super.onInit();
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
userLogin.value = userInfo != null;
|
||||
userFace.value = userInfo != null ? userInfo.face : '';
|
||||
userFace.value = userInfo != null ? userInfo!.face! : '';
|
||||
hideSearchBar =
|
||||
setting.get(SettingBoxKey.hideSearchBar, defaultValue: false);
|
||||
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
||||
@ -62,7 +63,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
userInfo = await userInfoCache.get('userInfoCache');
|
||||
userLogin.value = val ?? false;
|
||||
if (val) return;
|
||||
userFace.value = userInfo != null ? userInfo.face : '';
|
||||
userFace.value = userInfo != null ? userInfo!.face! : '';
|
||||
}
|
||||
|
||||
void setTabConfig() async {
|
||||
|
@ -54,7 +54,6 @@ class _HomePageState extends State<HomePage>
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 0,
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
systemOverlayStyle: Platform.isAndroid
|
||||
? SystemUiOverlayStyle(
|
||||
|
@ -3,16 +3,17 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
class HomeAppBar extends StatelessWidget {
|
||||
const HomeAppBar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var userInfo = userInfoCache.get('userInfoCache');
|
||||
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||
return SliverAppBar(
|
||||
// forceElevated: true,
|
||||
scrolledUnderElevation: 0,
|
||||
@ -28,7 +29,6 @@ class HomeAppBar extends StatelessWidget {
|
||||
background: Column(
|
||||
children: [
|
||||
AppBar(
|
||||
centerTitle: false,
|
||||
title: const Text(
|
||||
'PiLiPaLa',
|
||||
style: TextStyle(
|
||||
@ -73,8 +73,6 @@ class HomeAppBar extends StatelessWidget {
|
||||
|
||||
const SizedBox(width: 10)
|
||||
],
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -25,7 +25,7 @@ class HtmlRenderController extends GetxController {
|
||||
ReplySortType _sortType = ReplySortType.time;
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -104,14 +104,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
int rpid = replyItem.rpid!;
|
||||
Get.to(
|
||||
() => Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
'评论详情',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
appBar: AppBar(title: const Text('评论详情')),
|
||||
body: VideoReplyReplyPanel(
|
||||
oid: oid,
|
||||
rpid: rpid,
|
||||
@ -127,12 +120,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
title: Text(title),
|
||||
actions: [
|
||||
const SizedBox(width: 4),
|
||||
IconButton(
|
||||
|
@ -13,7 +13,7 @@ class LaterController extends GetxController {
|
||||
RxList<HotVideoItemModel> laterList = <HotVideoItemModel>[].obs;
|
||||
int count = 0;
|
||||
RxBool isLoading = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
|
||||
@override
|
||||
@ -122,6 +122,7 @@ class LaterController extends GetxController {
|
||||
'heroTag': heroTag,
|
||||
'sourceType': 'watchLater',
|
||||
'count': laterList.length,
|
||||
'mediaId': userInfo!.mid,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -28,18 +28,12 @@ class _LaterPageState extends State<LaterPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(
|
||||
() => _laterController.laterList.isNotEmpty
|
||||
? Text(
|
||||
'稍后再看 (${_laterController.laterList.length})',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
)
|
||||
: Text(
|
||||
'稍后再看',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
: const Text('稍后再看'),
|
||||
),
|
||||
actions: [
|
||||
Obx(
|
||||
|
@ -17,7 +17,7 @@ class LiveController extends GetxController {
|
||||
RxInt liveFollowingCount = 0.obs;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -7,7 +7,7 @@ import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class LiveFollowController extends GetxController {
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
int _currentPage = 1;
|
||||
RxInt liveFollowingCount = 0.obs;
|
||||
RxList<LiveFollowingItemModel> liveFollowingList =
|
||||
|
@ -42,13 +42,8 @@ class _LiveFollowPageState extends State<LiveFollowPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(() => Text(
|
||||
'${_liveFollowController.liveFollowingCount}人正在直播中',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
)),
|
||||
),
|
||||
body: Container(
|
||||
|
@ -33,7 +33,7 @@ class LiveRoomController extends GetxController {
|
||||
int? tempCurrentQn;
|
||||
late List<Map<String, dynamic>> acceptQnList;
|
||||
RxString currentQnDesc = ''.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int userId = 0;
|
||||
PlSocket? plSocket;
|
||||
List<String> danmuHostList = [];
|
||||
@ -69,7 +69,7 @@ class LiveRoomController extends GetxController {
|
||||
Request.getBuvid().then((value) => buvid = value);
|
||||
}
|
||||
// CDN优化
|
||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: false);
|
||||
final userInfo = userInfoCache.get('userInfoCache');
|
||||
if (userInfo != null && userInfo.mid != null) {
|
||||
userId = userInfo.mid;
|
||||
|
@ -259,8 +259,6 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: Colors.white,
|
||||
toolbarHeight: isPortrait ? 56 : 0,
|
||||
@ -314,25 +312,28 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
),
|
||||
),
|
||||
// 消息列表
|
||||
Obx(
|
||||
() => Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
bottom: 90 + padding.bottom,
|
||||
),
|
||||
height: Get.size.height -
|
||||
(padding.top +
|
||||
kToolbarHeight +
|
||||
(_liveRoomController.isPortrait.value
|
||||
? Get.size.width
|
||||
: Get.size.width * 9 / 16) +
|
||||
100 +
|
||||
padding.bottom),
|
||||
child: buildMessageListUI(
|
||||
context,
|
||||
_liveRoomController,
|
||||
_scrollController,
|
||||
Visibility(
|
||||
visible: !isLandscape,
|
||||
child: Obx(
|
||||
() => Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
bottom: 90 + padding.bottom,
|
||||
),
|
||||
height: Get.size.height -
|
||||
(padding.top +
|
||||
kToolbarHeight +
|
||||
(_liveRoomController.isPortrait.value
|
||||
? Get.size.width
|
||||
: Get.size.width * 9 / 16) +
|
||||
100 +
|
||||
padding.bottom),
|
||||
child: buildMessageListUI(
|
||||
context,
|
||||
_liveRoomController,
|
||||
_scrollController,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -35,7 +35,7 @@ class _BottomControlState extends State<BottomControl> {
|
||||
TextStyle subTitleStyle = const TextStyle(fontSize: 12);
|
||||
TextStyle titleStyle = const TextStyle(fontSize: 14);
|
||||
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -47,10 +47,7 @@ class _BottomControlState extends State<BottomControl> {
|
||||
return AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
primary: false,
|
||||
centerTitle: false,
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 14,
|
||||
title: Row(
|
||||
|
@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/http/common.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:pilipala/utils/utils.dart';
|
||||
import '../../models/common/dynamic_badge_mode.dart';
|
||||
@ -20,13 +21,13 @@ class MainController extends GetxController {
|
||||
late List<int> navBarSort;
|
||||
final StreamController<bool> bottomBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
DateTime? _lastPressedAt;
|
||||
late bool hideTabBar;
|
||||
late PageController pageController;
|
||||
int selectedIndex = 0;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
dynamic userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
||||
late bool enableGradientBg;
|
||||
@ -85,7 +86,7 @@ class MainController extends GetxController {
|
||||
}
|
||||
if (mineItemIndex != -1 && userInfo != null) {
|
||||
Widget avatar = NetworkImgLayer(
|
||||
width: 28, height: 28, src: userInfo.face, type: 'avatar');
|
||||
width: 28, height: 28, src: userInfo!.face, type: 'avatar');
|
||||
navigationBars[mineItemIndex]['icon'] = avatar;
|
||||
navigationBars[mineItemIndex]['selectIcon'] = avatar;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
late MineController _mineController;
|
||||
|
||||
int? _lastSelectTime; //上次点击时间
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late bool enableMYBar;
|
||||
|
||||
@override
|
||||
@ -113,19 +113,19 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
await GStrorage.close();
|
||||
await GStorage.close();
|
||||
EventBus().off(EventName.loginEvent);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
double sheetHeight = MediaQuery.sizeOf(context).height -
|
||||
MediaQuery.of(context).padding.top -
|
||||
MediaQuery.sizeOf(context).width * 9 / 16;
|
||||
GlobalDataCache().sheetHeight = sheetHeight;
|
||||
GlobalDataCache.sheetHeight = sheetHeight;
|
||||
localCache.put('sheetHeight', sheetHeight);
|
||||
localCache.put('statusBarHeight', statusBarHeight);
|
||||
|
||||
|
@ -9,6 +9,7 @@ import 'package:pilipala/models/member/archive.dart';
|
||||
import 'package:pilipala/models/member/coin.dart';
|
||||
import 'package:pilipala/models/member/info.dart';
|
||||
import 'package:pilipala/models/member/like.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
@ -18,11 +19,11 @@ class MemberController extends GetxController {
|
||||
late Map userStat;
|
||||
RxString face = ''.obs;
|
||||
String? heroTag;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late int ownerMid;
|
||||
// 投稿列表
|
||||
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
||||
dynamic userInfo;
|
||||
UserInfoData? userInfo;
|
||||
RxInt attribute = (-1).obs;
|
||||
RxString attributeText = '关注'.obs;
|
||||
RxList<MemberCoinsDataModel> recentCoinsList = <MemberCoinsDataModel>[].obs;
|
||||
@ -34,7 +35,7 @@ class MemberController extends GetxController {
|
||||
super.onInit();
|
||||
mid = int.tryParse(Get.parameters['mid']!) ?? -2;
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
ownerMid = userInfo != null ? userInfo.mid : -1;
|
||||
ownerMid = userInfo != null ? userInfo!.mid! : -1;
|
||||
isOwner.value = mid == ownerMid;
|
||||
face.value = Get.arguments['face'] ?? '';
|
||||
heroTag = Get.arguments['heroTag'] ?? '';
|
||||
|
@ -122,7 +122,7 @@ class ProfilePanel extends StatelessWidget {
|
||||
),
|
||||
child: Row(children: [
|
||||
Image.asset(
|
||||
'assets/images/live.gif',
|
||||
'assets/images/live.png',
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
|
@ -28,9 +28,8 @@ class MemberArchiveController extends GetxController {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
currentOrder.value = orderList.first;
|
||||
ownerMid = GlobalDataCache().userInfo != null
|
||||
? GlobalDataCache().userInfo!.mid!
|
||||
: -1;
|
||||
ownerMid =
|
||||
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||
isOwner.value = mid == -1 || mid == ownerMid;
|
||||
}
|
||||
|
||||
|
@ -47,12 +47,9 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(
|
||||
() => Text(
|
||||
'${_memberArchivesController.isOwner.value ? '我' : 'Ta'}的投稿 - ${_memberArchivesController.currentOrder['label']}',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
@ -120,7 +117,7 @@ class _MemberArchivePageState extends State<MemberArchivePage> {
|
||||
}
|
||||
} else {
|
||||
return HttpError(
|
||||
errMsg: snapshot.data['msg'],
|
||||
errMsg: snapshot.data?['msg'] ?? '请求异常',
|
||||
fn: () {},
|
||||
);
|
||||
}
|
||||
|
@ -20,9 +20,8 @@ class MemberArticleController extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
ownerMid = GlobalDataCache().userInfo != null
|
||||
? GlobalDataCache().userInfo!.mid!
|
||||
: -1;
|
||||
ownerMid =
|
||||
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||
isOwner.value = mid == -1 || mid == ownerMid;
|
||||
}
|
||||
|
||||
|
@ -48,12 +48,9 @@ class _MemberArticlePageState extends State<MemberArticlePage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(
|
||||
() => Text(
|
||||
'${_memberArticleController.isOwner.value ? '我' : 'Ta'}的图文',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -20,7 +20,6 @@ class MemberCoinsItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
String heroTag = Utils.makeHeroTag(coinItem.aid);
|
||||
return Card(
|
||||
elevation: 0,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
child: InkWell(
|
||||
|
@ -18,9 +18,8 @@ class MemberDynamicsController extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
mid = int.parse(Get.parameters['mid']!);
|
||||
ownerMid = GlobalDataCache().userInfo != null
|
||||
? GlobalDataCache().userInfo!.mid!
|
||||
: -1;
|
||||
ownerMid =
|
||||
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||
isOwner.value = mid == -1 || mid == ownerMid;
|
||||
}
|
||||
|
||||
|
@ -54,12 +54,9 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Obx(
|
||||
() => Text(
|
||||
'${_memberDynamicController.isOwner.value ? '我' : 'Ta'}的动态',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -49,7 +49,6 @@ class _MemberSearchPageState extends State<MemberSearchPage>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => _memberSearchCtr.submit(),
|
||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/http/member.dart';
|
||||
import 'package:pilipala/models/member/seasons.dart';
|
||||
import 'package:pilipala/utils/global_data_cache.dart';
|
||||
|
||||
class MemberSeasonsController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
@ -58,7 +59,7 @@ class MemberSeasonsController extends GetxController {
|
||||
mid: mid,
|
||||
seriesId: seriesId!,
|
||||
pn: pn,
|
||||
currentMid: 17340771,
|
||||
currentMid: GlobalDataCache.userInfo?.mid ?? -1,
|
||||
);
|
||||
if (res['status']) {
|
||||
seasonsList.addAll(res['data'].seriesList);
|
||||
|
@ -2,6 +2,8 @@ import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/common/constants.dart';
|
||||
import 'package:pilipala/common/skeleton/video_card_h.dart';
|
||||
import 'package:pilipala/common/widgets/http_error.dart';
|
||||
import 'controller.dart';
|
||||
import 'widgets/item.dart';
|
||||
|
||||
@ -41,12 +43,7 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0,
|
||||
centerTitle: false,
|
||||
title: Text(Get.parameters['seasonName']!,
|
||||
style: Theme.of(context).textTheme.titleMedium),
|
||||
),
|
||||
appBar: AppBar(title: Text(Get.parameters['seasonName']!)),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: StyleString.safeSpace,
|
||||
@ -59,9 +56,9 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.data != null) {
|
||||
Map data = snapshot.data as Map;
|
||||
Map? data = snapshot.data;
|
||||
List list = _memberSeasonsController.seasonsList;
|
||||
if (data['status']) {
|
||||
if (data?['status']) {
|
||||
return Obx(
|
||||
() => list.isNotEmpty
|
||||
? LayoutBuilder(
|
||||
@ -87,16 +84,44 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
||||
);
|
||||
},
|
||||
)
|
||||
: const SizedBox(),
|
||||
: const HttpError(
|
||||
errMsg: '没有数据',
|
||||
isInSliver: false,
|
||||
isShowBtn: false,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
return HttpError(
|
||||
errMsg: snapshot.data['msg'],
|
||||
isInSliver: false,
|
||||
fn: () {
|
||||
setState(() {
|
||||
_futureBuilderFuture =
|
||||
_memberSeasonsController.onRefresh();
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return const SizedBox();
|
||||
return HttpError(
|
||||
errMsg: snapshot.data['msg'] ?? '请求异常',
|
||||
isInSliver: false,
|
||||
fn: () {
|
||||
setState(() {
|
||||
_futureBuilderFuture =
|
||||
_memberSeasonsController.onRefresh();
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return const SizedBox();
|
||||
return ListView.builder(
|
||||
itemCount: 10,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return const VideoCardHSkeleton();
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
@ -47,9 +47,7 @@ class _MessageAtPageState extends State<MessageAtPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('@我的'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('@我的')),
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await _messageAtCtr.queryMessageAt(type: 'init');
|
||||
@ -129,7 +127,7 @@ class AtItem extends StatelessWidget {
|
||||
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
MessageUtils.onClickMessage(context, uri, nativeUri, type);
|
||||
MessageUtils.onClickMessage(context, uri, nativeUri, type, null);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
|
@ -47,9 +47,7 @@ class _MessageLikePageState extends State<MessageLikePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('收到的赞'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('收到的赞')),
|
||||
body: RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await _messageLikeCtr.queryMessageLike(type: 'init');
|
||||
@ -127,7 +125,7 @@ class LikeItem extends StatelessWidget {
|
||||
final String type = item.item!.type!;
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
MessageUtils.onClickMessage(context, uri, nativeUri, type);
|
||||
MessageUtils.onClickMessage(context, uri, nativeUri, type, null);
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user