Merge branch 'main' into feature-pureBlackMode
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 localProperties = new Properties()
|
||||||
def localPropertiesFile = rootProject.file('local.properties')
|
def localPropertiesFile = rootProject.file('local.properties')
|
||||||
if (localPropertiesFile.exists()) {
|
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')
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
if (flutterVersionCode == null) {
|
if (flutterVersionCode == null) {
|
||||||
@ -21,9 +23,6 @@ if (flutterVersionName == null) {
|
|||||||
flutterVersionName = '1.0'
|
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 keystorePropertiesFile = rootProject.file('key.properties')
|
||||||
def keystoreProperties = new 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"]
|
def _keyPassword = System.getenv("KEY_PASSWORD") ?: keystoreProperties["keyPassword"]
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
namespace "com.guozhigq.pilipala"
|
||||||
compileSdkVersion flutter.compileSdkVersion
|
compileSdkVersion flutter.compileSdkVersion
|
||||||
ndkVersion flutter.ndkVersion
|
ndkVersion "27.0.12077973"
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
@ -91,9 +91,6 @@ flutter {
|
|||||||
source '../..'
|
source '../..'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
||||||
import com.android.build.OutputFile
|
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
|
||||||
@ -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 {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
@ -20,6 +8,15 @@ allprojects {
|
|||||||
|
|
||||||
rootProject.buildDir = '../build'
|
rootProject.buildDir = '../build'
|
||||||
subprojects {
|
subprojects {
|
||||||
|
afterEvaluate { project ->
|
||||||
|
if (project.hasProperty('android')) {
|
||||||
|
project.android {
|
||||||
|
if (namespace == null) {
|
||||||
|
namespace project.group
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||||
}
|
}
|
||||||
subprojects {
|
subprojects {
|
||||||
|
|||||||
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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")
|
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||||
def properties = new Properties()
|
|
||||||
|
|
||||||
assert localPropertiesFile.exists()
|
repositories {
|
||||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
plugins {
|
||||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
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 |
@ -98,7 +98,8 @@ class _PagesBottomSheetState extends State<PagesBottomSheet>
|
|||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
final ScrollController _listScrollController = ScrollController();
|
final ScrollController _listScrollController = ScrollController();
|
||||||
late ListObserverController _listObserverController;
|
late ListObserverController _listObserverController;
|
||||||
final ScrollController _scrollController = ScrollController();
|
late GridObserverController _gridObserverController;
|
||||||
|
final ScrollController _gridScrollController = ScrollController();
|
||||||
late int currentIndex;
|
late int currentIndex;
|
||||||
TabController? tabController;
|
TabController? tabController;
|
||||||
List<ListObserverController>? _listObserverControllerList;
|
List<ListObserverController>? _listObserverControllerList;
|
||||||
@ -163,6 +164,9 @@ class _PagesBottomSheetState extends State<PagesBottomSheet>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
_gridObserverController =
|
||||||
|
GridObserverController(controller: _gridScrollController);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,25 +182,19 @@ class _PagesBottomSheetState extends State<PagesBottomSheet>
|
|||||||
isFixedHeight: true,
|
isFixedHeight: true,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
_listObserverControllerList![widget.currentEpisodeIndex!]
|
_listObserverControllerList![widget.currentEpisodeIndex ?? 0]
|
||||||
.initialIndexModel = ObserverIndexPositionModel(
|
.initialIndexModel = ObserverIndexPositionModel(
|
||||||
index: currentIndex,
|
index: currentIndex,
|
||||||
isFixedHeight: true,
|
isFixedHeight: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_gridObserverController.initialIndexModel = ObserverIndexPositionModel(
|
||||||
|
index: currentIndex,
|
||||||
|
isFixedHeight: false,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (widget.dataType != VideoEpidoesType.videoEpisode) {
|
|
||||||
double itemHeight = (widget.isFullScreen
|
|
||||||
? 400
|
|
||||||
: Get.size.width - 3 * StyleString.safeSpace) /
|
|
||||||
5.2;
|
|
||||||
double offset = ((currentIndex - 1) / 2).ceil() * itemHeight;
|
|
||||||
_scrollController.jumpTo(offset);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取订阅状态
|
// 获取订阅状态
|
||||||
@ -236,7 +234,9 @@ class _PagesBottomSheetState extends State<PagesBottomSheet>
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
try {
|
try {
|
||||||
_listObserverController.controller?.dispose();
|
_listObserverController.controller?.dispose();
|
||||||
|
_gridObserverController.controller?.dispose();
|
||||||
_listScrollController.dispose();
|
_listScrollController.dispose();
|
||||||
|
_gridScrollController.dispose();
|
||||||
for (var element in _listObserverControllerList!) {
|
for (var element in _listObserverControllerList!) {
|
||||||
element.controller?.dispose();
|
element.controller?.dispose();
|
||||||
}
|
}
|
||||||
@ -303,24 +303,27 @@ class _PagesBottomSheetState extends State<PagesBottomSheet>
|
|||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 12.0), // 设置左右间距为12
|
horizontal: 12.0), // 设置左右间距为12
|
||||||
child: GridView.count(
|
child: GridViewObserver(
|
||||||
controller: _scrollController,
|
controller: _gridObserverController,
|
||||||
crossAxisCount: 2,
|
child: GridView.count(
|
||||||
crossAxisSpacing: StyleString.safeSpace,
|
controller: _gridScrollController,
|
||||||
childAspectRatio: 2.6,
|
crossAxisCount: 2,
|
||||||
children: List.generate(
|
crossAxisSpacing: StyleString.safeSpace,
|
||||||
widget.episodes.length,
|
childAspectRatio: 2.6,
|
||||||
(index) {
|
children: List.generate(
|
||||||
bool isCurrentIndex = currentIndex == index;
|
widget.episodes.length,
|
||||||
return EpisodeGridItem(
|
(index) {
|
||||||
episode: widget.episodes[index],
|
bool isCurrentIndex = currentIndex == index;
|
||||||
index: index,
|
return EpisodeGridItem(
|
||||||
isCurrentIndex: isCurrentIndex,
|
episode: widget.episodes[index],
|
||||||
dataType: widget.dataType,
|
index: index,
|
||||||
changeFucCall: widget.changeFucCall,
|
isCurrentIndex: isCurrentIndex,
|
||||||
isFullScreen: widget.isFullScreen,
|
dataType: widget.dataType,
|
||||||
);
|
changeFucCall: widget.changeFucCall,
|
||||||
},
|
isFullScreen: widget.isFullScreen,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
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/plugin/pl_gallery/interactiveviewer_gallery.dart';
|
||||||
import 'package:pilipala/utils/highlight.dart';
|
import 'package:pilipala/utils/highlight.dart';
|
||||||
|
|
||||||
|
import '../../utils/global_data_cache.dart';
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class HtmlRender extends StatelessWidget {
|
class HtmlRender extends StatelessWidget {
|
||||||
const HtmlRender({
|
const HtmlRender({
|
||||||
@ -41,6 +43,8 @@ class HtmlRender extends StatelessWidget {
|
|||||||
TagExtension(
|
TagExtension(
|
||||||
tagsToExtend: <String>{'img'},
|
tagsToExtend: <String>{'img'},
|
||||||
builder: (ExtensionContext extensionContext) {
|
builder: (ExtensionContext extensionContext) {
|
||||||
|
int defaultImgQuality = 10;
|
||||||
|
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||||
try {
|
try {
|
||||||
final Map<String, dynamic> attributes =
|
final Map<String, dynamic> attributes =
|
||||||
extensionContext.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) {
|
} catch (err) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
@ -138,6 +142,14 @@ class HtmlRender extends StatelessWidget {
|
|||||||
textAlign: TextAlign.justify,
|
textAlign: TextAlign.justify,
|
||||||
),
|
),
|
||||||
'img': Style(margin: Margins.only(top: 4, bottom: 4)),
|
'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,
|
||||||
|
),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
int defaultImgQuality = 10;
|
int defaultImgQuality = 10;
|
||||||
try {
|
try {
|
||||||
defaultImgQuality = GlobalDataCache().imgQuality;
|
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
if (src == '' || src == null) {
|
if (src == '' || src == null) {
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import '../../http/video.dart';
|
|||||||
import '../../utils/utils.dart';
|
import '../../utils/utils.dart';
|
||||||
import '../constants.dart';
|
import '../constants.dart';
|
||||||
import 'badge.dart';
|
import 'badge.dart';
|
||||||
|
import 'drag_handle.dart';
|
||||||
import 'network_img_layer.dart';
|
import 'network_img_layer.dart';
|
||||||
import 'stat/danmu.dart';
|
import 'stat/danmu.dart';
|
||||||
import 'stat/view.dart';
|
import 'stat/view.dart';
|
||||||
@ -373,27 +374,12 @@ class MorePanel extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async => await menuActionHandler('block'),
|
onTap: () async => await menuActionHandler('block'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:pilipala/utils/feed_back.dart';
|
|||||||
import 'package:pilipala/utils/image_save.dart';
|
import 'package:pilipala/utils/image_save.dart';
|
||||||
import 'package:pilipala/utils/route_push.dart';
|
import 'package:pilipala/utils/route_push.dart';
|
||||||
import '../../models/model_rec_video_item.dart';
|
import '../../models/model_rec_video_item.dart';
|
||||||
|
import 'drag_handle.dart';
|
||||||
import 'stat/danmu.dart';
|
import 'stat/danmu.dart';
|
||||||
import 'stat/view.dart';
|
import 'stat/view.dart';
|
||||||
import '../../http/dynamics.dart';
|
import '../../http/dynamics.dart';
|
||||||
@ -368,27 +369,12 @@ class MorePanel extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async => await menuActionHandler('block'),
|
onTap: () async => await menuActionHandler('block'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
|
|||||||
@ -622,4 +622,8 @@ class Api {
|
|||||||
|
|
||||||
/// 视频标签
|
/// 视频标签
|
||||||
static const String videoTag = '/x/tag/archive/tags';
|
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,8 +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 'package:pilipala/models/sponsor_block/segment.dart';
|
||||||
|
|
||||||
import 'index.dart';
|
import 'index.dart';
|
||||||
|
|
||||||
class CommonHttp {
|
class CommonHttp {
|
||||||
|
static final RegExp spmPrefixExp =
|
||||||
|
RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
||||||
static Future unReadDynamic() async {
|
static Future unReadDynamic() async {
|
||||||
var res = await Request().get(Api.getUnreadDynamic,
|
var res = await Request().get(Api.getUnreadDynamic,
|
||||||
data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0});
|
data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0});
|
||||||
@ -43,4 +50,68 @@ class CommonHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,8 @@ class HttpString {
|
|||||||
static const String messageBaseUrl = 'https://message.bilibili.com';
|
static const String messageBaseUrl = 'https://message.bilibili.com';
|
||||||
static const String bangumiBaseUrl = 'https://bili.meark.me';
|
static const String bangumiBaseUrl = 'https://bili.meark.me';
|
||||||
static const String sponsorBlockBaseUrl = 'https://www.bsbsb.top';
|
static const String sponsorBlockBaseUrl = 'https://www.bsbsb.top';
|
||||||
|
static const String biliplusBaseUrl = 'https://www.biliplus.com';
|
||||||
|
|
||||||
static const List<int> validateStatusCodes = [
|
static const List<int> validateStatusCodes = [
|
||||||
302,
|
302,
|
||||||
304,
|
304,
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math' show Random;
|
|
||||||
import 'package:cookie_jar/cookie_jar.dart';
|
import 'package:cookie_jar/cookie_jar.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:dio/io.dart';
|
import 'package:dio/io.dart';
|
||||||
@ -13,7 +11,6 @@ import 'package:pilipala/models/user/info.dart';
|
|||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import '../utils/storage.dart';
|
import '../utils/storage.dart';
|
||||||
import '../utils/utils.dart';
|
import '../utils/utils.dart';
|
||||||
import 'api.dart';
|
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
import 'interceptor.dart';
|
import 'interceptor.dart';
|
||||||
|
|
||||||
@ -27,8 +24,6 @@ class Request {
|
|||||||
late bool enableSystemProxy;
|
late bool enableSystemProxy;
|
||||||
late String systemProxyHost;
|
late String systemProxyHost;
|
||||||
late String systemProxyPort;
|
late String systemProxyPort;
|
||||||
static final RegExp spmPrefixExp =
|
|
||||||
RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
|
||||||
static String? buvid;
|
static String? buvid;
|
||||||
|
|
||||||
/// 设置cookie
|
/// 设置cookie
|
||||||
@ -62,11 +57,6 @@ class Request {
|
|||||||
baseUrlType = 'bangumi';
|
baseUrlType = 'bangumi';
|
||||||
}
|
}
|
||||||
setBaseUrl(type: baseUrlType);
|
setBaseUrl(type: baseUrlType);
|
||||||
try {
|
|
||||||
await buvidActivate();
|
|
||||||
} catch (e) {
|
|
||||||
log("setCookie, ${e.toString()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
final String cookieString = cookie
|
final String cookieString = cookie
|
||||||
.map((Cookie cookie) => '${cookie.name}=${cookie.value}')
|
.map((Cookie cookie) => '${cookie.name}=${cookie.value}')
|
||||||
@ -78,7 +68,7 @@ class Request {
|
|||||||
// 从cookie中获取 csrf token
|
// 从cookie中获取 csrf token
|
||||||
static Future<String> getCsrf() async {
|
static Future<String> getCsrf() async {
|
||||||
List<Cookie> cookies = await cookieManager.cookieJar
|
List<Cookie> cookies = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
|
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||||
String token = '';
|
String token = '';
|
||||||
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
|
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
|
||||||
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
|
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
|
||||||
@ -92,9 +82,12 @@ class Request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<Cookie> cookies = await cookieManager.cookieJar
|
final List<Cookie> cookies = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
|
||||||
buvid = cookies.firstWhere((cookie) => cookie.name == 'buvid3').value;
|
buvid = cookies
|
||||||
if (buvid == null) {
|
.firstWhere((cookie) => cookie.name == 'buvid3',
|
||||||
|
orElse: () => Cookie('buvid3', ''))
|
||||||
|
.value;
|
||||||
|
if (buvid == null || buvid!.isEmpty) {
|
||||||
try {
|
try {
|
||||||
var result = await Request().get(
|
var result = await Request().get(
|
||||||
"${HttpString.apiBaseUrl}/x/frontend/finger/spi",
|
"${HttpString.apiBaseUrl}/x/frontend/finger/spi",
|
||||||
@ -122,30 +115,6 @@ class Request {
|
|||||||
dio.options.headers['referer'] = 'https://www.bilibili.com/';
|
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
|
* config it and create
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class MemberHttp {
|
|||||||
}) async {
|
}) async {
|
||||||
String? wWebid;
|
String? wWebid;
|
||||||
if ((await getWWebid(mid: mid))['status']) {
|
if ((await getWWebid(mid: mid))['status']) {
|
||||||
wWebid = GlobalDataCache().wWebid;
|
wWebid = GlobalDataCache.wWebid;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map params = await WbiSign().makSign({
|
Map params = await WbiSign().makSign({
|
||||||
@ -574,7 +574,7 @@ class MemberHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Future getWWebid({required int mid}) async {
|
static Future getWWebid({required int mid}) async {
|
||||||
String? wWebid = GlobalDataCache().wWebid;
|
String? wWebid = GlobalDataCache.wWebid;
|
||||||
if (wWebid != null) {
|
if (wWebid != null) {
|
||||||
return {'status': true, 'data': wWebid};
|
return {'status': true, 'data': wWebid};
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ class MemberHttp {
|
|||||||
final content = match.group(1);
|
final content = match.group(1);
|
||||||
String decodedString = Uri.decodeComponent(content!);
|
String decodedString = Uri.decodeComponent(content!);
|
||||||
Map<String, dynamic> map = jsonDecode(decodedString);
|
Map<String, dynamic> map = jsonDecode(decodedString);
|
||||||
GlobalDataCache().wWebid = map['access_id'];
|
GlobalDataCache.wWebid = map['access_id'];
|
||||||
return {'status': true, 'data': map['access_id']};
|
return {'status': true, 'data': map['access_id']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': '请检查登录状态'};
|
return {'status': false, 'data': '请检查登录状态'};
|
||||||
@ -605,7 +605,7 @@ class MemberHttp {
|
|||||||
}) async {
|
}) async {
|
||||||
String? wWebid;
|
String? wWebid;
|
||||||
if ((await getWWebid(mid: mid))['status']) {
|
if ((await getWWebid(mid: mid))['status']) {
|
||||||
wWebid = GlobalDataCache().wWebid;
|
wWebid = GlobalDataCache.wWebid;
|
||||||
}
|
}
|
||||||
Map params = await WbiSign().makSign({
|
Map params = await WbiSign().makSign({
|
||||||
'host_mid': mid,
|
'host_mid': mid,
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/common/widgets/custom_toast.dart';
|
import 'package:pilipala/common/widgets/custom_toast.dart';
|
||||||
|
import 'package:pilipala/http/common.dart';
|
||||||
import 'package:pilipala/http/init.dart';
|
import 'package:pilipala/http/init.dart';
|
||||||
import 'package:pilipala/models/common/color_type.dart';
|
import 'package:pilipala/models/common/color_type.dart';
|
||||||
import 'package:pilipala/models/common/theme_type.dart';
|
import 'package:pilipala/models/common/theme_type.dart';
|
||||||
@ -65,7 +66,8 @@ void main() async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PiliSchame.init();
|
PiliSchame.init();
|
||||||
await GlobalDataCache().initialize();
|
await GlobalDataCache.initialize();
|
||||||
|
CommonHttp.buvidActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
|
|||||||
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(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/common/widgets/badge.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/network_img_layer.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||||
@ -445,27 +446,12 @@ class BangumiStatusWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget morePanel(BuildContext context, BangumiIntroController ctr) {
|
Widget morePanel(BuildContext context, BangumiIntroController ctr) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
...ctr.followStatusList
|
...ctr.followStatusList
|
||||||
.map(
|
.map(
|
||||||
(e) => ListTile(
|
(e) => ListTile(
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hive/hive.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/danmu.dart';
|
||||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
@ -23,94 +24,81 @@ class IntroDetail extends StatelessWidget {
|
|||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
);
|
);
|
||||||
return Container(
|
return Container(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
padding: const EdgeInsets.only(left: 14, right: 14),
|
|
||||||
height: sheetHeight,
|
height: sheetHeight,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: SingleChildScrollView(
|
||||||
children: [
|
child: Column(
|
||||||
Text(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
bangumiDetail!.title,
|
children: [
|
||||||
style: const TextStyle(
|
Text(
|
||||||
fontSize: 16,
|
bangumiDetail!.title,
|
||||||
fontWeight: FontWeight.w500,
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
const SizedBox(height: 4),
|
Row(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
StatView(
|
||||||
StatView(
|
view: bangumiDetail!.stat!['views'],
|
||||||
view: bangumiDetail!.stat!['views'],
|
size: 'medium',
|
||||||
size: 'medium',
|
),
|
||||||
),
|
const SizedBox(width: 6),
|
||||||
const SizedBox(width: 6),
|
StatDanMu(
|
||||||
StatDanMu(
|
danmu: bangumiDetail!.stat!['danmakus'],
|
||||||
danmu: bangumiDetail!.stat!['danmakus'],
|
size: 'medium',
|
||||||
size: 'medium',
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
const SizedBox(height: 4),
|
Row(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Text(
|
||||||
Text(
|
bangumiDetail!.areas!.first['name'],
|
||||||
bangumiDetail!.areas!.first['name'],
|
style: smallTitle,
|
||||||
style: smallTitle,
|
),
|
||||||
),
|
const SizedBox(width: 6),
|
||||||
const SizedBox(width: 6),
|
Text(
|
||||||
Text(
|
bangumiDetail!.publish!['pub_time_show'],
|
||||||
bangumiDetail!.publish!['pub_time_show'],
|
style: smallTitle,
|
||||||
style: smallTitle,
|
),
|
||||||
),
|
const SizedBox(width: 6),
|
||||||
const SizedBox(width: 6),
|
Text(
|
||||||
Text(
|
bangumiDetail!.newEp!['desc'],
|
||||||
bangumiDetail!.newEp!['desc'],
|
style: smallTitle,
|
||||||
style: smallTitle,
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(height: 20),
|
Text(
|
||||||
Text(
|
'简介:',
|
||||||
'简介:',
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
const SizedBox(height: 4),
|
Text(
|
||||||
Text(
|
'${bangumiDetail!.evaluate!}',
|
||||||
'${bangumiDetail!.evaluate!}',
|
style: smallTitle.copyWith(fontSize: 13),
|
||||||
style: smallTitle.copyWith(fontSize: 13),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(height: 20),
|
Text(
|
||||||
Text(
|
'声优:',
|
||||||
'声优:',
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
const SizedBox(height: 4),
|
Text(
|
||||||
Text(
|
bangumiDetail.actors,
|
||||||
bangumiDetail.actors,
|
style: smallTitle.copyWith(fontSize: 13),
|
||||||
style: smallTitle.copyWith(fontSize: 13),
|
),
|
||||||
),
|
SizedBox(height: MediaQuery.of(context).padding.bottom + 20)
|
||||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 20)
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import '../../../models/video/reply/item.dart';
|
|||||||
import '../widgets/dynamic_panel.dart';
|
import '../widgets/dynamic_panel.dart';
|
||||||
|
|
||||||
class DynamicDetailPage extends StatefulWidget {
|
class DynamicDetailPage extends StatefulWidget {
|
||||||
// const DynamicDetailPage({super.key});
|
|
||||||
const DynamicDetailPage({Key? key}) : super(key: key);
|
const DynamicDetailPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -90,19 +89,22 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
_dynamicDetailController = Get.put(
|
_dynamicDetailController = Get.put(
|
||||||
DynamicDetailController(oid, replyType),
|
DynamicDetailController(oid, replyType),
|
||||||
tag: opusId.toString());
|
tag: opusId.toString());
|
||||||
|
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
||||||
await _dynamicDetailController.reqHtmlByOpusId(opusId!);
|
await _dynamicDetailController.reqHtmlByOpusId(opusId!);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oid = moduleDynamic.major!.draw!.id!;
|
oid = moduleDynamic.major!.draw!.id!;
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (err) {
|
||||||
|
print('err:${err.toString()}');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!isOpusId) {
|
if (!isOpusId) {
|
||||||
_dynamicDetailController =
|
_dynamicDetailController =
|
||||||
Get.put(DynamicDetailController(oid, replyType), tag: oid.toString());
|
Get.put(DynamicDetailController(oid, replyType), tag: oid.toString());
|
||||||
|
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
||||||
}
|
}
|
||||||
_futureBuilderFuture = _dynamicDetailController.queryReplyList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看二级评论
|
// 查看二级评论
|
||||||
@ -132,7 +134,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
// 分页加载
|
// 分页加载
|
||||||
if (scrollController.position.pixels >=
|
if (scrollController.position.pixels >=
|
||||||
scrollController.position.maxScrollExtent - 300) {
|
scrollController.position.maxScrollExtent - 300) {
|
||||||
EasyThrottle.throttle('replylist', const Duration(seconds: 2), () {
|
EasyThrottle.throttle('replyList', const Duration(seconds: 2), () {
|
||||||
_dynamicDetailController.onLoad();
|
_dynamicDetailController.onLoad();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.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/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
@ -108,28 +109,12 @@ class MorePanel extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
// clipBehavior: Clip.hardEdge,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
List<LiveUserItem> liveList = [];
|
List<LiveUserItem> liveList = [];
|
||||||
static const itemPadding = EdgeInsets.symmetric(horizontal: 5, vertical: 0);
|
static const itemPadding = EdgeInsets.symmetric(horizontal: 5, vertical: 0);
|
||||||
late MyInfo userInfo;
|
late MyInfo userInfo;
|
||||||
|
RxBool showLiveUser = false.obs;
|
||||||
|
|
||||||
void listFormat() {
|
void listFormat() {
|
||||||
userInfo = widget.upData.myInfo!;
|
userInfo = widget.upData.myInfo!;
|
||||||
@ -131,21 +132,70 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
if (liveList.isNotEmpty) ...[
|
if (liveList.isNotEmpty) ...[
|
||||||
for (int i = 0; i < liveList.length; i++) ...[
|
Obx(
|
||||||
upItemBuild(liveList[i], i)
|
() => AnimatedSwitcher(
|
||||||
],
|
duration: const Duration(milliseconds: 300),
|
||||||
VerticalDivider(
|
transitionBuilder: (Widget child,
|
||||||
indent: 20,
|
Animation<double> animation) {
|
||||||
endIndent: 40,
|
return FadeTransition(
|
||||||
width: 26,
|
opacity: animation, child: child);
|
||||||
color: Theme.of(context)
|
},
|
||||||
.colorScheme
|
child: showLiveUser.value
|
||||||
.primary
|
? Row(
|
||||||
.withOpacity(0.5),
|
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++) ...[
|
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),
|
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(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
if (data.type == 'up') {
|
if (data.type == 'up') {
|
||||||
EasyThrottle.throttle('follow', const Duration(milliseconds: 300),
|
EasyThrottle.throttle('follow', const Duration(milliseconds: 300),
|
||||||
() {
|
() {
|
||||||
if (GlobalDataCache().enableDynamicSwitch) {
|
if (GlobalDataCache.enableDynamicSwitch) {
|
||||||
onClickUp(data, i);
|
onClickUp(data, index);
|
||||||
} else {
|
} else {
|
||||||
onClickUpAni(data, i);
|
onClickUpAni(data, index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (data.type == 'live') {
|
} else if (data.type == 'live') {
|
||||||
@ -251,13 +386,12 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
softWrap: false,
|
softWrap: false,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: currentMid.value == data.mid
|
color: currentMid.value == data.mid
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Theme.of(context).colorScheme.outline,
|
: Theme.of(context).colorScheme.outline,
|
||||||
fontSize: Theme.of(context)
|
fontSize:
|
||||||
.textTheme
|
Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
.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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pilipala/http/common.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import 'package:pilipala/http/video.dart';
|
import 'package:pilipala/http/video.dart';
|
||||||
import 'package:pilipala/models/user/fav_detail.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/pages/fav/index.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
|
import 'widget/invalid_video_card.dart';
|
||||||
|
|
||||||
class FavDetailController extends GetxController {
|
class FavDetailController extends GetxController {
|
||||||
FavFolderItemData? item;
|
FavFolderItemData? item;
|
||||||
RxString title = ''.obs;
|
RxString title = ''.obs;
|
||||||
@ -131,8 +134,9 @@ class FavDetailController extends GetxController {
|
|||||||
'privacy': [22, 0].contains(item!.attr) ? 0 : 1,
|
'privacy': [22, 0].contains(item!.attr) ? 0 : 1,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
title.value = res['title'];
|
if (res != null) {
|
||||||
print(title);
|
title.value = res['title'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future toViewPlayAll() async {
|
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,
|
isOwner: _favDetailController.isOwner,
|
||||||
callFn: () => _favDetailController
|
callFn: () => _favDetailController
|
||||||
.onCancelFav(favList[index].id),
|
.onCancelFav(favList[index].id),
|
||||||
|
viewInvalidVideoCb: () => _favDetailController
|
||||||
|
.toViewInvalidVideo(favList[index]),
|
||||||
);
|
);
|
||||||
}, childCount: favList.length),
|
}, childCount: favList.length),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
final Function? callFn;
|
final Function? callFn;
|
||||||
final int? searchType;
|
final int? searchType;
|
||||||
final String isOwner;
|
final String isOwner;
|
||||||
|
final Function? viewInvalidVideoCb;
|
||||||
|
|
||||||
const FavVideoCardH({
|
const FavVideoCardH({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -26,6 +27,7 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
this.callFn,
|
this.callFn,
|
||||||
this.searchType,
|
this.searchType,
|
||||||
required this.isOwner,
|
required this.isOwner,
|
||||||
|
this.viewInvalidVideoCb,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -36,6 +38,10 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
// int? seasonId;
|
// int? seasonId;
|
||||||
|
if (videoItem.title == '已失效视频') {
|
||||||
|
viewInvalidVideoCb?.call();
|
||||||
|
return;
|
||||||
|
}
|
||||||
String? epId;
|
String? epId;
|
||||||
if (videoItem.ogv != null &&
|
if (videoItem.ogv != null &&
|
||||||
(videoItem.ogv['type_name'] == '番剧' ||
|
(videoItem.ogv['type_name'] == '番剧' ||
|
||||||
@ -65,11 +71,17 @@ class FavVideoCardH extends StatelessWidget {
|
|||||||
epId != null ? SearchType.media_bangumi : SearchType.video,
|
epId != null ? SearchType.media_bangumi : SearchType.video,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLongPress: () => imageSaveDialog(
|
onLongPress: () {
|
||||||
context,
|
if (videoItem.title == '已失效视频') {
|
||||||
videoItem,
|
SmartDialog.showToast('视频已失效');
|
||||||
SmartDialog.dismiss,
|
return;
|
||||||
),
|
}
|
||||||
|
imageSaveDialog(
|
||||||
|
context,
|
||||||
|
videoItem,
|
||||||
|
SmartDialog.dismiss,
|
||||||
|
);
|
||||||
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
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,
|
intro: intro,
|
||||||
mediaId: mediaId!,
|
mediaId: mediaId!,
|
||||||
cover: cover,
|
cover: cover,
|
||||||
|
privacy: privacy.value,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
SmartDialog.showToast('编辑成功');
|
SmartDialog.showToast('编辑成功');
|
||||||
@ -74,4 +75,14 @@ class FavEditController extends GetxController {
|
|||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void togglePrivacy() {
|
||||||
|
if (privacy.value == 0) {
|
||||||
|
privacy.value = 1;
|
||||||
|
SmartDialog.showToast('设置为私密后,只有自己可见');
|
||||||
|
} else {
|
||||||
|
privacy.value = 0;
|
||||||
|
SmartDialog.showToast('设置为公开后,所有人可见');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,31 +21,22 @@ class _FavEditPageState extends State<FavEditPage> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Obx(
|
title: Obx(
|
||||||
() => _favEditController.type.value == 'add'
|
() => _favEditController.type.value == 'add'
|
||||||
? Text(
|
? const Text('新建收藏夹')
|
||||||
'新建收藏夹',
|
: const Text('编辑收藏夹'),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
)
|
|
||||||
: Text(
|
|
||||||
'编辑收藏夹',
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
Obx(
|
Obx(
|
||||||
() => _favEditController.privacy.value == 0
|
() => IconButton(
|
||||||
? IconButton(
|
onPressed: _favEditController.togglePrivacy,
|
||||||
onPressed: () {
|
icon: Icon(
|
||||||
_favEditController.privacy.value = 1;
|
_favEditController.privacy.value == 0
|
||||||
},
|
? Icons.lock_open_outlined
|
||||||
icon: const Icon(Icons.lock_open_outlined))
|
: Icons.lock_outlined,
|
||||||
: IconButton(
|
color: _favEditController.privacy.value == 0
|
||||||
onPressed: () {
|
? null
|
||||||
_favEditController.privacy.value = 0;
|
: Theme.of(context).colorScheme.error,
|
||||||
},
|
),
|
||||||
icon: Icon(
|
),
|
||||||
Icons.lock_outlined,
|
|
||||||
color: Theme.of(context).colorScheme.error,
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: _favEditController.onSubmit, child: const Text('保存')),
|
onPressed: _favEditController.onSubmit, child: const Text('保存')),
|
||||||
|
|||||||
@ -122,6 +122,7 @@ class LaterController extends GetxController {
|
|||||||
'heroTag': heroTag,
|
'heroTag': heroTag,
|
||||||
'sourceType': 'watchLater',
|
'sourceType': 'watchLater',
|
||||||
'count': laterList.length,
|
'count': laterList.length,
|
||||||
|
'mediaId': userInfo!.mid,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class LiveRoomController extends GetxController {
|
|||||||
Request.getBuvid().then((value) => buvid = value);
|
Request.getBuvid().then((value) => buvid = value);
|
||||||
}
|
}
|
||||||
// CDN优化
|
// CDN优化
|
||||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: false);
|
||||||
final userInfo = userInfoCache.get('userInfoCache');
|
final userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo != null && userInfo.mid != null) {
|
if (userInfo != null && userInfo.mid != null) {
|
||||||
userId = userInfo.mid;
|
userId = userInfo.mid;
|
||||||
|
|||||||
@ -312,25 +312,28 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
// 消息列表
|
// 消息列表
|
||||||
Obx(
|
Visibility(
|
||||||
() => Align(
|
visible: !isLandscape,
|
||||||
alignment: Alignment.bottomCenter,
|
child: Obx(
|
||||||
child: Container(
|
() => Align(
|
||||||
margin: EdgeInsets.only(
|
alignment: Alignment.bottomCenter,
|
||||||
bottom: 90 + padding.bottom,
|
child: Container(
|
||||||
),
|
margin: EdgeInsets.only(
|
||||||
height: Get.size.height -
|
bottom: 90 + padding.bottom,
|
||||||
(padding.top +
|
),
|
||||||
kToolbarHeight +
|
height: Get.size.height -
|
||||||
(_liveRoomController.isPortrait.value
|
(padding.top +
|
||||||
? Get.size.width
|
kToolbarHeight +
|
||||||
: Get.size.width * 9 / 16) +
|
(_liveRoomController.isPortrait.value
|
||||||
100 +
|
? Get.size.width
|
||||||
padding.bottom),
|
: Get.size.width * 9 / 16) +
|
||||||
child: buildMessageListUI(
|
100 +
|
||||||
context,
|
padding.bottom),
|
||||||
_liveRoomController,
|
child: buildMessageListUI(
|
||||||
_scrollController,
|
context,
|
||||||
|
_liveRoomController,
|
||||||
|
_scrollController,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -125,7 +125,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
|||||||
double sheetHeight = MediaQuery.sizeOf(context).height -
|
double sheetHeight = MediaQuery.sizeOf(context).height -
|
||||||
MediaQuery.of(context).padding.top -
|
MediaQuery.of(context).padding.top -
|
||||||
MediaQuery.sizeOf(context).width * 9 / 16;
|
MediaQuery.sizeOf(context).width * 9 / 16;
|
||||||
GlobalDataCache().sheetHeight = sheetHeight;
|
GlobalDataCache.sheetHeight = sheetHeight;
|
||||||
localCache.put('sheetHeight', sheetHeight);
|
localCache.put('sheetHeight', sheetHeight);
|
||||||
localCache.put('statusBarHeight', statusBarHeight);
|
localCache.put('statusBarHeight', statusBarHeight);
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,8 @@ class MemberArchiveController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.parse(Get.parameters['mid']!);
|
mid = int.parse(Get.parameters['mid']!);
|
||||||
currentOrder.value = orderList.first;
|
currentOrder.value = orderList.first;
|
||||||
ownerMid = GlobalDataCache().userInfo != null
|
ownerMid =
|
||||||
? GlobalDataCache().userInfo!.mid!
|
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||||
: -1;
|
|
||||||
isOwner.value = mid == -1 || mid == ownerMid;
|
isOwner.value = mid == -1 || mid == ownerMid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,9 +20,8 @@ class MemberArticleController extends GetxController {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.parse(Get.parameters['mid']!);
|
mid = int.parse(Get.parameters['mid']!);
|
||||||
ownerMid = GlobalDataCache().userInfo != null
|
ownerMid =
|
||||||
? GlobalDataCache().userInfo!.mid!
|
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||||
: -1;
|
|
||||||
isOwner.value = mid == -1 || mid == ownerMid;
|
isOwner.value = mid == -1 || mid == ownerMid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,9 +18,8 @@ class MemberDynamicsController extends GetxController {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.parse(Get.parameters['mid']!);
|
mid = int.parse(Get.parameters['mid']!);
|
||||||
ownerMid = GlobalDataCache().userInfo != null
|
ownerMid =
|
||||||
? GlobalDataCache().userInfo!.mid!
|
GlobalDataCache.userInfo != null ? GlobalDataCache.userInfo!.mid! : -1;
|
||||||
: -1;
|
|
||||||
isOwner.value = mid == -1 || mid == ownerMid;
|
isOwner.value = mid == -1 || mid == ownerMid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class MemberSeasonsController extends GetxController {
|
|||||||
mid: mid,
|
mid: mid,
|
||||||
seriesId: seriesId!,
|
seriesId: seriesId!,
|
||||||
pn: pn,
|
pn: pn,
|
||||||
currentMid: GlobalDataCache().userInfo?.mid ?? -1,
|
currentMid: GlobalDataCache.userInfo?.mid ?? -1,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
seasonsList.addAll(res['data'].seriesList);
|
seasonsList.addAll(res['data'].seriesList);
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/models/read/opus.dart';
|
import 'package:pilipala/models/read/opus.dart';
|
||||||
|
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
import 'text_helper.dart';
|
import 'text_helper.dart';
|
||||||
|
|
||||||
@ -26,16 +27,18 @@ class _OpusPageState extends State<OpusPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: _buildAppBar(),
|
appBar: _buildAppBar(),
|
||||||
body: SingleChildScrollView(
|
body: CustomScrollView(
|
||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
child: Column(
|
slivers: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
SliverList(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
delegate: SliverChildListDelegate(
|
||||||
children: [
|
[
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
_buildFutureContent(),
|
_buildFutureContent(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:pilipala/models/read/opus.dart';
|
|||||||
import 'package:pilipala/models/read/read.dart';
|
import 'package:pilipala/models/read/read.dart';
|
||||||
import 'package:pilipala/pages/opus/text_helper.dart';
|
import 'package:pilipala/pages/opus/text_helper.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
|
|
||||||
class ReadPage extends StatefulWidget {
|
class ReadPage extends StatefulWidget {
|
||||||
@ -38,16 +39,18 @@ class _ReadPageState extends State<ReadPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: _buildAppBar(),
|
appBar: _buildAppBar(),
|
||||||
body: SingleChildScrollView(
|
body: CustomScrollView(
|
||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
child: Column(
|
slivers: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
SliverList(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
delegate: SliverChildListDelegate(
|
||||||
children: [
|
[
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
_buildFutureContent(),
|
_buildFutureContent(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,10 +43,10 @@ class SSearchController extends GetxController {
|
|||||||
hintText = hint;
|
hintText = hint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
historyCacheList = GlobalDataCache().historyCacheList;
|
historyCacheList = GlobalDataCache.historyCacheList;
|
||||||
historyList.value = historyCacheList;
|
historyList.value = historyCacheList;
|
||||||
enableHotKey = setting.get(SettingBoxKey.enableHotKey, defaultValue: true);
|
enableHotKey = setting.get(SettingBoxKey.enableHotKey, defaultValue: true);
|
||||||
enableSearchSuggest = GlobalDataCache().enableSearchSuggest;
|
enableSearchSuggest = GlobalDataCache.enableSearchSuggest;
|
||||||
}
|
}
|
||||||
|
|
||||||
void onChange(value) {
|
void onChange(value) {
|
||||||
@ -128,7 +128,7 @@ class SSearchController extends GetxController {
|
|||||||
historyCacheList = [];
|
historyCacheList = [];
|
||||||
historyList.refresh();
|
historyList.refresh();
|
||||||
localCache.put('cacheList', []);
|
localCache.put('cacheList', []);
|
||||||
GlobalDataCache().historyCacheList = [];
|
GlobalDataCache.historyCacheList = [];
|
||||||
SmartDialog.showToast('搜索历史已清空');
|
SmartDialog.showToast('搜索历史已清空');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ class SSearchController extends GetxController {
|
|||||||
historyList.value = historyCacheList;
|
historyList.value = historyCacheList;
|
||||||
historyList.refresh();
|
historyList.refresh();
|
||||||
localCache.put('cacheList', historyCacheList);
|
localCache.put('cacheList', historyCacheList);
|
||||||
GlobalDataCache().historyCacheList = historyCacheList;
|
GlobalDataCache.historyCacheList = historyCacheList;
|
||||||
searchFocusNode.unfocus();
|
searchFocusNode.unfocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:pilipala/models/common/comment_range_type.dart';
|
||||||
import 'package:pilipala/models/common/dynamics_type.dart';
|
import 'package:pilipala/models/common/dynamics_type.dart';
|
||||||
import 'package:pilipala/models/common/reply_sort_type.dart';
|
import 'package:pilipala/models/common/reply_sort_type.dart';
|
||||||
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
||||||
@ -27,6 +28,8 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
late String defaultSystemProxyHost;
|
late String defaultSystemProxyHost;
|
||||||
late String defaultSystemProxyPort;
|
late String defaultSystemProxyPort;
|
||||||
bool userLogin = false;
|
bool userLogin = false;
|
||||||
|
// 记录每个选项是否被选中的状态
|
||||||
|
late List<String> enableComment;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -47,6 +50,8 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
localCache.get(LocalCacheKey.systemProxyHost, defaultValue: '');
|
localCache.get(LocalCacheKey.systemProxyHost, defaultValue: '');
|
||||||
defaultSystemProxyPort =
|
defaultSystemProxyPort =
|
||||||
localCache.get(LocalCacheKey.systemProxyPort, defaultValue: '');
|
localCache.get(LocalCacheKey.systemProxyPort, defaultValue: '');
|
||||||
|
enableComment = setting
|
||||||
|
.get(SettingBoxKey.enableComment, defaultValue: ['video', 'bangumi']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置代理
|
// 设置代理
|
||||||
@ -146,7 +151,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
setKey: SettingBoxKey.enableSearchSuggest,
|
setKey: SettingBoxKey.enableSearchSuggest,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
callFn: (val) {
|
callFn: (val) {
|
||||||
GlobalDataCache().enableSearchSuggest = val;
|
GlobalDataCache.enableSearchSuggest = val;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
@ -181,7 +186,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
setKey: SettingBoxKey.enableAutoExpand,
|
setKey: SettingBoxKey.enableAutoExpand,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
callFn: (val) {
|
callFn: (val) {
|
||||||
GlobalDataCache().enableAutoExpand = val;
|
GlobalDataCache.enableAutoExpand = val;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
@ -190,9 +195,103 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
setKey: SettingBoxKey.enableRelatedVideo,
|
setKey: SettingBoxKey.enableRelatedVideo,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: '视频投屏开关',
|
||||||
|
subTitle: '打开后将在播放器右上角显示投屏入口',
|
||||||
|
setKey: SettingBoxKey.enableDlna,
|
||||||
|
defaultVal: false,
|
||||||
|
callFn: (bool val) {
|
||||||
|
GlobalDataCache.enableDlna = val;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: 'Sponsor Block',
|
||||||
|
subTitle: '自动跳过视频中赞助片段',
|
||||||
|
setKey: SettingBoxKey.enableSponsorBlock,
|
||||||
|
defaultVal: false,
|
||||||
|
callFn: (bool val) {
|
||||||
|
GlobalDataCache.enableSponsorBlock = val;
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
title: Text('评论展示', style: titleStyle),
|
title: Text('评论展示', style: titleStyle),
|
||||||
|
onTap: () async {
|
||||||
|
List<String> tempEnableComment = List.from(enableComment);
|
||||||
|
int? result = await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
// 带多选框的list
|
||||||
|
return StatefulBuilder(
|
||||||
|
builder: (BuildContext context, StateSetter setState) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('评论展示'),
|
||||||
|
contentPadding: const EdgeInsets.fromLTRB(0, 24, 0, 24),
|
||||||
|
content: SizedBox(
|
||||||
|
width: double.maxFinite,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: CommentRangeType.values.length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return CheckboxListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 24, vertical: 0),
|
||||||
|
title: Text(
|
||||||
|
'${CommentRangeType.values[index].label}评论'),
|
||||||
|
value: tempEnableComment.contains(
|
||||||
|
CommentRangeType.values[index].value),
|
||||||
|
onChanged: (bool? value) {
|
||||||
|
setState(() {
|
||||||
|
if (value == true) {
|
||||||
|
tempEnableComment.add(
|
||||||
|
CommentRangeType.values[index].value);
|
||||||
|
} else {
|
||||||
|
tempEnableComment.remove(
|
||||||
|
CommentRangeType.values[index].value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: Navigator.of(context).pop,
|
||||||
|
child: Text(
|
||||||
|
'取消',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
enableComment = tempEnableComment;
|
||||||
|
setting.put(
|
||||||
|
SettingBoxKey.enableComment, enableComment);
|
||||||
|
GlobalDataCache.enableComment = enableComment;
|
||||||
|
SmartDialog.showToast('操作成功');
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: const Text('确认'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
defaultReplySort = result;
|
||||||
|
setting.put(SettingBoxKey.replySortType, result);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
title: Text('评论排序', style: titleStyle),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'当前优先展示「${ReplySortType.values[defaultReplySort].titles}」',
|
'当前优先展示「${ReplySortType.values[defaultReplySort].titles}」',
|
||||||
style: subTitleStyle,
|
style: subTitleStyle,
|
||||||
@ -202,7 +301,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(
|
return SelectDialog<int>(
|
||||||
title: '评论展示',
|
title: '评论排序',
|
||||||
value: defaultReplySort,
|
value: defaultReplySort,
|
||||||
values: ReplySortType.values.map((e) {
|
values: ReplySortType.values.map((e) {
|
||||||
return {'title': e.titles, 'value': e.index};
|
return {'title': e.titles, 'value': e.index};
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class _ActionMenuSetPageState extends State<ActionMenuSetPage> {
|
|||||||
.map<String>((i) => (i['value'] as ActionType).value)
|
.map<String>((i) => (i['value'] as ActionType).value)
|
||||||
.toList();
|
.toList();
|
||||||
setting.put(SettingBoxKey.actionTypeSort, sortedTabbar);
|
setting.put(SettingBoxKey.actionTypeSort, sortedTabbar);
|
||||||
GlobalDataCache().actionTypeSort = sortedTabbar;
|
GlobalDataCache.actionTypeSort = sortedTabbar;
|
||||||
SmartDialog.showToast('操作成功');
|
SmartDialog.showToast('操作成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,11 +58,11 @@ class _PlayGesturePageState extends State<PlayGesturePage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
GlobalDataCache().fullScreenGestureMode = FullScreenGestureMode
|
GlobalDataCache.fullScreenGestureMode = FullScreenGestureMode
|
||||||
.values
|
.values
|
||||||
.firstWhere((element) => element.values == result);
|
.firstWhere((element) => element.values == result);
|
||||||
fullScreenGestureMode =
|
fullScreenGestureMode =
|
||||||
GlobalDataCache().fullScreenGestureMode.index;
|
GlobalDataCache.fullScreenGestureMode.index;
|
||||||
setting.put(
|
setting.put(
|
||||||
SettingBoxKey.fullScreenGestureMode, fullScreenGestureMode);
|
SettingBoxKey.fullScreenGestureMode, fullScreenGestureMode);
|
||||||
SmartDialog.showToast('设置成功');
|
SmartDialog.showToast('设置成功');
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
late int defaultFullScreenMode;
|
late int defaultFullScreenMode;
|
||||||
late int defaultBtmProgressBehavior;
|
late int defaultBtmProgressBehavior;
|
||||||
late String defaultAoOutput;
|
late String defaultAoOutput;
|
||||||
|
late String hardwareDecodeFormat;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -49,6 +50,8 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
defaultValue: BtmProgresBehavior.values.first.code);
|
defaultValue: BtmProgresBehavior.values.first.code);
|
||||||
defaultAoOutput =
|
defaultAoOutput =
|
||||||
setting.get(SettingBoxKey.defaultAoOutput, defaultValue: '0');
|
setting.get(SettingBoxKey.defaultAoOutput, defaultValue: '0');
|
||||||
|
hardwareDecodeFormat = setting.get(SettingBoxKey.hardwareDecodeFormat,
|
||||||
|
defaultValue: Platform.isAndroid ? 'auto-safe' : 'auto');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -92,7 +95,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
title: 'CDN优化',
|
title: 'CDN优化',
|
||||||
subTitle: '使用优质CDN线路',
|
subTitle: '使用优质CDN线路',
|
||||||
setKey: SettingBoxKey.enableCDN,
|
setKey: SettingBoxKey.enableCDN,
|
||||||
defaultVal: true,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '自动播放',
|
title: '自动播放',
|
||||||
@ -155,7 +158,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
setKey: SettingBoxKey.enablePlayerControlAnimation,
|
setKey: SettingBoxKey.enablePlayerControlAnimation,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
callFn: (bool val) {
|
callFn: (bool val) {
|
||||||
GlobalDataCache().enablePlayerControlAnimation = val;
|
GlobalDataCache.enablePlayerControlAnimation = val;
|
||||||
}),
|
}),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
title: '港澳台模式',
|
title: '港澳台模式',
|
||||||
@ -294,6 +297,34 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
title: Text('硬解方式', style: titleStyle),
|
||||||
|
subtitle: Text(
|
||||||
|
'当前硬解方式(--hwdec):$hardwareDecodeFormat',
|
||||||
|
style: subTitleStyle,
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
String? result = await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return SelectDialog<String>(
|
||||||
|
title: '硬解方式',
|
||||||
|
value: hardwareDecodeFormat,
|
||||||
|
values: ['no', 'auto-safe', 'auto', 'yes', 'auto-copy']
|
||||||
|
.map((e) {
|
||||||
|
return {'title': e, 'value': e};
|
||||||
|
}).toList());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
setting.put(SettingBoxKey.hardwareDecodeFormat, result);
|
||||||
|
hardwareDecodeFormat = result;
|
||||||
|
GlobalDataCache.hardwareDecodeFormat = result;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
title: Text('默认全屏方式', style: titleStyle),
|
title: Text('默认全屏方式', style: titleStyle),
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
SettingBoxKey.defaultPicQa, picQuality);
|
SettingBoxKey.defaultPicQa, picQuality);
|
||||||
Get.back();
|
Get.back();
|
||||||
settingController.picQuality.value = picQuality;
|
settingController.picQuality.value = picQuality;
|
||||||
GlobalDataCache().imgQuality = picQuality;
|
GlobalDataCache.imgQuality = picQuality;
|
||||||
SmartDialog.showToast('设置成功');
|
SmartDialog.showToast('设置成功');
|
||||||
},
|
},
|
||||||
child: const Text('确定'),
|
child: const Text('确定'),
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import 'package:pilipala/models/video/play/url.dart';
|
|||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply_reply/index.dart';
|
import 'package:pilipala/pages/video/detail/reply_reply/index.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
import 'package:pilipala/utils/video_utils.dart';
|
import 'package:pilipala/utils/video_utils.dart';
|
||||||
@ -115,6 +116,7 @@ class VideoDetailController extends GetxController
|
|||||||
BottomControlType.time,
|
BottomControlType.time,
|
||||||
BottomControlType.space,
|
BottomControlType.space,
|
||||||
BottomControlType.fit,
|
BottomControlType.fit,
|
||||||
|
BottomControlType.speed,
|
||||||
BottomControlType.fullscreen,
|
BottomControlType.fullscreen,
|
||||||
].obs;
|
].obs;
|
||||||
RxDouble sheetHeight = 0.0.obs;
|
RxDouble sheetHeight = 0.0.obs;
|
||||||
@ -140,8 +142,16 @@ class VideoDetailController extends GetxController
|
|||||||
} else if (argMap.containsKey('pic')) {
|
} else if (argMap.containsKey('pic')) {
|
||||||
updateCover(argMap['pic']);
|
updateCover(argMap['pic']);
|
||||||
}
|
}
|
||||||
|
tabs.value = <String>[
|
||||||
tabCtr = TabController(length: 2, vsync: this);
|
'简介',
|
||||||
|
if (videoType == SearchType.video &&
|
||||||
|
GlobalDataCache.enableComment.contains('video'))
|
||||||
|
'评论',
|
||||||
|
if (videoType == SearchType.media_bangumi &&
|
||||||
|
GlobalDataCache.enableComment.contains('bangumi'))
|
||||||
|
'评论'
|
||||||
|
];
|
||||||
|
tabCtr = TabController(length: tabs.length, vsync: this);
|
||||||
autoPlay.value =
|
autoPlay.value =
|
||||||
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
||||||
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: false);
|
enableHA.value = setting.get(SettingBoxKey.enableHA, defaultValue: false);
|
||||||
@ -159,7 +169,7 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CDN优化
|
// CDN优化
|
||||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: false);
|
||||||
// 预设的画质
|
// 预设的画质
|
||||||
cacheVideoQa = setting.get(SettingBoxKey.defaultVideoQa);
|
cacheVideoQa = setting.get(SettingBoxKey.defaultVideoQa);
|
||||||
// 预设的解码格式
|
// 预设的解码格式
|
||||||
@ -198,7 +208,7 @@ class VideoDetailController extends GetxController
|
|||||||
});
|
});
|
||||||
|
|
||||||
/// 仅投稿视频skip
|
/// 仅投稿视频skip
|
||||||
if (videoType == SearchType.video) {
|
if (videoType == SearchType.video && GlobalDataCache.enableSponsorBlock) {
|
||||||
querySkipSegments();
|
querySkipSegments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -477,13 +487,22 @@ class VideoDetailController extends GetxController
|
|||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
if (result['data'].subtitles.isNotEmpty) {
|
if (result['data'].subtitles.isNotEmpty) {
|
||||||
subtitles = result['data'].subtitles;
|
subtitles = result['data'].subtitles;
|
||||||
getDanmaku(subtitles);
|
getSubtitleContent(subtitles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
headerControl = HeaderControl(
|
||||||
|
controller: plPlayerController,
|
||||||
|
videoDetailCtr: this,
|
||||||
|
floating: floating,
|
||||||
|
bvid: bvid,
|
||||||
|
videoType: videoType,
|
||||||
|
showSubtitleBtn: result['status'] && result['data'].subtitles.isNotEmpty,
|
||||||
|
);
|
||||||
|
plPlayerController.setHeaderControl(headerControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取弹幕
|
// 获取字幕
|
||||||
Future getDanmaku(List subtitles) async {
|
Future getSubtitleContent(List subtitles) async {
|
||||||
if (subtitles.isNotEmpty) {
|
if (subtitles.isNotEmpty) {
|
||||||
for (var i in subtitles) {
|
for (var i in subtitles) {
|
||||||
final Map<String, dynamic> res = await VideoHttp.getSubtitleContent(
|
final Map<String, dynamic> res = await VideoHttp.getSubtitleContent(
|
||||||
@ -605,10 +624,8 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void toggeleWatchLaterVisible(bool val) {
|
void toggeleWatchLaterVisible(bool val) {
|
||||||
if (sourceType.value == 'watchLater' ||
|
if (['watchLater', 'fav', 'up_archive'].contains(sourceType.value)) {
|
||||||
sourceType.value == 'fav' ||
|
isWatchLaterVisible.value = val;
|
||||||
sourceType.value == 'up_archive') {
|
|
||||||
isWatchLaterVisible.value = !isWatchLaterVisible.value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import 'package:pilipala/pages/video/detail/controller.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
import 'package:pilipala/pages/video/detail/reply/index.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
@ -87,19 +88,22 @@ class VideoIntroController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取视频简介&分p
|
// 获取视频简介&分p
|
||||||
Future queryVideoIntro({cover}) async {
|
Future queryVideoIntro({String? cover, String? type, int? cid}) async {
|
||||||
var result = await VideoHttp.videoIntro(bvid: bvid);
|
var result = await VideoHttp.videoIntro(bvid: bvid);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
videoDetail.value = result['data']!;
|
videoDetail.value = result['data']!;
|
||||||
ugcSeason = result['data']!.ugcSeason;
|
ugcSeason = result['data']!.ugcSeason;
|
||||||
pages.value = result['data']!.pages!;
|
pages.value = result['data']!.pages!;
|
||||||
lastPlayCid.value = videoDetail.value.cid!;
|
if (type == null) {
|
||||||
if (pages.isNotEmpty) {
|
lastPlayCid.value = cid ?? videoDetail.value.cid!;
|
||||||
lastPlayCid.value = pages.first.cid!;
|
|
||||||
}
|
}
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
videoDetailCtr.tabs.value = ['简介', '评论 ${result['data']?.stat?.reply}'];
|
videoDetailCtr.tabs.value = [
|
||||||
|
'简介',
|
||||||
|
if (GlobalDataCache.enableComment.contains('video'))
|
||||||
|
'评论 ${result['data']?.stat?.reply}'
|
||||||
|
];
|
||||||
videoDetailCtr.cover.value = cover ?? result['data'].pic ?? '';
|
videoDetailCtr.cover.value = cover ?? result['data'].pic ?? '';
|
||||||
// 获取到粉丝数再返回
|
// 获取到粉丝数再返回
|
||||||
await queryUserStat();
|
await queryUserStat();
|
||||||
@ -469,13 +473,16 @@ class VideoIntroController extends GetxController {
|
|||||||
// 重新请求评论
|
// 重新请求评论
|
||||||
try {
|
try {
|
||||||
/// 未渲染回复组件时可能异常
|
/// 未渲染回复组件时可能异常
|
||||||
final VideoReplyController videoReplyCtr =
|
if (GlobalDataCache.enableComment.contains('video')) {
|
||||||
Get.find<VideoReplyController>(tag: heroTag);
|
final VideoReplyController videoReplyCtr =
|
||||||
videoReplyCtr.aid = aid;
|
Get.find<VideoReplyController>(tag: heroTag);
|
||||||
videoReplyCtr.queryReplyList(type: 'init');
|
videoReplyCtr.aid = aid;
|
||||||
|
videoReplyCtr.queryReplyList(type: 'init');
|
||||||
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
this.bvid = bvid;
|
this.bvid = bvid;
|
||||||
await queryVideoIntro(cover: cover);
|
// 点击切换时,优先取当前cid
|
||||||
|
await queryVideoIntro(cover: cover, cid: cid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startTimer() {
|
void startTimer() {
|
||||||
@ -516,7 +523,7 @@ class VideoIntroController extends GetxController {
|
|||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
|
|
||||||
/// 优先稍后再看、收藏夹
|
/// 优先稍后再看、收藏夹
|
||||||
if (videoDetailCtr.isWatchLaterVisible.value) {
|
if (videoDetailCtr.sourceType.value != 'normal') {
|
||||||
episodes.addAll(videoDetailCtr.mediaList);
|
episodes.addAll(videoDetailCtr.mediaList);
|
||||||
} else if (videoDetail.value.ugcSeason != null) {
|
} else if (videoDetail.value.ugcSeason != null) {
|
||||||
final UgcSeason ugcSeason = videoDetail.value.ugcSeason!;
|
final UgcSeason ugcSeason = videoDetail.value.ugcSeason!;
|
||||||
@ -610,6 +617,7 @@ class VideoIntroController extends GetxController {
|
|||||||
// 播放器底栏 选集 回调
|
// 播放器底栏 选集 回调
|
||||||
void showEposideHandler() {
|
void showEposideHandler() {
|
||||||
late List episodes;
|
late List episodes;
|
||||||
|
int currentEpisodeIndex = 0;
|
||||||
VideoEpidoesType dataType = VideoEpidoesType.videoEpisode;
|
VideoEpidoesType dataType = VideoEpidoesType.videoEpisode;
|
||||||
if (videoDetail.value.ugcSeason != null) {
|
if (videoDetail.value.ugcSeason != null) {
|
||||||
dataType = VideoEpidoesType.videoEpisode;
|
dataType = VideoEpidoesType.videoEpisode;
|
||||||
@ -618,6 +626,7 @@ class VideoIntroController extends GetxController {
|
|||||||
final List<EpisodeItem> episodesList = sections[i].episodes!;
|
final List<EpisodeItem> episodesList = sections[i].episodes!;
|
||||||
for (int j = 0; j < episodesList.length; j++) {
|
for (int j = 0; j < episodesList.length; j++) {
|
||||||
if (episodesList[j].cid == lastPlayCid.value) {
|
if (episodesList[j].cid == lastPlayCid.value) {
|
||||||
|
currentEpisodeIndex = i;
|
||||||
episodes = episodesList;
|
episodes = episodesList;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -637,6 +646,7 @@ class VideoIntroController extends GetxController {
|
|||||||
sheetHeight: Get.size.height,
|
sheetHeight: Get.size.height,
|
||||||
isFullScreen: true,
|
isFullScreen: true,
|
||||||
ugcSeason: ugcSeason,
|
ugcSeason: ugcSeason,
|
||||||
|
currentEpisodeIndex: currentEpisodeIndex,
|
||||||
changeFucCall: (item, index) {
|
changeFucCall: (item, index) {
|
||||||
if (dataType == VideoEpidoesType.videoEpisode) {
|
if (dataType == VideoEpidoesType.videoEpisode) {
|
||||||
changeSeasonOrbangu(
|
changeSeasonOrbangu(
|
||||||
|
|||||||
@ -6,8 +6,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:lottie/lottie.dart';
|
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
|
import 'package:pilipala/common/skeleton/video_intro.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
@ -57,7 +57,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
heroTag = Get.arguments['heroTag'];
|
heroTag = Get.arguments['heroTag'];
|
||||||
videoIntroController =
|
videoIntroController =
|
||||||
Get.put(VideoIntroController(bvid: widget.bvid), tag: heroTag);
|
Get.put(VideoIntroController(bvid: widget.bvid), tag: heroTag);
|
||||||
_futureBuilderFuture = videoIntroController.queryVideoIntro();
|
_futureBuilderFuture = videoIntroController.queryVideoIntro(type: 'init');
|
||||||
videoIntroController.videoDetail.listen((value) {
|
videoIntroController.videoDetail.listen((value) {
|
||||||
videoDetail = value;
|
videoDetail = value;
|
||||||
});
|
});
|
||||||
@ -76,10 +76,8 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
future: _futureBuilderFuture,
|
future: _futureBuilderFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if (snapshot.data == null) {
|
Map? data = snapshot.data;
|
||||||
return const SliverToBoxAdapter(child: SizedBox());
|
if (data != null && data['status']) {
|
||||||
}
|
|
||||||
if (snapshot.data['status']) {
|
|
||||||
// 请求成功
|
// 请求成功
|
||||||
return Obx(
|
return Obx(
|
||||||
() => VideoInfo(
|
() => VideoInfo(
|
||||||
@ -91,25 +89,16 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
} else {
|
} else {
|
||||||
// 请求错误
|
// 请求错误
|
||||||
return HttpError(
|
return HttpError(
|
||||||
errMsg: snapshot.data['msg'],
|
errMsg: data?['msg'] ?? '请求异常',
|
||||||
btnText: snapshot.data['code'] == -404 ||
|
btnText: (data?['code'] == -404 || data?['code'] == 62002)
|
||||||
snapshot.data['code'] == 62002
|
|
||||||
? '返回上一页'
|
? '返回上一页'
|
||||||
: null,
|
: null,
|
||||||
fn: () => Get.back(),
|
fn: () => Get.back(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return SliverToBoxAdapter(
|
return const SliverToBoxAdapter(
|
||||||
child: SizedBox(
|
child: VideoIntroSkeleton(),
|
||||||
height: 100,
|
|
||||||
child: Center(
|
|
||||||
child: Lottie.asset(
|
|
||||||
'assets/loading.json',
|
|
||||||
width: 200,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -169,8 +158,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
owner = widget.videoDetail!.owner;
|
owner = widget.videoDetail!.owner;
|
||||||
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
|
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
|
||||||
_expandableCtr = ExpandableController(
|
_expandableCtr =
|
||||||
initialExpanded: GlobalDataCache().enableAutoExpand);
|
ExpandableController(initialExpanded: GlobalDataCache.enableAutoExpand);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
@ -556,7 +545,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget actionGrid(BuildContext context, videoIntroController) {
|
Widget actionGrid(BuildContext context, videoIntroController) {
|
||||||
final actionTypeSort = GlobalDataCache().actionTypeSort;
|
final actionTypeSort = GlobalDataCache.actionTypeSort;
|
||||||
|
|
||||||
Map<String, Widget> menuListWidgets = {
|
Map<String, Widget> menuListWidgets = {
|
||||||
'like': Obx(
|
'like': Obx(
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class SeasonPanel extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SeasonPanelState extends State<SeasonPanel> {
|
class _SeasonPanelState extends State<SeasonPanel> {
|
||||||
late List<EpisodeItem> episodes;
|
List<EpisodeItem>? episodes;
|
||||||
late int cid;
|
late int cid;
|
||||||
late RxInt currentIndex = (-1).obs;
|
late RxInt currentIndex = (-1).obs;
|
||||||
final String heroTag = Get.arguments['heroTag'];
|
final String heroTag = Get.arguments['heroTag'];
|
||||||
@ -42,23 +42,14 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
_videoDetailController = Get.find<VideoDetailController>(tag: heroTag);
|
_videoDetailController = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
|
|
||||||
/// 根据 cid 找到对应集,找到对应 episodes
|
/// 根据 cid 找到对应集,找到对应 episodes
|
||||||
final List<SectionItem> sections = widget.ugcSeason.sections!;
|
getCurrentEpisodeIndex();
|
||||||
for (int i = 0; i < sections.length; i++) {
|
|
||||||
final List<EpisodeItem> episodesList = sections[i].episodes!;
|
|
||||||
for (int j = 0; j < episodesList.length; j++) {
|
|
||||||
if (episodesList[j].cid == cid) {
|
|
||||||
currentEpisodeIndex = i;
|
|
||||||
episodes = episodesList;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 取对应 season_id 的 episodes
|
/// 取对应 season_id 的 episodes
|
||||||
getCurrentIndex();
|
getCurrentIndex();
|
||||||
_videoDetailController.cid.listen((int p0) {
|
_videoDetailController.cid.listen((int p0) {
|
||||||
cid = p0;
|
cid = p0;
|
||||||
getCurrentIndex();
|
getCurrentIndex();
|
||||||
|
getCurrentEpisodeIndex();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +66,10 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
|
|
||||||
// 获取currentIndex
|
// 获取currentIndex
|
||||||
void getCurrentIndex() {
|
void getCurrentIndex() {
|
||||||
currentIndex.value = episodes.indexWhere((EpisodeItem e) => e.cid == cid);
|
if (episodes != null) {
|
||||||
|
currentIndex.value =
|
||||||
|
episodes!.indexWhere((EpisodeItem e) => e.cid == cid);
|
||||||
|
}
|
||||||
final List<SectionItem> sections = widget.ugcSeason.sections!;
|
final List<SectionItem> sections = widget.ugcSeason.sections!;
|
||||||
if (sections.length == 1 && sections.first.type == 1) {
|
if (sections.length == 1 && sections.first.type == 1) {
|
||||||
final List<EpisodeItem> episodesList = sections.first.episodes!;
|
final List<EpisodeItem> episodesList = sections.first.episodes!;
|
||||||
@ -83,6 +77,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
for (int j = 0; j < episodesList[i].pages!.length; j++) {
|
for (int j = 0; j < episodesList[i].pages!.length; j++) {
|
||||||
if (episodesList[i].pages![j].cid == cid) {
|
if (episodesList[i].pages![j].cid == cid) {
|
||||||
currentIndex.value = i;
|
currentIndex.value = i;
|
||||||
|
episodes = episodesList;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,6 +85,21 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取currentEpisodeIndex
|
||||||
|
void getCurrentEpisodeIndex() {
|
||||||
|
final List<SectionItem> sections = widget.ugcSeason.sections!;
|
||||||
|
for (int i = 0; i < sections.length; i++) {
|
||||||
|
final List<EpisodeItem> episodesList = sections[i].episodes!;
|
||||||
|
for (int j = 0; j < episodesList.length; j++) {
|
||||||
|
if (episodesList[j].cid == cid) {
|
||||||
|
currentEpisodeIndex = i;
|
||||||
|
episodes = episodesList;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget buildEpisodeListItem(
|
Widget buildEpisodeListItem(
|
||||||
EpisodeItem episode,
|
EpisodeItem episode,
|
||||||
int index,
|
int index,
|
||||||
@ -137,7 +147,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
widget.videoIntroCtr.bottomSheetController =
|
widget.videoIntroCtr.bottomSheetController =
|
||||||
_bottomSheetController = EpisodeBottomSheet(
|
_bottomSheetController = EpisodeBottomSheet(
|
||||||
currentCid: cid,
|
currentCid: cid,
|
||||||
episodes: episodes,
|
episodes: episodes!,
|
||||||
changeFucCall: changeFucCall,
|
changeFucCall: changeFucCall,
|
||||||
sheetHeight: widget.sheetHeight,
|
sheetHeight: widget.sheetHeight,
|
||||||
dataType: VideoEpidoesType.videoEpisode,
|
dataType: VideoEpidoesType.videoEpisode,
|
||||||
@ -165,7 +175,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Obx(() => Text(
|
Obx(() => Text(
|
||||||
'${currentIndex.value + 1}/${episodes.length}',
|
'${currentIndex.value + 1}/${episodes!.length}',
|
||||||
style: Theme.of(context).textTheme.labelMedium,
|
style: Theme.of(context).textTheme.labelMedium,
|
||||||
)),
|
)),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
|
|||||||
@ -70,6 +70,13 @@ class VideoReplyController extends GetxController {
|
|||||||
isEnd = res['data'].cursor.isEnd ?? false;
|
isEnd = res['data'].cursor.isEnd ?? false;
|
||||||
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
nextOffset = res['data'].cursor.paginationReply.nextOffset ?? "";
|
||||||
if (replies.isNotEmpty) {
|
if (replies.isNotEmpty) {
|
||||||
|
/// 临时修复
|
||||||
|
final bool flag = replyList
|
||||||
|
.any((ReplyItemModel reply) => reply.rpid == replies.first.rpid);
|
||||||
|
if (replies.length == 1 && flag) {
|
||||||
|
replies.clear();
|
||||||
|
isEnd = true;
|
||||||
|
}
|
||||||
noMore.value = isEnd ? '没有更多了' : '加载中...';
|
noMore.value = isEnd ? '没有更多了' : '加载中...';
|
||||||
} else {
|
} else {
|
||||||
noMore.value =
|
noMore.value =
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/common/widgets/badge.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/network_img_layer.dart';
|
||||||
import 'package:pilipala/http/reply.dart';
|
import 'package:pilipala/http/reply.dart';
|
||||||
import 'package:pilipala/models/common/reply_type.dart';
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
@ -52,7 +53,7 @@ class ReplyItem extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
|
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
|
||||||
(GlobalDataCache().userInfo?.mid ?? -1);
|
(GlobalDataCache.userInfo?.mid ?? -1);
|
||||||
return Material(
|
return Material(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
// 点击整个评论区 评论详情/回复
|
// 点击整个评论区 评论详情/回复
|
||||||
@ -415,7 +416,7 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
|
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
|
||||||
(GlobalDataCache().userInfo?.mid ?? -1);
|
(GlobalDataCache.userInfo?.mid ?? -1);
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
@ -1117,27 +1118,12 @@ class MorePanel extends StatelessWidget {
|
|||||||
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
ColorScheme colorScheme = Theme.of(context).colorScheme;
|
||||||
TextTheme textTheme = Theme.of(context).textTheme;
|
TextTheme textTheme = Theme.of(context).textTheme;
|
||||||
Color errorColor = colorScheme.error;
|
Color errorColor = colorScheme.error;
|
||||||
return Container(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
onTap: () => Get.back(),
|
|
||||||
child: Container(
|
|
||||||
height: 35,
|
|
||||||
padding: const EdgeInsets.only(bottom: 2),
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 32,
|
|
||||||
height: 3,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: colorScheme.outline,
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async => await menuActionHandler('copyAll'),
|
onTap: () async => await menuActionHandler('copyAll'),
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
|
|||||||
@ -89,9 +89,12 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
return AppBar(
|
return AppBar(
|
||||||
toolbarHeight: 45,
|
toolbarHeight: 45,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(
|
title: Padding(
|
||||||
'评论详情',
|
padding: const EdgeInsets.only(left: 14),
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
child: Text(
|
||||||
|
'评论详情',
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -102,7 +105,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(width: 14),
|
const SizedBox(width: 12),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import 'package:pilipala/pages/video/detail/related/index.dart';
|
|||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
import 'package:pilipala/services/service_locator.dart';
|
import 'package:pilipala/services/service_locator.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:status_bar_control/status_bar_control.dart';
|
import 'package:status_bar_control/status_bar_control.dart';
|
||||||
|
|
||||||
@ -205,12 +206,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
vdCtr.bottomList.insert(3, BottomControlType.episode);
|
vdCtr.bottomList.insert(3, BottomControlType.episode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
vdCtr.toggeleWatchLaterVisible(false);
|
||||||
} else {
|
} else {
|
||||||
if (vdCtr.bottomList.contains(BottomControlType.episode)) {
|
if (vdCtr.bottomList.contains(BottomControlType.episode)) {
|
||||||
vdCtr.bottomList.removeAt(3);
|
vdCtr.bottomList.removeAt(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vdCtr.toggeleWatchLaterVisible(!isFullScreen);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,6 +554,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
playerController: plPlayerController!,
|
playerController: plPlayerController!,
|
||||||
),
|
),
|
||||||
bottomList: vdCtr.bottomList,
|
bottomList: vdCtr.bottomList,
|
||||||
|
fullScreenCb: (bool status) {
|
||||||
|
if (vdCtr.videoDirection.value == 'vertical') {
|
||||||
|
videoHeight.value = status ? Get.size.height : verticalHeight;
|
||||||
|
}
|
||||||
|
},
|
||||||
showEposideCb: () => vdCtr.videoType == SearchType.video
|
showEposideCb: () => vdCtr.videoType == SearchType.video
|
||||||
? videoIntroController.showEposideHandler()
|
? videoIntroController.showEposideHandler()
|
||||||
: bangumiIntroController.showEposideHandler(),
|
: bangumiIntroController.showEposideHandler(),
|
||||||
@ -679,11 +685,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
forceElevated: innerBoxIsScrolled,
|
forceElevated: innerBoxIsScrolled,
|
||||||
expandedHeight: expandedHeight,
|
expandedHeight: expandedHeight,
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: SizedBox.expand(
|
||||||
background: PopScope(
|
child: PopScope(
|
||||||
canPop:
|
canPop:
|
||||||
plPlayerController?.isFullScreen.value != true,
|
plPlayerController?.isFullScreen.value != true,
|
||||||
onPopInvoked: (bool didPop) {
|
onPopInvoked: (bool didPop) {
|
||||||
|
if (plPlayerController?.controlsLock.value ==
|
||||||
|
true) {
|
||||||
|
plPlayerController?.onLockControl(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (plPlayerController?.isFullScreen.value ==
|
if (plPlayerController?.isFullScreen.value ==
|
||||||
true) {
|
true) {
|
||||||
plPlayerController!
|
plPlayerController!
|
||||||
@ -779,13 +790,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Obx(
|
if ((vdCtr.videoType == SearchType.media_bangumi &&
|
||||||
() => VideoReplyPanel(
|
GlobalDataCache.enableComment
|
||||||
bvid: vdCtr.bvid,
|
.contains('bangumi')) ||
|
||||||
oid: vdCtr.oid.value,
|
(vdCtr.videoType == SearchType.video &&
|
||||||
onControllerCreated: vdCtr.onControllerCreated,
|
GlobalDataCache.enableComment
|
||||||
),
|
.contains('video'))) ...[
|
||||||
)
|
Obx(
|
||||||
|
() => VideoReplyPanel(
|
||||||
|
bvid: vdCtr.bvid,
|
||||||
|
oid: vdCtr.oid.value,
|
||||||
|
onControllerCreated: vdCtr.onControllerCreated,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -812,9 +830,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
/// 稍后再看列表
|
/// 稍后再看列表
|
||||||
Obx(
|
Obx(
|
||||||
() => Visibility(
|
() => Visibility(
|
||||||
visible: vdCtr.sourceType.value == 'watchLater' ||
|
visible: ['watchLater', 'fav', 'up_archive']
|
||||||
vdCtr.sourceType.value == 'fav' ||
|
.contains(vdCtr.sourceType.value),
|
||||||
vdCtr.sourceType.value == 'up_archive',
|
|
||||||
child: AnimatedPositioned(
|
child: AnimatedPositioned(
|
||||||
duration: const Duration(milliseconds: 400),
|
duration: const Duration(milliseconds: 400),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
@ -909,6 +926,21 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
icon: const Icon(FontAwesomeIcons.arrowLeft, size: 15),
|
icon: const Icon(FontAwesomeIcons.arrowLeft, size: 15),
|
||||||
fuc: () => Get.back(),
|
fuc: () => Get.back(),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
ComBtn(
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesomeIcons.house,
|
||||||
|
size: 15,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
fuc: () async {
|
||||||
|
await vdCtr.plPlayerController.dispose(type: 'all');
|
||||||
|
if (mounted) {
|
||||||
|
Navigator.popUntil(
|
||||||
|
context, (Route<dynamic> route) => route.isFirst);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
ComBtn(
|
ComBtn(
|
||||||
icon: const Icon(Icons.history_outlined, size: 22),
|
icon: const Icon(Icons.history_outlined, size: 22),
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||||
import 'package:pilipala/models/video/ai.dart';
|
import 'package:pilipala/models/video/ai.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/utils/global_data_cache.dart';
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
@ -17,21 +18,24 @@ class AiDetail extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
height: GlobalDataCache().sheetHeight,
|
height: GlobalDataCache.sheetHeight,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(context),
|
const DragHandle(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Padding(
|
||||||
children: [
|
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||||
if (modelResult!.summary != '') ...[
|
child: Column(
|
||||||
_buildSummaryText(modelResult!.summary!),
|
children: [
|
||||||
const SizedBox(height: 20),
|
if (modelResult!.summary != '') ...[
|
||||||
|
_buildSummaryText(modelResult!.summary!),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
],
|
||||||
|
_buildOutlineList(context),
|
||||||
],
|
],
|
||||||
_buildOutlineList(context),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -40,20 +44,6 @@ class AiDetail extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHeader(BuildContext context) {
|
|
||||||
return Center(
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).hintColor,
|
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
|
||||||
),
|
|
||||||
height: 4,
|
|
||||||
width: 40,
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 16),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildSummaryText(String summary) {
|
Widget _buildSummaryText(String summary) {
|
||||||
return SelectableText(
|
return SelectableText(
|
||||||
summary,
|
summary,
|
||||||
|
|||||||
@ -7,7 +7,9 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:marquee/marquee.dart';
|
||||||
import 'package:ns_danmaku/ns_danmaku.dart';
|
import 'package:ns_danmaku/ns_danmaku.dart';
|
||||||
|
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||||
import 'package:pilipala/http/user.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import 'package:pilipala/models/video/play/quality.dart';
|
import 'package:pilipala/models/video/play/quality.dart';
|
||||||
import 'package:pilipala/models/video/play/url.dart';
|
import 'package:pilipala/models/video/play/url.dart';
|
||||||
@ -16,6 +18,7 @@ import 'package:pilipala/pages/video/detail/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
|
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/services/shutdown_timer_service.dart';
|
import 'package:pilipala/services/shutdown_timer_service.dart';
|
||||||
import '../../../../http/danmaku.dart';
|
import '../../../../http/danmaku.dart';
|
||||||
@ -30,7 +33,7 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
this.floating,
|
this.floating,
|
||||||
this.bvid,
|
this.bvid,
|
||||||
this.videoType,
|
this.videoType,
|
||||||
this.showSubtitleBtn,
|
this.showSubtitleBtn = true,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final PlPlayerController? controller;
|
final PlPlayerController? controller;
|
||||||
@ -38,7 +41,7 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
final Floating? floating;
|
final Floating? floating;
|
||||||
final String? bvid;
|
final String? bvid;
|
||||||
final SearchType? videoType;
|
final SearchType? videoType;
|
||||||
final bool? showSubtitleBtn;
|
final bool showSubtitleBtn;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HeaderControl> createState() => _HeaderControlState();
|
State<HeaderControl> createState() => _HeaderControlState();
|
||||||
@ -55,11 +58,12 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
final Box<dynamic> localCache = GStorage.localCache;
|
final Box<dynamic> localCache = GStorage.localCache;
|
||||||
final Box<dynamic> videoStorage = GStorage.video;
|
final Box<dynamic> videoStorage = GStorage.video;
|
||||||
late List<double> speedsList;
|
late List<double> speedsList;
|
||||||
double buttonSpace = 8;
|
double buttonSpace = 4;
|
||||||
RxBool isFullScreen = false.obs;
|
RxBool isFullScreen = false.obs;
|
||||||
late String heroTag;
|
late String heroTag;
|
||||||
late VideoIntroController videoIntroController;
|
late VideoIntroController videoIntroController;
|
||||||
late VideoDetailData videoDetail;
|
late VideoDetailData videoDetail;
|
||||||
|
DateTime initialTime = DateTime.now();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -101,50 +105,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
margin: const EdgeInsets.all(12),
|
margin: const EdgeInsets.all(12),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
const DragHandle(),
|
||||||
height: 35,
|
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
// ListTile(
|
|
||||||
// onTap: () {},
|
|
||||||
// dense: true,
|
|
||||||
// enabled: false,
|
|
||||||
// leading:
|
|
||||||
// const Icon(Icons.network_cell_outlined, size: 20),
|
|
||||||
// title: Text('省流模式', style: titleStyle),
|
|
||||||
// subtitle: Text('低画质 | 减少视频缓存', style: subTitleStyle),
|
|
||||||
// trailing: Transform.scale(
|
|
||||||
// scale: 0.75,
|
|
||||||
// child: Switch(
|
|
||||||
// thumbIcon: MaterialStateProperty.resolveWith<Icon?>(
|
|
||||||
// (Set<MaterialState> states) {
|
|
||||||
// if (states.isNotEmpty &&
|
|
||||||
// states.first == MaterialState.selected) {
|
|
||||||
// return const Icon(Icons.done);
|
|
||||||
// }
|
|
||||||
// return null; // All other states will use the default thumbIcon.
|
|
||||||
// }),
|
|
||||||
// value: false,
|
|
||||||
// onChanged: (value) => {},
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final res = await UserHttp.toViewLater(
|
final res = await UserHttp.toViewLater(
|
||||||
@ -485,65 +450,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 选择倍速
|
|
||||||
void showSetSpeedSheet() {
|
|
||||||
final double currentSpeed = widget.controller!.playbackSpeed;
|
|
||||||
showDialog(
|
|
||||||
context: Get.context!,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('播放速度'),
|
|
||||||
content: StatefulBuilder(
|
|
||||||
builder: (BuildContext context, StateSetter setState) {
|
|
||||||
return Wrap(
|
|
||||||
spacing: 8,
|
|
||||||
runSpacing: 2,
|
|
||||||
children: [
|
|
||||||
for (final double i in speedsList) ...<Widget>[
|
|
||||||
if (i == currentSpeed) ...<Widget>[
|
|
||||||
FilledButton(
|
|
||||||
onPressed: () async {
|
|
||||||
// setState(() => currentSpeed = i),
|
|
||||||
await widget.controller!.setPlaybackSpeed(i);
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i.toString()),
|
|
||||||
),
|
|
||||||
] else ...[
|
|
||||||
FilledButton.tonal(
|
|
||||||
onPressed: () async {
|
|
||||||
// setState(() => currentSpeed = i),
|
|
||||||
await widget.controller!.setPlaybackSpeed(i);
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i.toString()),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(),
|
|
||||||
child: Text(
|
|
||||||
'取消',
|
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await widget.controller!.setDefaultSpeed();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: const Text('默认速度'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 选择画质
|
/// 选择画质
|
||||||
void showSetVideoQa() {
|
void showSetVideoQa() {
|
||||||
final List<FormatItem> videoFormat = videoInfo.supportFormats!;
|
final List<FormatItem> videoFormat = videoInfo.supportFormats!;
|
||||||
@ -1143,6 +1049,16 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Stream<DateTime> _getTimeStream() {
|
||||||
|
return Stream.periodic(const Duration(seconds: 60), (count) {
|
||||||
|
return DateTime.now();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String _formatTime(DateTime dateTime) {
|
||||||
|
return '${dateTime.hour}:${dateTime.minute < 10 ? '0${dateTime.minute}' : dateTime.minute}';
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final _ = widget.controller!;
|
final _ = widget.controller!;
|
||||||
@ -1158,49 +1074,12 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
primary: false,
|
primary: false,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
titleSpacing: 14,
|
titleSpacing: 14,
|
||||||
title: Row(
|
title: Column(
|
||||||
children: [
|
children: [
|
||||||
ComBtn(
|
if (isFullScreen.value && isLandscape) ...[
|
||||||
icon: const Icon(
|
Row(
|
||||||
FontAwesomeIcons.arrowLeft,
|
|
||||||
size: 15,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
fuc: () => <Set<void>>{
|
|
||||||
if (widget.controller!.isFullScreen.value)
|
|
||||||
<void>{widget.controller!.triggerFullScreen(status: false)}
|
|
||||||
else
|
|
||||||
<void>{
|
|
||||||
if (MediaQuery.of(context).orientation ==
|
|
||||||
Orientation.landscape)
|
|
||||||
{
|
|
||||||
SystemChrome.setPreferredOrientations([
|
|
||||||
DeviceOrientation.portraitUp,
|
|
||||||
])
|
|
||||||
},
|
|
||||||
Get.back()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(width: buttonSpace),
|
|
||||||
if (isFullScreen.value &&
|
|
||||||
isLandscape &&
|
|
||||||
widget.videoType == SearchType.video) ...[
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
ConstrainedBox(
|
const SizedBox(width: 40),
|
||||||
constraints: const BoxConstraints(maxWidth: 200),
|
|
||||||
child: Obx(
|
|
||||||
() => Text(
|
|
||||||
videoIntroController.videoDetail.value.title ?? '',
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (videoIntroController.isShowOnlineTotal)
|
if (videoIntroController.isShowOnlineTotal)
|
||||||
Text(
|
Text(
|
||||||
'${videoIntroController.total.value}人正在看',
|
'${videoIntroController.total.value}人正在看',
|
||||||
@ -1208,158 +1087,226 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: StreamBuilder<DateTime>(
|
||||||
|
stream: _getTimeStream(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
String currentTime = _formatTime(snapshot.data!);
|
||||||
|
return Text(
|
||||||
|
currentTime,
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
|
);
|
||||||
|
} else if (snapshot.connectionState ==
|
||||||
|
ConnectionState.waiting) {
|
||||||
|
// 如果Stream还未发出数据,先显示初始获取的时间
|
||||||
|
String currentTime = _formatTime(initialTime);
|
||||||
|
return Text(
|
||||||
|
currentTime,
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
|
||||||
|
/// TODO 网络&电量
|
||||||
],
|
],
|
||||||
)
|
|
||||||
] else ...[
|
|
||||||
ComBtn(
|
|
||||||
icon: const Icon(
|
|
||||||
FontAwesomeIcons.house,
|
|
||||||
size: 15,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
fuc: () async {
|
|
||||||
// 销毁播放器实例
|
|
||||||
await widget.controller!.dispose(type: 'all');
|
|
||||||
if (mounted) {
|
|
||||||
Navigator.popUntil(
|
|
||||||
context, (Route<dynamic> route) => route.isFirst);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
const Spacer(),
|
Row(
|
||||||
// ComBtn(
|
children: [
|
||||||
// icon: const Icon(
|
ComBtn(
|
||||||
// FontAwesomeIcons.cropSimple,
|
icon: const Icon(
|
||||||
// size: 15,
|
FontAwesomeIcons.arrowLeft,
|
||||||
// color: Colors.white,
|
size: 15,
|
||||||
// ),
|
color: Colors.white,
|
||||||
// fuc: () => _.screenshot(),
|
),
|
||||||
// ),
|
fuc: () => <Set<void>>{
|
||||||
ComBtn(
|
if (widget.controller!.isFullScreen.value)
|
||||||
icon: const Icon(
|
<void>{widget.controller!.triggerFullScreen(status: false)}
|
||||||
Icons.cast,
|
else
|
||||||
size: 19,
|
<void>{
|
||||||
color: Colors.white,
|
if (MediaQuery.of(context).orientation ==
|
||||||
),
|
Orientation.landscape)
|
||||||
fuc: () async {
|
{
|
||||||
showDialog<void>(
|
SystemChrome.setPreferredOrientations([
|
||||||
context: context,
|
DeviceOrientation.portraitUp,
|
||||||
builder: (BuildContext context) {
|
])
|
||||||
return LiveDlnaPage(
|
},
|
||||||
datasource: widget.videoDetailCtr!.videoUrl);
|
Get.back()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (isFullScreen.value) ...[
|
|
||||||
SizedBox(
|
|
||||||
width: 56,
|
|
||||||
height: 34,
|
|
||||||
child: TextButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
|
||||||
),
|
|
||||||
onPressed: () => showShootDanmakuSheet(),
|
|
||||||
child: const Text(
|
|
||||||
'发弹幕',
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: buttonSpace),
|
||||||
SizedBox(
|
if (isFullScreen.value &&
|
||||||
width: 34,
|
isLandscape &&
|
||||||
height: 34,
|
widget.videoType == SearchType.video) ...[
|
||||||
child: Obx(
|
Expanded(
|
||||||
() => IconButton(
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
style: ButtonStyle(
|
return SizedBox(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
width: constraints.maxWidth,
|
||||||
),
|
height: 25,
|
||||||
onPressed: () {
|
child: Obx(
|
||||||
_.isOpenDanmu.value = !_.isOpenDanmu.value;
|
() => Marquee(
|
||||||
},
|
text: videoIntroController.videoDetail.value.title ??
|
||||||
icon: Icon(
|
'',
|
||||||
_.isOpenDanmu.value
|
style: const TextStyle(fontSize: 16),
|
||||||
? Icons.subtitles_outlined
|
scrollAxis: Axis.horizontal,
|
||||||
: Icons.subtitles_off_outlined,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
size: 19,
|
blankSpace: constraints.maxWidth,
|
||||||
|
velocity: 100,
|
||||||
|
pauseAfterRound: const Duration(seconds: 1),
|
||||||
|
startPadding: 0,
|
||||||
|
accelerationDuration: const Duration(seconds: 1),
|
||||||
|
accelerationCurve: Curves.linear,
|
||||||
|
decelerationDuration: const Duration(seconds: 1),
|
||||||
|
decelerationCurve: Curves.easeOut,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
] else ...[
|
||||||
|
ComBtn(
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesomeIcons.house,
|
||||||
|
size: 15,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
|
fuc: () async {
|
||||||
|
// 销毁播放器实例
|
||||||
|
await widget.controller!.dispose(type: 'all');
|
||||||
|
if (context.mounted) {
|
||||||
|
Navigator.popUntil(
|
||||||
|
context, (Route<dynamic> route) => route.isFirst);
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
const Spacer(),
|
||||||
],
|
if (GlobalDataCache.enableDlna) ...[
|
||||||
SizedBox(width: buttonSpace),
|
ComBtn(
|
||||||
if (Platform.isAndroid) ...<Widget>[
|
icon: Image.asset('assets/images/video/dlna.png', width: 19),
|
||||||
SizedBox(
|
fuc: () async {
|
||||||
width: 34,
|
showDialog<void>(
|
||||||
height: 34,
|
context: context,
|
||||||
child: IconButton(
|
builder: (BuildContext context) {
|
||||||
style: ButtonStyle(
|
return LiveDlnaPage(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
datasource: widget.videoDetailCtr!.videoUrl);
|
||||||
),
|
},
|
||||||
onPressed: () async {
|
|
||||||
bool canUsePiP = false;
|
|
||||||
widget.controller!.hiddenControls(false);
|
|
||||||
try {
|
|
||||||
canUsePiP = await widget.floating!.isPipAvailable;
|
|
||||||
} on PlatformException catch (_) {
|
|
||||||
canUsePiP = false;
|
|
||||||
}
|
|
||||||
if (canUsePiP) {
|
|
||||||
final Rational aspectRatio = Rational(
|
|
||||||
widget.videoDetailCtr!.data.dash!.video!.first.width!,
|
|
||||||
widget.videoDetailCtr!.data.dash!.video!.first.height!,
|
|
||||||
);
|
);
|
||||||
await widget.floating!.enable(aspectRatio: aspectRatio);
|
},
|
||||||
} else {}
|
),
|
||||||
},
|
SizedBox(width: buttonSpace),
|
||||||
|
],
|
||||||
|
|
||||||
|
/// 弹幕开关(全屏时)
|
||||||
|
if (isFullScreen.value) ...[
|
||||||
|
SizedBox(
|
||||||
|
width: 56,
|
||||||
|
height: 34,
|
||||||
|
child: TextButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
|
),
|
||||||
|
onPressed: () => showShootDanmakuSheet(),
|
||||||
|
child: const Text(
|
||||||
|
'发弹幕',
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: buttonSpace),
|
||||||
|
SizedBox(
|
||||||
|
width: 34,
|
||||||
|
height: 34,
|
||||||
|
child: Obx(
|
||||||
|
() => IconButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
_.isOpenDanmu.value = !_.isOpenDanmu.value;
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
_.isOpenDanmu.value
|
||||||
|
? Icons.subtitles_outlined
|
||||||
|
: Icons.subtitles_off_outlined,
|
||||||
|
size: 19,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: buttonSpace),
|
||||||
|
],
|
||||||
|
|
||||||
|
/// pip
|
||||||
|
if (Platform.isAndroid) ...<Widget>[
|
||||||
|
SizedBox(
|
||||||
|
width: 34,
|
||||||
|
height: 34,
|
||||||
|
child: IconButton(
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
bool canUsePiP = false;
|
||||||
|
widget.controller!.hiddenControls(false);
|
||||||
|
try {
|
||||||
|
canUsePiP = await widget.floating!.isPipAvailable;
|
||||||
|
} on PlatformException catch (_) {
|
||||||
|
canUsePiP = false;
|
||||||
|
}
|
||||||
|
if (canUsePiP) {
|
||||||
|
final Rational aspectRatio = Rational(
|
||||||
|
widget.videoDetailCtr!.data.dash!.video!.first.width!,
|
||||||
|
widget
|
||||||
|
.videoDetailCtr!.data.dash!.video!.first.height!,
|
||||||
|
);
|
||||||
|
await widget.floating!.enable(aspectRatio: aspectRatio);
|
||||||
|
} else {}
|
||||||
|
},
|
||||||
|
icon: Image.asset(
|
||||||
|
'assets/images/video/pip.png',
|
||||||
|
width: 19,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: buttonSpace),
|
||||||
|
],
|
||||||
|
|
||||||
|
/// 字幕
|
||||||
|
if (widget.showSubtitleBtn) ...[
|
||||||
|
ComBtn(
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.closedCaptioning,
|
||||||
|
size: 16,
|
||||||
|
color: Colors.white.withOpacity(0.9),
|
||||||
|
),
|
||||||
|
fuc: () => showSubtitleDialog(),
|
||||||
|
),
|
||||||
|
SizedBox(width: buttonSpace),
|
||||||
|
],
|
||||||
|
ComBtn(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.picture_in_picture_outlined,
|
Icons.more_vert_outlined,
|
||||||
size: 19,
|
size: 19,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
|
fuc: () => showSettingSheet(),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
SizedBox(width: buttonSpace),
|
|
||||||
],
|
|
||||||
|
|
||||||
/// 字幕
|
|
||||||
if (widget.showSubtitleBtn ?? true)
|
|
||||||
ComBtn(
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.closed_caption_off,
|
|
||||||
size: 22,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
fuc: () => showSubtitleDialog(),
|
|
||||||
),
|
|
||||||
SizedBox(width: buttonSpace),
|
|
||||||
Obx(
|
|
||||||
() => SizedBox(
|
|
||||||
width: 45,
|
|
||||||
height: 34,
|
|
||||||
child: TextButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
|
||||||
),
|
|
||||||
onPressed: () => showSetSpeedSheet(),
|
|
||||||
child: Text(
|
|
||||||
'${_.playbackSpeed}X',
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: buttonSpace),
|
|
||||||
ComBtn(
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.more_vert_outlined,
|
|
||||||
size: 18,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
fuc: () => showSettingSheet(),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -85,9 +85,12 @@ class _MediaListPanelState extends State<MediaListPanel> {
|
|||||||
AppBar(
|
AppBar(
|
||||||
toolbarHeight: 45,
|
toolbarHeight: 45,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
title: Text(
|
title: Padding(
|
||||||
widget.panelTitle ?? '稍后再看',
|
padding: const EdgeInsets.only(left: 12),
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
child: Text(
|
||||||
|
widget.panelTitle ?? '稍后再看',
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@ -101,25 +101,11 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
title: SizedBox(
|
title: SizedBox(
|
||||||
width: double.infinity,
|
width: double.maxFinite,
|
||||||
height: 50,
|
height: 50,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
|
||||||
width: 34,
|
|
||||||
height: 34,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () => Get.back(),
|
|
||||||
icon: Icon(
|
|
||||||
Icons.arrow_back_ios,
|
|
||||||
size: 18,
|
|
||||||
color: Theme.of(context).colorScheme.onPrimaryContainer,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import 'package:dio/dio.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:pilipala/common/widgets/drag_handle.dart';
|
||||||
import 'package:pilipala/utils/download.dart';
|
import 'package:pilipala/utils/download.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:status_bar_control/status_bar_control.dart';
|
import 'package:status_bar_control/status_bar_control.dart';
|
||||||
@ -234,17 +234,17 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return InteractiveViewerBoundary(
|
return Stack(children: [
|
||||||
controller: _transformationController,
|
InteractiveViewerBoundary(
|
||||||
boundaryWidth: MediaQuery.of(context).size.width,
|
controller: _transformationController,
|
||||||
onScaleChanged: _onScaleChanged,
|
boundaryWidth: MediaQuery.of(context).size.width,
|
||||||
onLeftBoundaryHit: _onLeftBoundaryHit,
|
onScaleChanged: _onScaleChanged,
|
||||||
onRightBoundaryHit: _onRightBoundaryHit,
|
onLeftBoundaryHit: _onLeftBoundaryHit,
|
||||||
onNoBoundaryHit: _onNoBoundaryHit,
|
onRightBoundaryHit: _onRightBoundaryHit,
|
||||||
maxScale: widget.maxScale,
|
onNoBoundaryHit: _onNoBoundaryHit,
|
||||||
minScale: widget.minScale,
|
maxScale: widget.maxScale,
|
||||||
child: Stack(children: [
|
minScale: widget.minScale,
|
||||||
CustomDismissible(
|
child: CustomDismissible(
|
||||||
onDismissed: () {
|
onDismissed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
widget.onDismissed?.call(_pageController!.page!.floor());
|
widget.onDismissed?.call(_pageController!.page!.floor());
|
||||||
@ -275,53 +275,50 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
),
|
||||||
bottom: 0,
|
Positioned(
|
||||||
left: 0,
|
bottom: 0,
|
||||||
right: 0,
|
left: 0,
|
||||||
child: Container(
|
right: 0,
|
||||||
padding: EdgeInsets.fromLTRB(
|
child: Container(
|
||||||
12, 8, 20, MediaQuery.of(context).padding.bottom + 8),
|
padding: EdgeInsets.fromLTRB(
|
||||||
decoration: _enablePageView
|
12, 8, 20, MediaQuery.of(context).padding.bottom + 8),
|
||||||
? BoxDecoration(
|
decoration: _enablePageView
|
||||||
gradient: LinearGradient(
|
? BoxDecoration(
|
||||||
begin: Alignment.topCenter,
|
gradient: LinearGradient(
|
||||||
end: Alignment.bottomCenter,
|
begin: Alignment.topCenter,
|
||||||
colors: [
|
end: Alignment.bottomCenter,
|
||||||
Colors.transparent,
|
colors: [Colors.transparent, Colors.black.withOpacity(0.3)],
|
||||||
Colors.black.withOpacity(0.3)
|
),
|
||||||
],
|
)
|
||||||
),
|
: null,
|
||||||
)
|
child: Row(
|
||||||
: null,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
child: Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
IconButton(
|
||||||
children: [
|
icon: const Icon(Icons.close, color: Colors.white),
|
||||||
IconButton(
|
onPressed: () {
|
||||||
icon: const Icon(Icons.close, color: Colors.white),
|
Navigator.of(context).pop();
|
||||||
onPressed: () {
|
widget.onDismissed?.call(_pageController!.page!.floor());
|
||||||
Navigator.of(context).pop();
|
},
|
||||||
widget.onDismissed?.call(_pageController!.page!.floor());
|
),
|
||||||
},
|
widget.sources.length > 1
|
||||||
),
|
? Text(
|
||||||
widget.sources.length > 1
|
"${currentIndex! + 1}/${widget.sources.length}",
|
||||||
? Text(
|
style: const TextStyle(color: Colors.white),
|
||||||
"${currentIndex! + 1}/${widget.sources.length}",
|
)
|
||||||
style: const TextStyle(color: Colors.white),
|
: const SizedBox(),
|
||||||
)
|
PopupMenuButton(
|
||||||
: const SizedBox(),
|
itemBuilder: (context) {
|
||||||
PopupMenuButton(
|
return _buildPopupMenuList();
|
||||||
itemBuilder: (context) {
|
},
|
||||||
return _buildPopupMenuList();
|
child: const Icon(Icons.more_horiz, color: Colors.white),
|
||||||
},
|
),
|
||||||
child: const Icon(Icons.more_horiz, color: Colors.white),
|
],
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
),
|
||||||
);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片分享
|
// 图片分享
|
||||||
@ -426,29 +423,13 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
|||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Container(
|
return Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
const DragHandle(),
|
||||||
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))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
..._buildListTitles(),
|
..._buildListTitles(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:flutter_volume_controller/flutter_volume_controller.dart';
|
import 'package:flutter_volume_controller/flutter_volume_controller.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
@ -80,7 +81,7 @@ class PlPlayerController {
|
|||||||
final Rx<bool> _subTitleOpen = false.obs;
|
final Rx<bool> _subTitleOpen = false.obs;
|
||||||
final Rx<int> _subTitleCode = (-1).obs;
|
final Rx<int> _subTitleCode = (-1).obs;
|
||||||
// 默认投稿视频格式
|
// 默认投稿视频格式
|
||||||
static Rx<String> _videoType = 'archive'.obs;
|
static String _videoType = 'archive';
|
||||||
|
|
||||||
final Rx<String> _direction = 'horizontal'.obs;
|
final Rx<String> _direction = 'horizontal'.obs;
|
||||||
|
|
||||||
@ -113,19 +114,19 @@ class PlPlayerController {
|
|||||||
// final Durations durations;
|
// final Durations durations;
|
||||||
|
|
||||||
List<Map<String, dynamic>> videoFitType = [
|
List<Map<String, dynamic>> videoFitType = [
|
||||||
{'attr': BoxFit.contain, 'desc': '包含'},
|
{'attr': BoxFit.contain, 'desc': '自动'},
|
||||||
{'attr': BoxFit.cover, 'desc': '覆盖'},
|
{'attr': BoxFit.cover, 'desc': '铺满'},
|
||||||
{'attr': BoxFit.fill, 'desc': '填充'},
|
{'attr': BoxFit.fill, 'desc': '填满'},
|
||||||
{'attr': BoxFit.fitHeight, 'desc': '高度适应'},
|
{'attr': BoxFit.fitHeight, 'desc': '等高'},
|
||||||
{'attr': BoxFit.fitWidth, 'desc': '宽度适应'},
|
{'attr': BoxFit.fitWidth, 'desc': '等宽'},
|
||||||
{'attr': BoxFit.scaleDown, 'desc': '缩小适应'},
|
{'attr': BoxFit.scaleDown, 'desc': '缩放'},
|
||||||
|
{'attr': BoxFit.none, 'desc': '原始'},
|
||||||
];
|
];
|
||||||
|
|
||||||
PreferredSizeWidget? headerControl;
|
PreferredSizeWidget? headerControl;
|
||||||
PreferredSizeWidget? bottomControl;
|
PreferredSizeWidget? bottomControl;
|
||||||
Widget? danmuWidget;
|
Widget? danmuWidget;
|
||||||
RxList subtitles = [].obs;
|
RxList subtitles = [].obs;
|
||||||
String videoType = 'archive';
|
|
||||||
|
|
||||||
/// 数据加载监听
|
/// 数据加载监听
|
||||||
Stream<DataStatus> get onDataStatusChanged => dataStatus.status.stream;
|
Stream<DataStatus> get onDataStatusChanged => dataStatus.status.stream;
|
||||||
@ -223,7 +224,7 @@ class PlPlayerController {
|
|||||||
Rx<int> get playerCount => _playerCount;
|
Rx<int> get playerCount => _playerCount;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Rx<String> get videoType => _videoType;
|
String get videoType => _videoType;
|
||||||
|
|
||||||
/// 弹幕开关
|
/// 弹幕开关
|
||||||
Rx<bool> isOpenDanmu = false.obs;
|
Rx<bool> isOpenDanmu = false.obs;
|
||||||
@ -277,20 +278,19 @@ class PlPlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加一个私有构造函数
|
// 添加一个私有构造函数
|
||||||
PlPlayerController._internal(this.videoType) {
|
PlPlayerController._internal() {
|
||||||
final cache = GlobalDataCache();
|
isOpenDanmu.value = GlobalDataCache.isOpenDanmu;
|
||||||
isOpenDanmu.value = cache.isOpenDanmu;
|
blockTypes = GlobalDataCache.blockTypes;
|
||||||
blockTypes = cache.blockTypes;
|
showArea = GlobalDataCache.showArea;
|
||||||
showArea = cache.showArea;
|
opacityVal = GlobalDataCache.opacityVal;
|
||||||
opacityVal = cache.opacityVal;
|
fontSizeVal = GlobalDataCache.fontSizeVal;
|
||||||
fontSizeVal = cache.fontSizeVal;
|
danmakuDurationVal = GlobalDataCache.danmakuDurationVal;
|
||||||
danmakuDurationVal = cache.danmakuDurationVal;
|
strokeWidth = GlobalDataCache.strokeWidth;
|
||||||
strokeWidth = cache.strokeWidth;
|
playRepeat = GlobalDataCache.playRepeat;
|
||||||
playRepeat = cache.playRepeat;
|
_playbackSpeed.value = GlobalDataCache.playbackSpeed;
|
||||||
_playbackSpeed.value = cache.playbackSpeed;
|
enableAutoLongPressSpeed = GlobalDataCache.enableAutoLongPressSpeed;
|
||||||
enableAutoLongPressSpeed = cache.enableAutoLongPressSpeed;
|
_longPressSpeed.value = GlobalDataCache.longPressSpeed;
|
||||||
_longPressSpeed.value = cache.longPressSpeed;
|
speedsList = GlobalDataCache.speedsList;
|
||||||
speedsList = cache.speedsList;
|
|
||||||
// _playerEventSubs = onPlayerStatusChanged.listen((PlayerStatus status) {
|
// _playerEventSubs = onPlayerStatusChanged.listen((PlayerStatus status) {
|
||||||
// if (status == PlayerStatus.playing) {
|
// if (status == PlayerStatus.playing) {
|
||||||
// WakelockPlus.enable();
|
// WakelockPlus.enable();
|
||||||
@ -305,11 +305,11 @@ class PlPlayerController {
|
|||||||
String videoType = 'archive',
|
String videoType = 'archive',
|
||||||
}) {
|
}) {
|
||||||
// 如果实例尚未创建,则创建一个新实例
|
// 如果实例尚未创建,则创建一个新实例
|
||||||
_instance ??= PlPlayerController._internal(videoType);
|
_instance ??= PlPlayerController._internal();
|
||||||
if (videoType != 'none') {
|
if (videoType != 'none') {
|
||||||
_instance!._playerCount.value += 1;
|
_instance!._playerCount.value += 1;
|
||||||
_videoType.value = videoType;
|
|
||||||
}
|
}
|
||||||
|
_videoType = videoType;
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,6 +471,7 @@ class PlPlayerController {
|
|||||||
configuration: VideoControllerConfiguration(
|
configuration: VideoControllerConfiguration(
|
||||||
enableHardwareAcceleration: enableHA,
|
enableHardwareAcceleration: enableHA,
|
||||||
androidAttachSurfaceAfterVideoParameters: false,
|
androidAttachSurfaceAfterVideoParameters: false,
|
||||||
|
hwdec: enableHA ? GlobalDataCache.hardwareDecodeFormat : null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -828,47 +829,53 @@ class PlPlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Toggle Change the videofit accordingly
|
/// Toggle Change the videofit accordingly
|
||||||
void toggleVideoFit() {
|
void toggleVideoFit(String toggleType) {
|
||||||
showDialog(
|
if (toggleType == 'press') {
|
||||||
context: Get.context!,
|
final String videoFitDEsc = _videoFitDesc.value;
|
||||||
builder: (context) {
|
final int index = videoFitType.indexWhere(
|
||||||
return AlertDialog(
|
(element) => element['desc'] == videoFitDEsc,
|
||||||
title: const Text('画面比例'),
|
);
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
final int newIndex = index + 1 >= videoFitType.length ? 0 : index + 1;
|
||||||
return Wrap(
|
_videoFit.value = videoFitType[newIndex]['attr'];
|
||||||
alignment: WrapAlignment.start,
|
_videoFitDesc.value = videoFitType[newIndex]['desc'];
|
||||||
|
setVideoFit();
|
||||||
|
SmartDialog.showToast('画面比例:${videoFitType[newIndex]['desc']}');
|
||||||
|
} else {
|
||||||
|
void onPressed(item) {
|
||||||
|
_videoFit.value = item['attr'];
|
||||||
|
_videoFitDesc.value = item['desc'];
|
||||||
|
setVideoFit();
|
||||||
|
Navigator.of(Get.context!).pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: Get.context!,
|
||||||
|
builder: (context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('画面比例'),
|
||||||
|
content: Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 2,
|
runSpacing: 2,
|
||||||
children: [
|
children: [
|
||||||
for (var i in videoFitType) ...[
|
for (var i in videoFitType) ...[
|
||||||
if (_videoFit.value == i['attr']) ...[
|
if (_videoFit.value == i['attr']) ...[
|
||||||
FilledButton(
|
FilledButton(
|
||||||
onPressed: () async {
|
onPressed: () => onPressed(i),
|
||||||
_videoFit.value = i['attr'];
|
|
||||||
_videoFitDesc.value = i['desc'];
|
|
||||||
setVideoFit();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i['desc']),
|
child: Text(i['desc']),
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
FilledButton.tonal(
|
FilledButton.tonal(
|
||||||
onPressed: () async {
|
onPressed: () => onPressed(i),
|
||||||
_videoFit.value = i['attr'];
|
|
||||||
_videoFitDesc.value = i['desc'];
|
|
||||||
setVideoFit();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i['desc']),
|
child: Text(i['desc']),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
}),
|
);
|
||||||
);
|
},
|
||||||
},
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 缓存fit
|
/// 缓存fit
|
||||||
@ -909,7 +916,7 @@ class PlPlayerController {
|
|||||||
if (videoType == 'live') {
|
if (videoType == 'live') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (controlsLock.value) {
|
if (_controlsLock.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_doubleSpeedStatus.value = val;
|
_doubleSpeedStatus.value = val;
|
||||||
@ -929,6 +936,11 @@ class PlPlayerController {
|
|||||||
showControls.value = !val;
|
showControls.value = !val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 设置/更新顶部控制栏
|
||||||
|
void setHeaderControl(PreferredSizeWidget? widget) {
|
||||||
|
headerControl = widget;
|
||||||
|
}
|
||||||
|
|
||||||
void toggleFullScreen(bool val) {
|
void toggleFullScreen(bool val) {
|
||||||
_isFullScreen.value = val;
|
_isFullScreen.value = val;
|
||||||
}
|
}
|
||||||
@ -1047,13 +1059,12 @@ class PlPlayerController {
|
|||||||
|
|
||||||
/// 缓存本次弹幕选项
|
/// 缓存本次弹幕选项
|
||||||
cacheDanmakuOption() {
|
cacheDanmakuOption() {
|
||||||
final cache = GlobalDataCache();
|
GlobalDataCache.blockTypes = blockTypes;
|
||||||
cache.blockTypes = blockTypes;
|
GlobalDataCache.showArea = showArea;
|
||||||
cache.showArea = showArea;
|
GlobalDataCache.opacityVal = opacityVal;
|
||||||
cache.opacityVal = opacityVal;
|
GlobalDataCache.fontSizeVal = fontSizeVal;
|
||||||
cache.fontSizeVal = fontSizeVal;
|
GlobalDataCache.danmakuDurationVal = danmakuDurationVal;
|
||||||
cache.danmakuDurationVal = danmakuDurationVal;
|
GlobalDataCache.strokeWidth = strokeWidth;
|
||||||
cache.strokeWidth = strokeWidth;
|
|
||||||
|
|
||||||
localCache.put(LocalCacheKey.danmakuBlockType, blockTypes);
|
localCache.put(LocalCacheKey.danmakuBlockType, blockTypes);
|
||||||
localCache.put(LocalCacheKey.danmakuShowArea, showArea);
|
localCache.put(LocalCacheKey.danmakuShowArea, showArea);
|
||||||
@ -1081,6 +1092,7 @@ class PlPlayerController {
|
|||||||
videoFitChangedTimer?.cancel();
|
videoFitChangedTimer?.cancel();
|
||||||
// _position.close();
|
// _position.close();
|
||||||
_playerEventSubs?.cancel();
|
_playerEventSubs?.cancel();
|
||||||
|
_controlsLock.value = false;
|
||||||
// _sliderPosition.close();
|
// _sliderPosition.close();
|
||||||
// _sliderTempPosition.close();
|
// _sliderTempPosition.close();
|
||||||
// _isSliderMoving.close();
|
// _isSliderMoving.close();
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
late bool enableBackgroundPlay;
|
late bool enableBackgroundPlay;
|
||||||
late double screenWidth;
|
late double screenWidth;
|
||||||
final FullScreenGestureMode fullScreenGestureMode =
|
final FullScreenGestureMode fullScreenGestureMode =
|
||||||
GlobalDataCache().fullScreenGestureMode;
|
GlobalDataCache.fullScreenGestureMode;
|
||||||
|
|
||||||
// 用于记录上一次全屏切换手势触发时间,避免误触
|
// 用于记录上一次全屏切换手势触发时间,避免误触
|
||||||
DateTime? lastFullScreenToggleTime;
|
DateTime? lastFullScreenToggleTime;
|
||||||
@ -136,7 +136,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
screenWidth = Get.size.width;
|
screenWidth = Get.size.width;
|
||||||
animationController = AnimationController(
|
animationController = AnimationController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
duration: GlobalDataCache().enablePlayerControlAnimation
|
duration: GlobalDataCache.enablePlayerControlAnimation
|
||||||
? const Duration(milliseconds: 150)
|
? const Duration(milliseconds: 150)
|
||||||
: const Duration(milliseconds: 10),
|
: const Duration(milliseconds: 10),
|
||||||
);
|
);
|
||||||
@ -301,16 +301,22 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
/// 画面比例
|
/// 画面比例
|
||||||
BottomControlType.fit: SizedBox(
|
BottomControlType.fit: SizedBox(
|
||||||
|
width: 45,
|
||||||
height: 30,
|
height: 30,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () => _.toggleVideoFit(),
|
onPressed: () => _.toggleVideoFit('press'),
|
||||||
|
onLongPress: () => _.toggleVideoFit('longPress'),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Text(
|
() => Text(
|
||||||
_.videoFitDEsc.value,
|
_.videoFitDEsc.value,
|
||||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -320,29 +326,49 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
BottomControlType.speed: SizedBox(
|
BottomControlType.speed: SizedBox(
|
||||||
width: 45,
|
width: 45,
|
||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: PopupMenuButton<double>(
|
||||||
style: ButtonStyle(
|
tooltip: '更改播放速度',
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
onSelected: (double value) {
|
||||||
),
|
_.setPlaybackSpeed(value);
|
||||||
onPressed: () {},
|
},
|
||||||
child: Obx(
|
initialValue: _.playbackSpeed,
|
||||||
() => Text(
|
color: Colors.black.withOpacity(0.8),
|
||||||
'${_.playbackSpeed.toString()}X',
|
itemBuilder: (BuildContext context) {
|
||||||
style: textStyle,
|
return _.speedsList.map((double speed) {
|
||||||
|
return PopupMenuItem<double>(
|
||||||
|
height: 40,
|
||||||
|
padding: const EdgeInsets.only(left: 20),
|
||||||
|
value: speed,
|
||||||
|
child: Text(
|
||||||
|
'${speed}x',
|
||||||
|
style: textStyle.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 45,
|
||||||
|
height: 34,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
margin: const EdgeInsets.only(right: 4),
|
||||||
|
child: Obx(
|
||||||
|
() => Text(
|
||||||
|
'${_.playbackSpeed.toString()}x',
|
||||||
|
style: textStyle.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
/// 字幕
|
|
||||||
/// 全屏
|
/// 全屏
|
||||||
BottomControlType.fullscreen: ComBtn(
|
BottomControlType.fullscreen: ComBtn(
|
||||||
icon: Obx(
|
icon: Obx(
|
||||||
() => Icon(
|
() => Image.asset(
|
||||||
_.isFullScreen.value
|
_.isFullScreen.value
|
||||||
? FontAwesomeIcons.compress
|
? 'assets/images/video/fullscreen_exit.png'
|
||||||
: FontAwesomeIcons.expand,
|
: 'assets/images/video/fullscreen.png',
|
||||||
size: 15,
|
width: 19,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -359,6 +385,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
BottomControlType.time,
|
BottomControlType.time,
|
||||||
BottomControlType.space,
|
BottomControlType.space,
|
||||||
BottomControlType.fit,
|
BottomControlType.fit,
|
||||||
|
BottomControlType.speed,
|
||||||
BottomControlType.fullscreen,
|
BottomControlType.fullscreen,
|
||||||
];
|
];
|
||||||
for (var i = 0; i < userSpecifyItem.length; i++) {
|
for (var i = 0; i < userSpecifyItem.length; i++) {
|
||||||
@ -739,29 +766,37 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
// 头部、底部控制条
|
// 头部、底部控制条
|
||||||
Obx(
|
Obx(
|
||||||
() => Column(
|
() => Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
if (widget.headerControl != null || _.headerControl != null)
|
if (widget.headerControl != null || _.headerControl != null) ...[
|
||||||
ClipRect(
|
Flexible(
|
||||||
|
child: ClipRect(
|
||||||
|
child: AppBarAni(
|
||||||
|
controller: animationController,
|
||||||
|
visible: !_.controlsLock.value && _.showControls.value,
|
||||||
|
position: 'top',
|
||||||
|
child: widget.headerControl ?? _.headerControl!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
] else ...[
|
||||||
|
const SizedBox.shrink()
|
||||||
|
],
|
||||||
|
Flexible(
|
||||||
|
flex: _.videoType == 'live' ? 0 : 1,
|
||||||
|
child: ClipRect(
|
||||||
child: AppBarAni(
|
child: AppBarAni(
|
||||||
controller: animationController,
|
controller: animationController,
|
||||||
visible: !_.controlsLock.value && _.showControls.value,
|
visible: !_.controlsLock.value && _.showControls.value,
|
||||||
position: 'top',
|
position: 'bottom',
|
||||||
child: widget.headerControl ?? _.headerControl!,
|
child: widget.bottomControl ??
|
||||||
|
BottomControl(
|
||||||
|
controller: widget.controller,
|
||||||
|
triggerFullScreen: _.triggerFullScreen,
|
||||||
|
buildBottomControl: buildBottomControl(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
|
||||||
ClipRect(
|
|
||||||
child: AppBarAni(
|
|
||||||
controller: animationController,
|
|
||||||
visible: !_.controlsLock.value && _.showControls.value,
|
|
||||||
position: 'bottom',
|
|
||||||
child: widget.bottomControl ??
|
|
||||||
BottomControl(
|
|
||||||
controller: widget.controller,
|
|
||||||
triggerFullScreen: _.triggerFullScreen,
|
|
||||||
buildBottomControl: buildBottomControl(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -807,8 +842,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
total: Duration(seconds: max),
|
total: Duration(seconds: max),
|
||||||
progressBarColor: colorTheme,
|
progressBarColor: colorTheme,
|
||||||
baseBarColor: Colors.white.withOpacity(0.2),
|
baseBarColor: Colors.white.withOpacity(0.2),
|
||||||
bufferedBarColor:
|
bufferedBarColor: Colors.white.withOpacity(0.6),
|
||||||
Theme.of(context).colorScheme.primary.withOpacity(0.4),
|
|
||||||
timeLabelLocation: TimeLabelLocation.none,
|
timeLabelLocation: TimeLabelLocation.none,
|
||||||
thumbColor: colorTheme,
|
thumbColor: colorTheme,
|
||||||
barHeight: 3,
|
barHeight: 3,
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
import 'package:audio_video_progress_bar/audio_video_progress_bar.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'progress_bar.dart';
|
||||||
|
|
||||||
class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
||||||
final PlPlayerController? controller;
|
final PlPlayerController? controller;
|
||||||
@ -20,54 +18,18 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color colorTheme = Theme.of(context).colorScheme.primary;
|
|
||||||
final _ = controller!;
|
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
height: 90,
|
height: 90,
|
||||||
padding: const EdgeInsets.only(left: 18, right: 18),
|
padding: const EdgeInsets.symmetric(horizontal: 18),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Obx(
|
Padding(
|
||||||
() {
|
padding: const EdgeInsets.fromLTRB(7, 0, 7, 6),
|
||||||
final int value = _.sliderPositionSeconds.value;
|
child: ProgressBarWidget(controller: controller!),
|
||||||
final int max = _.durationSeconds.value;
|
|
||||||
final int buffer = _.bufferedSeconds.value;
|
|
||||||
if (value > max || max <= 0) {
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 7, right: 7, bottom: 6),
|
|
||||||
child: ProgressBar(
|
|
||||||
progress: Duration(seconds: value),
|
|
||||||
buffered: Duration(seconds: buffer),
|
|
||||||
total: Duration(seconds: max),
|
|
||||||
progressBarColor: colorTheme,
|
|
||||||
baseBarColor: Colors.white.withOpacity(0.2),
|
|
||||||
bufferedBarColor: colorTheme.withOpacity(0.4),
|
|
||||||
timeLabelLocation: TimeLabelLocation.none,
|
|
||||||
thumbColor: colorTheme,
|
|
||||||
barHeight: 3.5,
|
|
||||||
thumbRadius: 7,
|
|
||||||
onDragStart: (duration) {
|
|
||||||
feedBack();
|
|
||||||
_.onChangedSliderStart();
|
|
||||||
},
|
|
||||||
onDragUpdate: (duration) {
|
|
||||||
_.onUpdatedSliderProgress(duration.timeStamp);
|
|
||||||
},
|
|
||||||
onSeek: (duration) {
|
|
||||||
_.onChangedSliderEnd();
|
|
||||||
_.onChangedSlider(duration.inSeconds.toDouble());
|
|
||||||
_.seekTo(Duration(seconds: duration.inSeconds),
|
|
||||||
type: 'slider');
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
Row(children: [...buildBottomControl!]),
|
Row(children: buildBottomControl!),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
52
lib/plugin/pl_player/widgets/progress_bar.dart
Normal file
52
lib/plugin/pl_player/widgets/progress_bar.dart
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import 'package:audio_video_progress_bar/audio_video_progress_bar.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
|
|
||||||
|
class ProgressBarWidget extends StatelessWidget {
|
||||||
|
final PlPlayerController controller;
|
||||||
|
|
||||||
|
const ProgressBarWidget({
|
||||||
|
required this.controller,
|
||||||
|
Key? key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Obx(() {
|
||||||
|
Color colorTheme = Theme.of(context).colorScheme.primary;
|
||||||
|
final _ = controller;
|
||||||
|
final int value = _.sliderPositionSeconds.value;
|
||||||
|
final int max = _.durationSeconds.value;
|
||||||
|
final int buffer = _.bufferedSeconds.value;
|
||||||
|
if (value > max || max <= 0) {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
return ProgressBar(
|
||||||
|
progress: Duration(seconds: value),
|
||||||
|
buffered: Duration(seconds: buffer),
|
||||||
|
total: Duration(seconds: max),
|
||||||
|
progressBarColor: colorTheme,
|
||||||
|
baseBarColor: Colors.white.withOpacity(0.2),
|
||||||
|
bufferedBarColor: Colors.white.withOpacity(0.6),
|
||||||
|
timeLabelLocation: TimeLabelLocation.none,
|
||||||
|
thumbColor: colorTheme,
|
||||||
|
barHeight: 3.5,
|
||||||
|
thumbRadius: 7,
|
||||||
|
onDragStart: (duration) {
|
||||||
|
feedBack();
|
||||||
|
_.onChangedSliderStart();
|
||||||
|
},
|
||||||
|
onDragUpdate: (duration) {
|
||||||
|
_.onUpdatedSliderProgress(duration.timeStamp);
|
||||||
|
},
|
||||||
|
onSeek: (duration) {
|
||||||
|
_.onChangedSliderEnd();
|
||||||
|
_.onChangedSlider(duration.inSeconds.toDouble());
|
||||||
|
_.seekTo(Duration(seconds: duration.inSeconds), type: 'slider');
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:io';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/models/user/info.dart';
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
@ -5,54 +6,62 @@ import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
|
|||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import '../models/common/index.dart';
|
import '../models/common/index.dart';
|
||||||
|
|
||||||
Box setting = GStorage.setting;
|
Box settingBox = GStorage.setting;
|
||||||
Box localCache = GStorage.localCache;
|
Box localCache = GStorage.localCache;
|
||||||
Box videoStorage = GStorage.video;
|
Box videoStorage = GStorage.video;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
|
|
||||||
class GlobalDataCache {
|
class GlobalDataCache {
|
||||||
late int imgQuality;
|
static late int imgQuality;
|
||||||
late FullScreenGestureMode fullScreenGestureMode;
|
static late FullScreenGestureMode fullScreenGestureMode;
|
||||||
late bool enablePlayerControlAnimation;
|
static late bool enablePlayerControlAnimation;
|
||||||
late List<String> actionTypeSort;
|
static late List<String> actionTypeSort;
|
||||||
late double sheetHeight;
|
static late double sheetHeight;
|
||||||
String? wWebid;
|
static String? wWebid;
|
||||||
|
|
||||||
/// 播放器相关
|
/// 播放器相关
|
||||||
// 弹幕开关
|
// 弹幕开关
|
||||||
late bool isOpenDanmu;
|
static late bool isOpenDanmu;
|
||||||
// 弹幕屏蔽类型
|
// 弹幕屏蔽类型
|
||||||
late List<dynamic> blockTypes;
|
static late List<dynamic> blockTypes;
|
||||||
// 弹幕展示区域
|
// 弹幕展示区域
|
||||||
late double showArea;
|
static late double showArea;
|
||||||
// 弹幕透明度
|
// 弹幕透明度
|
||||||
late double opacityVal;
|
static late double opacityVal;
|
||||||
// 弹幕字体大小
|
// 弹幕字体大小
|
||||||
late double fontSizeVal;
|
static late double fontSizeVal;
|
||||||
// 弹幕显示时间
|
// 弹幕显示时间
|
||||||
late double danmakuDurationVal;
|
static late double danmakuDurationVal;
|
||||||
// 弹幕描边宽度
|
// 弹幕描边宽度
|
||||||
late double strokeWidth;
|
static late double strokeWidth;
|
||||||
// 播放器循环模式
|
// 播放器循环模式
|
||||||
late PlayRepeat playRepeat;
|
static late PlayRepeat playRepeat;
|
||||||
// 播放器默认播放速度
|
// 播放器默认播放速度
|
||||||
late double playbackSpeed;
|
static late double playbackSpeed;
|
||||||
// 播放器自动长按速度
|
// 播放器自动长按速度
|
||||||
late bool enableAutoLongPressSpeed;
|
static late bool enableAutoLongPressSpeed;
|
||||||
// 播放器长按速度
|
// 播放器长按速度
|
||||||
late double longPressSpeed;
|
static late double longPressSpeed;
|
||||||
// 播放器速度列表
|
// 播放器速度列表
|
||||||
late List<double> speedsList;
|
static late List<double> speedsList;
|
||||||
// 用户信息
|
// 用户信息
|
||||||
UserInfoData? userInfo;
|
static UserInfoData? userInfo;
|
||||||
// 搜索历史
|
// 搜索历史
|
||||||
late List historyCacheList;
|
static late List historyCacheList;
|
||||||
//
|
// 搜索建议
|
||||||
late bool enableSearchSuggest = true;
|
static late bool enableSearchSuggest;
|
||||||
// 简介默认展开
|
// 简介默认展开
|
||||||
late bool enableAutoExpand = false;
|
static late bool enableAutoExpand;
|
||||||
//
|
// 动态切换
|
||||||
late bool enableDynamicSwitch = true;
|
static late bool enableDynamicSwitch;
|
||||||
|
// 投屏开关
|
||||||
|
static bool enableDlna = false;
|
||||||
|
// 硬件解码格式
|
||||||
|
static late String hardwareDecodeFormat;
|
||||||
|
// sponsorBlock开关
|
||||||
|
static bool enableSponsorBlock = false;
|
||||||
|
// 视频评论开关
|
||||||
|
static List<String> enableComment = ['video', 'bangumi'];
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalDataCache._();
|
GlobalDataCache._();
|
||||||
@ -64,19 +73,19 @@ class GlobalDataCache {
|
|||||||
factory GlobalDataCache() => _instance;
|
factory GlobalDataCache() => _instance;
|
||||||
|
|
||||||
// 异步初始化方法
|
// 异步初始化方法
|
||||||
Future<void> initialize() async {
|
static Future<void> initialize() async {
|
||||||
imgQuality = await setting.get(SettingBoxKey.defaultPicQa,
|
imgQuality = await settingBox.get(SettingBoxKey.defaultPicQa,
|
||||||
defaultValue: 10); // 设置全局变量
|
defaultValue: 10); // 设置全局变量
|
||||||
fullScreenGestureMode = FullScreenGestureMode.values[setting.get(
|
fullScreenGestureMode = FullScreenGestureMode.values[settingBox.get(
|
||||||
SettingBoxKey.fullScreenGestureMode,
|
SettingBoxKey.fullScreenGestureMode,
|
||||||
defaultValue: FullScreenGestureMode.fromBottomtoTop.index)];
|
defaultValue: FullScreenGestureMode.fromBottomtoTop.index)];
|
||||||
enablePlayerControlAnimation = setting
|
enablePlayerControlAnimation = settingBox
|
||||||
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
||||||
actionTypeSort = await setting.get(SettingBoxKey.actionTypeSort,
|
actionTypeSort = await settingBox.get(SettingBoxKey.actionTypeSort,
|
||||||
defaultValue: ['like', 'coin', 'collect', 'watchLater', 'share']);
|
defaultValue: ['like', 'coin', 'collect', 'watchLater', 'share']);
|
||||||
|
|
||||||
isOpenDanmu =
|
isOpenDanmu = await settingBox.get(SettingBoxKey.enableShowDanmaku,
|
||||||
await setting.get(SettingBoxKey.enableShowDanmaku, defaultValue: false);
|
defaultValue: false);
|
||||||
blockTypes =
|
blockTypes =
|
||||||
await localCache.get(LocalCacheKey.danmakuBlockType, defaultValue: []);
|
await localCache.get(LocalCacheKey.danmakuBlockType, defaultValue: []);
|
||||||
showArea =
|
showArea =
|
||||||
@ -97,7 +106,7 @@ class GlobalDataCache {
|
|||||||
.firstWhere((e) => e.value == defaultPlayRepeat);
|
.firstWhere((e) => e.value == defaultPlayRepeat);
|
||||||
playbackSpeed =
|
playbackSpeed =
|
||||||
await videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0);
|
await videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0);
|
||||||
enableAutoLongPressSpeed = await setting
|
enableAutoLongPressSpeed = await settingBox
|
||||||
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
|
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
|
||||||
if (!enableAutoLongPressSpeed) {
|
if (!enableAutoLongPressSpeed) {
|
||||||
longPressSpeed = await videoStorage.get(VideoBoxKey.longPressSpeedDefault,
|
longPressSpeed = await videoStorage.get(VideoBoxKey.longPressSpeedDefault,
|
||||||
@ -115,10 +124,21 @@ class GlobalDataCache {
|
|||||||
sheetHeight = localCache.get('sheetHeight', defaultValue: 0.0);
|
sheetHeight = localCache.get('sheetHeight', defaultValue: 0.0);
|
||||||
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
||||||
enableSearchSuggest =
|
enableSearchSuggest =
|
||||||
setting.get(SettingBoxKey.enableSearchSuggest, defaultValue: true);
|
settingBox.get(SettingBoxKey.enableSearchSuggest, defaultValue: true);
|
||||||
enableAutoExpand =
|
enableAutoExpand =
|
||||||
setting.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
|
settingBox.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
|
||||||
enableDynamicSwitch =
|
enableDynamicSwitch =
|
||||||
setting.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
settingBox.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
||||||
|
enableDlna = settingBox.get(SettingBoxKey.enableDlna, defaultValue: false);
|
||||||
|
hardwareDecodeFormat = settingBox.get(SettingBoxKey.hardwareDecodeFormat,
|
||||||
|
defaultValue: Platform.isAndroid ? 'auto-safe' : 'auto');
|
||||||
|
settingBox.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
||||||
|
enableDlna = settingBox.get(SettingBoxKey.enableDlna, defaultValue: false);
|
||||||
|
enableSponsorBlock =
|
||||||
|
settingBox.get(SettingBoxKey.enableSponsorBlock, defaultValue: false);
|
||||||
|
settingBox.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
||||||
|
enableDlna = settingBox.get(SettingBoxKey.enableDlna, defaultValue: false);
|
||||||
|
enableComment = settingBox
|
||||||
|
.get(SettingBoxKey.enableComment, defaultValue: ['video', 'bangumi']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class LoginUtils {
|
|||||||
Request.dio.options.headers['cookie'] = '';
|
Request.dio.options.headers['cookie'] = '';
|
||||||
userInfoCache.put('userInfoCache', null);
|
userInfoCache.put('userInfoCache', null);
|
||||||
localCache.put(LocalCacheKey.accessKey, {'mid': -1, 'value': ''});
|
localCache.put(LocalCacheKey.accessKey, {'mid': -1, 'value': ''});
|
||||||
GlobalDataCache().userInfo = null;
|
GlobalDataCache.userInfo = null;
|
||||||
await refreshLoginStatus(false);
|
await refreshLoginStatus(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,7 +115,11 @@ class SettingBoxKey {
|
|||||||
enableAi = 'enableAi',
|
enableAi = 'enableAi',
|
||||||
enableAutoExpand = 'enableAutoExpand',
|
enableAutoExpand = 'enableAutoExpand',
|
||||||
defaultHomePage = 'defaultHomePage',
|
defaultHomePage = 'defaultHomePage',
|
||||||
enableRelatedVideo = 'enableRelatedVideo';
|
enableRelatedVideo = 'enableRelatedVideo',
|
||||||
|
enableDlna = 'enableDlna',
|
||||||
|
hardwareDecodeFormat = 'hardwareDecodeFormat',
|
||||||
|
enableSponsorBlock = 'enableSponsorBlock',
|
||||||
|
enableComment = 'enableComment';
|
||||||
|
|
||||||
/// 外观
|
/// 外观
|
||||||
static const String themeMode = 'themeMode',
|
static const String themeMode = 'themeMode',
|
||||||
|
|||||||
28
pubspec.lock
28
pubspec.lock
@ -85,10 +85,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: audio_service
|
name: audio_service
|
||||||
sha256: "4547c312a94f9cb2c48b60823fb190767cbd63454a83c73049384d5d3cba4650"
|
sha256: "9dd5ba7e77567b290c35908b1950d61485b4dfdd3a0ac398e98cfeec04651b75"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.18.13"
|
version: "0.18.15"
|
||||||
audio_service_platform_interface:
|
audio_service_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -101,18 +101,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: audio_service_web
|
name: audio_service_web
|
||||||
sha256: "9d7d5ae5f98a5727f2580fad73062f2484f400eef6cef42919413268e62a363e"
|
sha256: "4cdc2127cd4562b957fb49227dc58e3303fafb09bde2573bc8241b938cf759d9"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.2"
|
version: "0.1.3"
|
||||||
audio_session:
|
audio_session:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: audio_session
|
name: audio_session
|
||||||
sha256: "6fdf255ed3af86535c96452c33ecff1245990bb25a605bfb1958661ccc3d467f"
|
sha256: "343e83bc7809fbda2591a49e525d6b63213ade10c76f15813be9aed6657b3261"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.18"
|
version: "0.1.21"
|
||||||
audio_video_progress_bar:
|
audio_video_progress_bar:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -497,6 +497,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.2.1"
|
version: "6.2.1"
|
||||||
|
fading_edge_scrollview:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fading_edge_scrollview
|
||||||
|
sha256: c25c2231652ce774cc31824d0112f11f653881f43d7f5302c05af11942052031
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -990,6 +998,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.0"
|
version: "6.1.0"
|
||||||
|
marquee:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: marquee
|
||||||
|
sha256: "4b5243d2804373bdc25fc93d42c3b402d6ec1f4ee8d0bb72276edd04ae7addb8"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.3"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -89,8 +89,8 @@ dependencies:
|
|||||||
media_kit_libs_video: ^1.0.4
|
media_kit_libs_video: ^1.0.4
|
||||||
|
|
||||||
# 媒体通知
|
# 媒体通知
|
||||||
audio_service: ^0.18.13
|
audio_service: ^0.18.15
|
||||||
audio_session: ^0.1.18
|
audio_session: ^0.1.21
|
||||||
|
|
||||||
# 音量、亮度、屏幕控制
|
# 音量、亮度、屏幕控制
|
||||||
flutter_volume_controller: ^1.3.2
|
flutter_volume_controller: ^1.3.2
|
||||||
@ -152,6 +152,8 @@ dependencies:
|
|||||||
re_highlight: ^0.0.3
|
re_highlight: ^0.0.3
|
||||||
# 图片选择器
|
# 图片选择器
|
||||||
image_picker: ^1.1.2
|
image_picker: ^1.1.2
|
||||||
|
# 跑马灯
|
||||||
|
marquee: ^2.2.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user