Merge branch 'main' into feature-invalidInfo
This commit is contained in:
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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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) {
|
||||||
|
|||||||
@ -1,9 +1,15 @@
|
|||||||
import 'package:pilipala/models/common/invalid_video.dart';
|
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});
|
||||||
@ -70,4 +76,42 @@ class CommonHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,16 @@
|
|||||||
// 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';
|
||||||
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
|
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
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';
|
||||||
|
|
||||||
@ -26,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
|
||||||
@ -43,7 +39,7 @@ class Request {
|
|||||||
dio.interceptors.add(cookieManager);
|
dio.interceptors.add(cookieManager);
|
||||||
final List<Cookie> cookie = await cookieManager.cookieJar
|
final List<Cookie> cookie = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||||
final userInfo = userInfoCache.get('userInfoCache');
|
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo != null && userInfo.mid != null) {
|
if (userInfo != null && userInfo.mid != null) {
|
||||||
final List<Cookie> cookie2 = await cookieManager.cookieJar
|
final List<Cookie> cookie2 = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.tUrl));
|
.loadForRequest(Uri.parse(HttpString.tUrl));
|
||||||
@ -61,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}')
|
||||||
@ -121,30 +112,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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:hive/hive.dart';
|
|||||||
import 'package:html/parser.dart';
|
import 'package:html/parser.dart';
|
||||||
import 'package:pilipala/models/member/article.dart';
|
import 'package:pilipala/models/member/article.dart';
|
||||||
import 'package:pilipala/models/member/like.dart';
|
import 'package:pilipala/models/member/like.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/global_data_cache.dart';
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import '../common/constants.dart';
|
import '../common/constants.dart';
|
||||||
import '../models/dynamics/result.dart';
|
import '../models/dynamics/result.dart';
|
||||||
@ -25,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({
|
||||||
@ -472,9 +473,9 @@ class MemberHttp {
|
|||||||
String accessKey = res.data['data']['access_token'];
|
String accessKey = res.data['data']['access_token'];
|
||||||
Box localCache = GStorage.localCache;
|
Box localCache = GStorage.localCache;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
var userInfo = userInfoCache.get('userInfoCache');
|
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||||
localCache.put(
|
localCache.put(
|
||||||
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});
|
LocalCacheKey.accessKey, {'mid': userInfo!.mid, 'value': accessKey});
|
||||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
return {'status': true, 'data': [], 'msg': '操作成功'};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
@ -573,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};
|
||||||
}
|
}
|
||||||
@ -587,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': '请检查登录状态'};
|
||||||
@ -604,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 {
|
||||||
@ -224,12 +226,8 @@ class BuildMainApp extends StatelessWidget {
|
|||||||
|
|
||||||
AppBarTheme appBarTheme(ColorScheme colorScheme) {
|
AppBarTheme appBarTheme(ColorScheme colorScheme) {
|
||||||
return AppBarTheme(
|
return AppBarTheme(
|
||||||
backgroundColor: currentThemeValue == ThemeType.dark
|
backgroundColor: colorScheme.surface,
|
||||||
? darkColorScheme.surface
|
foregroundColor: colorScheme.onSurface,
|
||||||
: lightColorScheme.surface,
|
|
||||||
foregroundColor: currentThemeValue == ThemeType.dark
|
|
||||||
? darkColorScheme.onSurface
|
|
||||||
: lightColorScheme.onSurface,
|
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
|
|||||||
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];
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/bangumi.dart';
|
import 'package:pilipala/http/bangumi.dart';
|
||||||
import 'package:pilipala/models/bangumi/list.dart';
|
import 'package:pilipala/models/bangumi/list.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class BangumiController extends GetxController {
|
class BangumiController extends GetxController {
|
||||||
@ -15,14 +16,14 @@ class BangumiController extends GetxController {
|
|||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
RxBool userLogin = false.obs;
|
RxBool userLogin = false.obs;
|
||||||
late int mid;
|
late int mid;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
mid = userInfo.mid;
|
mid = userInfo!.mid!;
|
||||||
}
|
}
|
||||||
userLogin.value = userInfo != null;
|
userLogin.value = userInfo != null;
|
||||||
}
|
}
|
||||||
@ -55,7 +56,7 @@ class BangumiController extends GetxController {
|
|||||||
if (userInfo == null) {
|
if (userInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var result = await BangumiHttp.getRecentBangumi(mid: userInfo.mid);
|
var result = await BangumiHttp.getRecentBangumi(mid: userInfo!.mid!);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
bangumiFollowList.value = result['data'].list;
|
bangumiFollowList.value = result['data'].list;
|
||||||
total.value = result['data'].total;
|
total.value = result['data'].total;
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:pilipala/http/search.dart';
|
|||||||
import 'package:pilipala/http/video.dart';
|
import 'package:pilipala/http/video.dart';
|
||||||
import 'package:pilipala/models/bangumi/info.dart';
|
import 'package:pilipala/models/bangumi/info.dart';
|
||||||
import 'package:pilipala/models/user/fav_folder.dart';
|
import 'package:pilipala/models/user/fav_folder.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.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';
|
||||||
@ -57,7 +58,7 @@ class BangumiIntroController extends GetxController {
|
|||||||
RxBool isFollowed = false.obs;
|
RxBool isFollowed = false.obs;
|
||||||
RxInt followStatus = 1.obs;
|
RxInt followStatus = 1.obs;
|
||||||
int _tempThemeValue = -1;
|
int _tempThemeValue = -1;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
PersistentBottomSheetController? bottomSheetController;
|
PersistentBottomSheetController? bottomSheetController;
|
||||||
List<Map<String, dynamic>> followStatusList = [
|
List<Map<String, dynamic>> followStatusList = [
|
||||||
{'title': '标记为 「想看」', 'status': 1},
|
{'title': '标记为 「想看」', 'status': 1},
|
||||||
@ -259,7 +260,7 @@ class BangumiIntroController extends GetxController {
|
|||||||
|
|
||||||
Future queryVideoInFolder() async {
|
Future queryVideoInFolder() async {
|
||||||
var result = await VideoHttp.videoInFolder(
|
var result = await VideoHttp.videoInFolder(
|
||||||
mid: userInfo.mid, rid: IdUtils.bv2av(bvid));
|
mid: userInfo!.mid!, rid: IdUtils.bv2av(bvid));
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
favFolderData.value = result['data'];
|
favFolderData.value = result['data'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,7 +148,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
showFavBottomSheet() async {
|
showFavBottomSheet() async {
|
||||||
if (bangumiIntroController.userInfo.mid == null) {
|
if (bangumiIntroController.userInfo?.mid == null) {
|
||||||
SmartDialog.showToast('账号未登录');
|
SmartDialog.showToast('账号未登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,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/models/bangumi/info.dart';
|
import 'package:pilipala/models/bangumi/info.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import '../../../common/pages_bottom_sheet.dart';
|
import '../../../common/pages_bottom_sheet.dart';
|
||||||
@ -37,7 +38,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
late RxInt currentIndex = (-1).obs;
|
late RxInt currentIndex = (-1).obs;
|
||||||
final ScrollController listViewScrollCtr = ScrollController();
|
final ScrollController listViewScrollCtr = ScrollController();
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
dynamic userInfo;
|
UserInfoData? userInfo;
|
||||||
// 默认未开通
|
// 默认未开通
|
||||||
int vipStatus = 0;
|
int vipStatus = 0;
|
||||||
late int cid;
|
late int cid;
|
||||||
@ -63,7 +64,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
/// 获取大会员状态
|
/// 获取大会员状态
|
||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
vipStatus = userInfo.vipStatus;
|
vipStatus = userInfo!.vipStatus!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import 'package:pilipala/models/common/dynamics_type.dart';
|
|||||||
import 'package:pilipala/models/dynamics/result.dart';
|
import 'package:pilipala/models/dynamics/result.dart';
|
||||||
import 'package:pilipala/models/dynamics/up.dart';
|
import 'package:pilipala/models/dynamics/up.dart';
|
||||||
import 'package:pilipala/models/live/item.dart';
|
import 'package:pilipala/models/live/item.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/route_push.dart';
|
import 'package:pilipala/utils/route_push.dart';
|
||||||
@ -52,7 +53,7 @@ class DynamicsController extends GetxController {
|
|||||||
RxInt initialValue = 0.obs;
|
RxInt initialValue = 0.obs;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
RxBool userLogin = false.obs;
|
RxBool userLogin = false.obs;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
RxBool isLoadingDynamic = false.obs;
|
RxBool isLoadingDynamic = false.obs;
|
||||||
Box setting = GStorage.setting;
|
Box setting = GStorage.setting;
|
||||||
|
|
||||||
@ -246,7 +247,7 @@ class DynamicsController extends GetxController {
|
|||||||
}
|
}
|
||||||
upData.value.upList!.insertAll(0, [
|
upData.value.upList!.insertAll(0, [
|
||||||
UpItem(face: '', uname: '全部动态', mid: -1),
|
UpItem(face: '', uname: '全部动态', mid: -1),
|
||||||
UpItem(face: userInfo.face, uname: '我', mid: userInfo.mid),
|
UpItem(face: userInfo!.face, uname: '我', mid: userInfo!.mid),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -90,7 +90,7 @@ class _ActionPanelState extends State<ActionPanel>
|
|||||||
SmartDialog.showToast('请先登录');
|
SmartDialog.showToast('请先登录');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int mid = userInfo.mid;
|
int mid = userInfo.mid!;
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
|
|||||||
@ -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,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/fan.dart';
|
import 'package:pilipala/http/fan.dart';
|
||||||
import 'package:pilipala/models/fans/result.dart';
|
import 'package:pilipala/models/fans/result.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class FansController extends GetxController {
|
class FansController extends GetxController {
|
||||||
@ -13,7 +14,7 @@ class FansController extends GetxController {
|
|||||||
RxList<FansItemModel> fansList = <FansItemModel>[].obs;
|
RxList<FansItemModel> fansList = <FansItemModel>[].obs;
|
||||||
late int mid;
|
late int mid;
|
||||||
late String name;
|
late String name;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
RxString loadingText = '加载中...'.obs;
|
RxString loadingText = '加载中...'.obs;
|
||||||
RxBool isOwner = false.obs;
|
RxBool isOwner = false.obs;
|
||||||
|
|
||||||
@ -23,9 +24,9 @@ class FansController extends GetxController {
|
|||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
mid = Get.parameters['mid'] != null
|
mid = Get.parameters['mid'] != null
|
||||||
? int.parse(Get.parameters['mid']!)
|
? int.parse(Get.parameters['mid']!)
|
||||||
: userInfo.mid;
|
: userInfo!.mid!;
|
||||||
isOwner.value = mid == userInfo.mid;
|
isOwner.value = mid == userInfo?.mid;
|
||||||
name = Get.parameters['name'] ?? userInfo.uname;
|
name = Get.parameters['name'] ?? userInfo?.uname ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future queryFans(type) async {
|
Future queryFans(type) async {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:pilipala/http/follow.dart';
|
|||||||
import 'package:pilipala/http/member.dart';
|
import 'package:pilipala/http/member.dart';
|
||||||
import 'package:pilipala/models/follow/result.dart';
|
import 'package:pilipala/models/follow/result.dart';
|
||||||
import 'package:pilipala/models/member/tags.dart';
|
import 'package:pilipala/models/member/tags.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
/// 查看自己的关注时,可以查看分类
|
/// 查看自己的关注时,可以查看分类
|
||||||
@ -18,7 +19,7 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
RxList<FollowItemModel> followList = <FollowItemModel>[].obs;
|
RxList<FollowItemModel> followList = <FollowItemModel>[].obs;
|
||||||
late int mid;
|
late int mid;
|
||||||
late String name;
|
late String name;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
RxString loadingText = '加载中...'.obs;
|
RxString loadingText = '加载中...'.obs;
|
||||||
RxBool isOwner = false.obs;
|
RxBool isOwner = false.obs;
|
||||||
late List<MemberTagItemModel> followTags;
|
late List<MemberTagItemModel> followTags;
|
||||||
@ -30,9 +31,9 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
mid = Get.parameters['mid'] != null
|
mid = Get.parameters['mid'] != null
|
||||||
? int.parse(Get.parameters['mid']!)
|
? int.parse(Get.parameters['mid']!)
|
||||||
: userInfo.mid;
|
: userInfo!.mid!;
|
||||||
isOwner.value = mid == userInfo.mid;
|
isOwner.value = mid == userInfo?.mid;
|
||||||
name = Get.parameters['name'] ?? userInfo.uname;
|
name = Get.parameters['name'] ?? userInfo?.uname ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Future queryFollowings(type) async {
|
Future queryFollowings(type) async {
|
||||||
@ -68,7 +69,7 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
|
|
||||||
// 当查看当前用户的关注时,请求关注分组
|
// 当查看当前用户的关注时,请求关注分组
|
||||||
Future followUpTags() async {
|
Future followUpTags() async {
|
||||||
if (userInfo != null && mid == userInfo.mid) {
|
if (userInfo != null && mid == userInfo!.mid) {
|
||||||
var res = await MemberHttp.followUpTags();
|
var res = await MemberHttp.followUpTags();
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
followTags = res['data'];
|
followTags = res['data'];
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter/material.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/tab_type.dart';
|
import 'package:pilipala/models/common/tab_type.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import '../../http/index.dart';
|
import '../../http/index.dart';
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
Box settingStorage = GStorage.setting;
|
Box settingStorage = GStorage.setting;
|
||||||
RxBool userLogin = false.obs;
|
RxBool userLogin = false.obs;
|
||||||
RxString userFace = ''.obs;
|
RxString userFace = ''.obs;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
Box setting = GStorage.setting;
|
Box setting = GStorage.setting;
|
||||||
late final StreamController<bool> searchBarStream =
|
late final StreamController<bool> searchBarStream =
|
||||||
StreamController<bool>.broadcast();
|
StreamController<bool>.broadcast();
|
||||||
@ -33,7 +34,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
userLogin.value = userInfo != null;
|
userLogin.value = userInfo != null;
|
||||||
userFace.value = userInfo != null ? userInfo.face : '';
|
userFace.value = userInfo != null ? userInfo!.face! : '';
|
||||||
hideSearchBar =
|
hideSearchBar =
|
||||||
setting.get(SettingBoxKey.hideSearchBar, defaultValue: false);
|
setting.get(SettingBoxKey.hideSearchBar, defaultValue: false);
|
||||||
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
||||||
@ -62,7 +63,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
|||||||
userInfo = await userInfoCache.get('userInfoCache');
|
userInfo = await userInfoCache.get('userInfoCache');
|
||||||
userLogin.value = val ?? false;
|
userLogin.value = val ?? false;
|
||||||
if (val) return;
|
if (val) return;
|
||||||
userFace.value = userInfo != null ? userInfo.face : '';
|
userFace.value = userInfo != null ? userInfo!.face! : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTabConfig() async {
|
void setTabConfig() async {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter/material.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/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
@ -12,7 +13,7 @@ class HomeAppBar extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var userInfo = userInfoCache.get('userInfoCache');
|
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||||
return SliverAppBar(
|
return SliverAppBar(
|
||||||
// forceElevated: true,
|
// forceElevated: true,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/http/common.dart';
|
import 'package:pilipala/http/common.dart';
|
||||||
|
import 'package:pilipala/models/user/info.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 '../../models/common/dynamic_badge_mode.dart';
|
import '../../models/common/dynamic_badge_mode.dart';
|
||||||
@ -26,7 +27,7 @@ class MainController extends GetxController {
|
|||||||
late PageController pageController;
|
late PageController pageController;
|
||||||
int selectedIndex = 0;
|
int selectedIndex = 0;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
dynamic userInfo;
|
UserInfoData? userInfo;
|
||||||
RxBool userLogin = false.obs;
|
RxBool userLogin = false.obs;
|
||||||
late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
||||||
late bool enableGradientBg;
|
late bool enableGradientBg;
|
||||||
@ -85,7 +86,7 @@ class MainController extends GetxController {
|
|||||||
}
|
}
|
||||||
if (mineItemIndex != -1 && userInfo != null) {
|
if (mineItemIndex != -1 && userInfo != null) {
|
||||||
Widget avatar = NetworkImgLayer(
|
Widget avatar = NetworkImgLayer(
|
||||||
width: 28, height: 28, src: userInfo.face, type: 'avatar');
|
width: 28, height: 28, src: userInfo!.face, type: 'avatar');
|
||||||
navigationBars[mineItemIndex]['icon'] = avatar;
|
navigationBars[mineItemIndex]['icon'] = avatar;
|
||||||
navigationBars[mineItemIndex]['selectIcon'] = avatar;
|
navigationBars[mineItemIndex]['selectIcon'] = avatar;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import 'package:pilipala/models/member/archive.dart';
|
|||||||
import 'package:pilipala/models/member/coin.dart';
|
import 'package:pilipala/models/member/coin.dart';
|
||||||
import 'package:pilipala/models/member/info.dart';
|
import 'package:pilipala/models/member/info.dart';
|
||||||
import 'package:pilipala/models/member/like.dart';
|
import 'package:pilipala/models/member/like.dart';
|
||||||
|
import 'package:pilipala/models/user/info.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';
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ class MemberController extends GetxController {
|
|||||||
late int ownerMid;
|
late int ownerMid;
|
||||||
// 投稿列表
|
// 投稿列表
|
||||||
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
||||||
dynamic userInfo;
|
UserInfoData? userInfo;
|
||||||
RxInt attribute = (-1).obs;
|
RxInt attribute = (-1).obs;
|
||||||
RxString attributeText = '关注'.obs;
|
RxString attributeText = '关注'.obs;
|
||||||
RxList<MemberCoinsDataModel> recentCoinsList = <MemberCoinsDataModel>[].obs;
|
RxList<MemberCoinsDataModel> recentCoinsList = <MemberCoinsDataModel>[].obs;
|
||||||
@ -34,7 +35,7 @@ class MemberController extends GetxController {
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.tryParse(Get.parameters['mid']!) ?? -2;
|
mid = int.tryParse(Get.parameters['mid']!) ?? -2;
|
||||||
userInfo = userInfoCache.get('userInfoCache');
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
ownerMid = userInfo != null ? userInfo.mid : -1;
|
ownerMid = userInfo != null ? userInfo!.mid! : -1;
|
||||||
isOwner.value = mid == ownerMid;
|
isOwner.value = mid == ownerMid;
|
||||||
face.value = Get.arguments['face'] ?? '';
|
face.value = Get.arguments['face'] ?? '';
|
||||||
heroTag = Get.arguments['heroTag'] ?? '';
|
heroTag = Get.arguments['heroTag'] ?? '';
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:pilipala/http/member.dart';
|
import 'package:pilipala/http/member.dart';
|
||||||
import 'package:pilipala/models/member/seasons.dart';
|
import 'package:pilipala/models/member/seasons.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
|
|
||||||
class MemberSeasonsController extends GetxController {
|
class MemberSeasonsController extends GetxController {
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
@ -58,7 +59,7 @@ class MemberSeasonsController extends GetxController {
|
|||||||
mid: mid,
|
mid: mid,
|
||||||
seriesId: seriesId!,
|
seriesId: seriesId!,
|
||||||
pn: pn,
|
pn: pn,
|
||||||
currentMid: 17340771,
|
currentMid: GlobalDataCache.userInfo?.mid ?? -1,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
seasonsList.addAll(res['data'].seriesList);
|
seasonsList.addAll(res['data'].seriesList);
|
||||||
|
|||||||
@ -2,6 +2,8 @@ import 'package:easy_debounce/easy_throttle.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/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
|
import 'package:pilipala/common/skeleton/video_card_h.dart';
|
||||||
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
import 'controller.dart';
|
import 'controller.dart';
|
||||||
import 'widgets/item.dart';
|
import 'widgets/item.dart';
|
||||||
|
|
||||||
@ -54,9 +56,9 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
|||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if (snapshot.data != null) {
|
if (snapshot.data != null) {
|
||||||
Map data = snapshot.data as Map;
|
Map? data = snapshot.data;
|
||||||
List list = _memberSeasonsController.seasonsList;
|
List list = _memberSeasonsController.seasonsList;
|
||||||
if (data['status']) {
|
if (data?['status']) {
|
||||||
return Obx(
|
return Obx(
|
||||||
() => list.isNotEmpty
|
() => list.isNotEmpty
|
||||||
? LayoutBuilder(
|
? LayoutBuilder(
|
||||||
@ -82,16 +84,44 @@ class _MemberSeasonsPageState extends State<MemberSeasonsPage> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const HttpError(
|
||||||
|
errMsg: '没有数据',
|
||||||
|
isInSliver: false,
|
||||||
|
isShowBtn: false,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox();
|
return HttpError(
|
||||||
|
errMsg: snapshot.data['msg'],
|
||||||
|
isInSliver: false,
|
||||||
|
fn: () {
|
||||||
|
setState(() {
|
||||||
|
_futureBuilderFuture =
|
||||||
|
_memberSeasonsController.onRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox();
|
return HttpError(
|
||||||
|
errMsg: snapshot.data['msg'] ?? '请求异常',
|
||||||
|
isInSliver: false,
|
||||||
|
fn: () {
|
||||||
|
setState(() {
|
||||||
|
_futureBuilderFuture =
|
||||||
|
_memberSeasonsController.onRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox();
|
return ListView.builder(
|
||||||
|
itemCount: 10,
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return const VideoCardHSkeleton();
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -3,6 +3,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/http/user.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class MineEditController extends GetxController {
|
class MineEditController extends GetxController {
|
||||||
@ -13,7 +14,7 @@ class MineEditController extends GetxController {
|
|||||||
final TextEditingController signCtr = TextEditingController();
|
final TextEditingController signCtr = TextEditingController();
|
||||||
final TextEditingController birthdayCtr = TextEditingController();
|
final TextEditingController birthdayCtr = TextEditingController();
|
||||||
String? sex;
|
String? sex;
|
||||||
dynamic userInfo;
|
UserInfoData? userInfo;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
|||||||
@ -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,8 +2,8 @@ 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/http/init.dart';
|
|
||||||
import 'package:pilipala/models/common/theme_type.dart';
|
import 'package:pilipala/models/common/theme_type.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
import 'package:pilipala/utils/login.dart';
|
import 'package:pilipala/utils/login.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
@ -22,7 +22,7 @@ class SettingController extends GetxController {
|
|||||||
RxDouble toastOpacity = (1.0).obs;
|
RxDouble toastOpacity = (1.0).obs;
|
||||||
RxInt picQuality = 10.obs;
|
RxInt picQuality = 10.obs;
|
||||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
||||||
RxInt defaultHomePage = 0.obs;
|
RxInt defaultHomePage = 0.obs;
|
||||||
|
|
||||||
|
|||||||
@ -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('设置成功');
|
||||||
|
|||||||
@ -155,7 +155,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: '港澳台模式',
|
||||||
|
|||||||
@ -3,6 +3,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/http/member.dart';
|
import 'package:pilipala/http/member.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class PrivacySetting extends StatefulWidget {
|
class PrivacySetting extends StatefulWidget {
|
||||||
@ -15,7 +16,7 @@ class PrivacySetting extends StatefulWidget {
|
|||||||
class _PrivacySettingState extends State<PrivacySetting> {
|
class _PrivacySettingState extends State<PrivacySetting> {
|
||||||
bool userLogin = false;
|
bool userLogin = false;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/member.dart';
|
import 'package:pilipala/http/member.dart';
|
||||||
import 'package:pilipala/models/common/rcmd_type.dart';
|
import 'package:pilipala/models/common/rcmd_type.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
||||||
import 'package:pilipala/utils/recommend_filter.dart';
|
import 'package:pilipala/utils/recommend_filter.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
@ -21,7 +22,7 @@ class _RecommendSettingState extends State<RecommendSetting> {
|
|||||||
static Box localCache = GStorage.localCache;
|
static Box localCache = GStorage.localCache;
|
||||||
late dynamic defaultRcmdType;
|
late dynamic defaultRcmdType;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
Box userInfoCache = GStorage.userInfo;
|
||||||
late dynamic userInfo;
|
UserInfoData? userInfo;
|
||||||
bool userLogin = false;
|
bool userLogin = false;
|
||||||
late dynamic accessKeyInfo;
|
late dynamic accessKeyInfo;
|
||||||
// late int filterUnfollowedRatio;
|
// late int filterUnfollowedRatio;
|
||||||
|
|||||||
@ -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('确定'),
|
||||||
|
|||||||
@ -14,12 +14,14 @@ import 'package:pilipala/models/common/reply_type.dart';
|
|||||||
import 'package:pilipala/models/common/search_type.dart';
|
import 'package:pilipala/models/common/search_type.dart';
|
||||||
import 'package:pilipala/models/sponsor_block/segment.dart';
|
import 'package:pilipala/models/sponsor_block/segment.dart';
|
||||||
import 'package:pilipala/models/sponsor_block/segment_type.dart';
|
import 'package:pilipala/models/sponsor_block/segment_type.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/models/video/later.dart';
|
import 'package:pilipala/models/video/later.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';
|
||||||
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';
|
||||||
@ -94,7 +96,7 @@ class VideoDetailController extends GetxController
|
|||||||
double? brightness;
|
double? brightness;
|
||||||
// 默认记录历史记录
|
// 默认记录历史记录
|
||||||
bool enableHeart = true;
|
bool enableHeart = true;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
late bool isFirstTime = true;
|
late bool isFirstTime = true;
|
||||||
Floating? floating;
|
Floating? floating;
|
||||||
late PreferredSizeWidget headerControl;
|
late PreferredSizeWidget headerControl;
|
||||||
@ -125,6 +127,8 @@ class VideoDetailController extends GetxController
|
|||||||
RxInt watchLaterCount = 0.obs;
|
RxInt watchLaterCount = 0.obs;
|
||||||
List<SegmentDataModel> skipSegments = <SegmentDataModel>[];
|
List<SegmentDataModel> skipSegments = <SegmentDataModel>[];
|
||||||
int? lastPosition;
|
int? lastPosition;
|
||||||
|
// 默认屏幕方向
|
||||||
|
RxString videoDirection = 'horizontal'.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -137,8 +141,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);
|
||||||
@ -195,7 +207,7 @@ class VideoDetailController extends GetxController
|
|||||||
});
|
});
|
||||||
|
|
||||||
/// 仅投稿视频skip
|
/// 仅投稿视频skip
|
||||||
if (videoType == SearchType.video) {
|
if (videoType == SearchType.video && GlobalDataCache.enableSponsorBlock) {
|
||||||
querySkipSegments();
|
querySkipSegments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -283,6 +295,10 @@ class VideoDetailController extends GetxController
|
|||||||
} else {
|
} else {
|
||||||
ScreenBrightness().resetScreenBrightness();
|
ScreenBrightness().resetScreenBrightness();
|
||||||
}
|
}
|
||||||
|
videoDirection.value = (firstVideo.width != null &&
|
||||||
|
firstVideo.height != null)
|
||||||
|
? (firstVideo.width! > firstVideo.height! ? 'horizontal' : 'vertical')
|
||||||
|
: 'horizontal';
|
||||||
await plPlayerController.setDataSource(
|
await plPlayerController.setDataSource(
|
||||||
DataSource(
|
DataSource(
|
||||||
videoSource: video ?? videoUrl,
|
videoSource: video ?? videoUrl,
|
||||||
@ -299,11 +315,7 @@ class VideoDetailController extends GetxController
|
|||||||
seekTo: seekToTime ?? defaultST,
|
seekTo: seekToTime ?? defaultST,
|
||||||
duration: duration ?? Duration(milliseconds: data.timeLength ?? 0),
|
duration: duration ?? Duration(milliseconds: data.timeLength ?? 0),
|
||||||
// 宽>高 水平 否则 垂直
|
// 宽>高 水平 否则 垂直
|
||||||
direction: firstVideo.width != null && firstVideo.height != null
|
direction: videoDirection.value,
|
||||||
? ((firstVideo.width! - firstVideo.height!) > 0
|
|
||||||
? 'horizontal'
|
|
||||||
: 'vertical')
|
|
||||||
: null,
|
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
cid: cid.value,
|
cid: cid.value,
|
||||||
enableHeart: enableHeart,
|
enableHeart: enableHeart,
|
||||||
@ -477,6 +489,15 @@ class VideoDetailController extends GetxController
|
|||||||
getDanmaku(subtitles);
|
getDanmaku(subtitles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
headerControl = HeaderControl(
|
||||||
|
controller: plPlayerController,
|
||||||
|
videoDetailCtr: this,
|
||||||
|
floating: floating,
|
||||||
|
bvid: bvid,
|
||||||
|
videoType: videoType,
|
||||||
|
showSubtitleBtn: result['status'] && result['data'].subtitles.isNotEmpty,
|
||||||
|
);
|
||||||
|
plPlayerController.setHeaderControl(headerControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取弹幕
|
// 获取弹幕
|
||||||
@ -615,7 +636,7 @@ class VideoDetailController extends GetxController
|
|||||||
var count = argMap['count'];
|
var count = argMap['count'];
|
||||||
var res = await UserHttp.getMediaList(
|
var res = await UserHttp.getMediaList(
|
||||||
type: 2,
|
type: 2,
|
||||||
bizId: userInfo.mid,
|
bizId: userInfo!.mid!,
|
||||||
ps: count,
|
ps: count,
|
||||||
);
|
);
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import 'package:pilipala/http/constants.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_folder.dart';
|
import 'package:pilipala/models/user/fav_folder.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/models/video/ai.dart';
|
import 'package:pilipala/models/video/ai.dart';
|
||||||
import 'package:pilipala/models/video/tags.dart';
|
import 'package:pilipala/models/video/tags.dart';
|
||||||
import 'package:pilipala/models/video_detail_res.dart';
|
import 'package:pilipala/models/video_detail_res.dart';
|
||||||
@ -16,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';
|
||||||
@ -49,10 +51,8 @@ class VideoIntroController extends GetxController {
|
|||||||
List delMediaIdsNew = [];
|
List delMediaIdsNew = [];
|
||||||
// 关注状态 默认未关注
|
// 关注状态 默认未关注
|
||||||
RxMap followStatus = {}.obs;
|
RxMap followStatus = {}.obs;
|
||||||
int _tempThemeValue = -1;
|
|
||||||
|
|
||||||
RxInt lastPlayCid = 0.obs;
|
RxInt lastPlayCid = 0.obs;
|
||||||
var userInfo;
|
UserInfoData? userInfo;
|
||||||
RxList<VideoTagItem> videoTags = <VideoTagItem>[].obs;
|
RxList<VideoTagItem> videoTags = <VideoTagItem>[].obs;
|
||||||
|
|
||||||
// 同时观看
|
// 同时观看
|
||||||
@ -100,7 +100,11 @@ class VideoIntroController extends GetxController {
|
|||||||
}
|
}
|
||||||
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();
|
||||||
@ -301,7 +305,7 @@ class VideoIntroController extends GetxController {
|
|||||||
|
|
||||||
Future queryVideoInFolder() async {
|
Future queryVideoInFolder() async {
|
||||||
var result = await VideoHttp.videoInFolder(
|
var result = await VideoHttp.videoInFolder(
|
||||||
mid: userInfo.mid, rid: IdUtils.bv2av(bvid));
|
mid: userInfo!.mid!, rid: IdUtils.bv2av(bvid));
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
favFolderData.value = result['data'];
|
favFolderData.value = result['data'];
|
||||||
}
|
}
|
||||||
@ -470,10 +474,12 @@ 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);
|
await queryVideoIntro(cover: cover);
|
||||||
|
|||||||
@ -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';
|
||||||
@ -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(
|
||||||
|
|||||||
@ -52,7 +52,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 +415,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,
|
||||||
|
|||||||
@ -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';
|
||||||
|
|
||||||
@ -123,14 +124,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
// 流
|
// 流
|
||||||
appbarStreamListen() {
|
appbarStreamListen() {
|
||||||
appbarStream = StreamController<double>.broadcast();
|
appbarStream = StreamController<double>.broadcast();
|
||||||
_extendNestCtr.addListener(
|
_extendNestCtr.addListener(_extendNestCtrListener);
|
||||||
() {
|
|
||||||
final double offset = _extendNestCtr.position.pixels;
|
|
||||||
vdCtr.sheetHeight.value =
|
|
||||||
Get.size.height - videoHeight - statusBarHeight + offset;
|
|
||||||
appbarStream.add(offset);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 播放器状态监听
|
// 播放器状态监听
|
||||||
@ -225,6 +219,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
statusHeight = await StatusBarControl.getHeight;
|
statusHeight = await StatusBarControl.getHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _extendNestCtr监听
|
||||||
|
void _extendNestCtrListener() {
|
||||||
|
final double offset = _extendNestCtr.position.pixels;
|
||||||
|
if (vdCtr.videoDirection.value == 'horizontal') {
|
||||||
|
vdCtr.sheetHeight.value =
|
||||||
|
Get.size.height - videoHeight - statusBarHeight + offset;
|
||||||
|
appbarStream.add(offset);
|
||||||
|
} else {
|
||||||
|
if (offset > (Get.size.width * 22 / 16 - videoHeight)) {
|
||||||
|
appbarStream.add(offset - (Get.size.width * 22 / 16 - videoHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
shutdownTimerService.handleWaitingFinished();
|
shutdownTimerService.handleWaitingFinished();
|
||||||
@ -243,6 +251,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
appbarStream.close();
|
appbarStream.close();
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
_lifecycleListener.dispose();
|
_lifecycleListener.dispose();
|
||||||
|
_extendNestCtr.removeListener(_extendNestCtrListener);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,11 +503,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final sizeContext = MediaQuery.sizeOf(context);
|
final sizeContext = MediaQuery.sizeOf(context);
|
||||||
final _context = MediaQuery.of(context);
|
final _context = MediaQuery.of(context);
|
||||||
late double defaultVideoHeight = sizeContext.width * 9 / 16;
|
late final double verticalHeight = sizeContext.width * 22 / 16;
|
||||||
|
late double defaultVideoHeight = vdCtr.videoDirection.value == 'vertical'
|
||||||
|
? verticalHeight
|
||||||
|
: sizeContext.width * 9 / 16;
|
||||||
late RxDouble videoHeight = defaultVideoHeight.obs;
|
late RxDouble videoHeight = defaultVideoHeight.obs;
|
||||||
final double pinnedHeaderHeight =
|
final double pinnedHeaderHeight =
|
||||||
statusBarHeight + kToolbarHeight + videoHeight.value;
|
statusBarHeight + kToolbarHeight + videoHeight.value;
|
||||||
// ignore: no_leading_underscores_for_local_identifiers
|
vdCtr.videoDirection.listen((p0) {
|
||||||
|
if (p0 == 'vertical') {
|
||||||
|
videoHeight.value = defaultVideoHeight = verticalHeight;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 竖屏
|
// 竖屏
|
||||||
final bool isPortrait = _context.orientation == Orientation.portrait;
|
final bool isPortrait = _context.orientation == Orientation.portrait;
|
||||||
@ -541,10 +557,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
showEposideCb: () => vdCtr.videoType == SearchType.video
|
showEposideCb: () => vdCtr.videoType == SearchType.video
|
||||||
? videoIntroController.showEposideHandler()
|
? videoIntroController.showEposideHandler()
|
||||||
: bangumiIntroController.showEposideHandler(),
|
: bangumiIntroController.showEposideHandler(),
|
||||||
fullScreenCb: (bool status) {
|
|
||||||
videoHeight.value =
|
|
||||||
status ? Get.size.height : defaultVideoHeight;
|
|
||||||
},
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,6 +606,28 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildAppBar(BuildContext context, AsyncSnapshot<num> snapshot) {
|
||||||
|
final double distance =
|
||||||
|
statusBarHeight + MediaQuery.of(context).padding.top;
|
||||||
|
return AppBar(
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
systemOverlayStyle: Platform.isAndroid
|
||||||
|
? SystemUiOverlayStyle(
|
||||||
|
statusBarIconBrightness:
|
||||||
|
Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Brightness.light
|
||||||
|
: (snapshot.data! > distance
|
||||||
|
? Brightness.dark
|
||||||
|
: Brightness.light),
|
||||||
|
)
|
||||||
|
: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? SystemUiOverlayStyle.light
|
||||||
|
: (snapshot.data! > distance
|
||||||
|
? SystemUiOverlayStyle.dark
|
||||||
|
: SystemUiOverlayStyle.light),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget childWhenDisabled = SafeArea(
|
Widget childWhenDisabled = SafeArea(
|
||||||
top: MediaQuery.of(context).orientation == Orientation.portrait &&
|
top: MediaQuery.of(context).orientation == Orientation.portrait &&
|
||||||
plPlayerController?.isFullScreen.value == true,
|
plPlayerController?.isFullScreen.value == true,
|
||||||
@ -611,11 +645,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
child: StreamBuilder(
|
child: StreamBuilder(
|
||||||
stream: appbarStream.stream.distinct(),
|
stream: appbarStream.stream.distinct(),
|
||||||
initialData: 0,
|
initialData: 0,
|
||||||
builder: ((context, snapshot) {
|
builder: buildAppBar,
|
||||||
return AppBar(
|
|
||||||
backgroundColor: Colors.black,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: ExtendedNestedScrollView(
|
body: ExtendedNestedScrollView(
|
||||||
@ -750,13 +780,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,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -773,7 +810,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
builder: ((context, snapshot) {
|
builder: ((context, snapshot) {
|
||||||
return ScrollAppBar(
|
return ScrollAppBar(
|
||||||
snapshot.data!.toDouble(),
|
snapshot.data!.toDouble(),
|
||||||
() => continuePlay(),
|
continuePlay,
|
||||||
playerStatus.value,
|
playerStatus.value,
|
||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
@ -880,6 +917,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),
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class AiDetail extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.only(left: 16, right: 16),
|
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||||
height: GlobalDataCache().sheetHeight,
|
height: GlobalDataCache.sheetHeight,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(context),
|
_buildHeader(context),
|
||||||
|
|||||||
@ -34,21 +34,16 @@ class ScrollAppBar extends StatelessWidget {
|
|||||||
child: AppBar(
|
child: AppBar(
|
||||||
primary: false,
|
primary: false,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: TextButton(
|
title: TextButton.icon(
|
||||||
onPressed: () => callback(),
|
onPressed: () => callback(),
|
||||||
child: Row(
|
label: Text(
|
||||||
mainAxisSize: MainAxisSize.min,
|
playerStatus == PlayerStatus.paused
|
||||||
children: [
|
? '继续播放'
|
||||||
const Icon(Icons.play_arrow_rounded),
|
: playerStatus == PlayerStatus.completed
|
||||||
Text(
|
? '重新播放'
|
||||||
playerStatus == PlayerStatus.paused
|
: '播放中',
|
||||||
? '继续播放'
|
|
||||||
: playerStatus == PlayerStatus.completed
|
|
||||||
? '重新播放'
|
|
||||||
: '播放中',
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
icon: const Icon(Icons.play_arrow_rounded),
|
||||||
),
|
),
|
||||||
// actions: [
|
// actions: [
|
||||||
// IconButton(
|
// IconButton(
|
||||||
|
|||||||
@ -16,6 +16,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 +31,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 +39,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();
|
||||||
@ -1237,22 +1238,24 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
// ),
|
// ),
|
||||||
// fuc: () => _.screenshot(),
|
// fuc: () => _.screenshot(),
|
||||||
// ),
|
// ),
|
||||||
ComBtn(
|
if (GlobalDataCache.enableDlna) ...[
|
||||||
icon: const Icon(
|
ComBtn(
|
||||||
Icons.cast,
|
icon: const Icon(
|
||||||
size: 19,
|
Icons.cast,
|
||||||
color: Colors.white,
|
size: 19,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
fuc: () async {
|
||||||
|
showDialog<void>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return LiveDlnaPage(
|
||||||
|
datasource: widget.videoDetailCtr!.videoUrl);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
fuc: () async {
|
],
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return LiveDlnaPage(
|
|
||||||
datasource: widget.videoDetailCtr!.videoUrl);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (isFullScreen.value) ...[
|
if (isFullScreen.value) ...[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 56,
|
width: 56,
|
||||||
@ -1326,7 +1329,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
],
|
],
|
||||||
|
|
||||||
/// 字幕
|
/// 字幕
|
||||||
if (widget.showSubtitleBtn ?? true)
|
if (widget.showSubtitleBtn)
|
||||||
ComBtn(
|
ComBtn(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.closed_caption_off,
|
Icons.closed_caption_off,
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/msg.dart';
|
import 'package:pilipala/http/msg.dart';
|
||||||
import 'package:pilipala/models/msg/session.dart';
|
import 'package:pilipala/models/msg/session.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/pages/whisper/index.dart';
|
import 'package:pilipala/pages/whisper/index.dart';
|
||||||
import '../../utils/feed_back.dart';
|
import '../../utils/feed_back.dart';
|
||||||
import '../../utils/storage.dart';
|
import '../../utils/storage.dart';
|
||||||
@ -80,7 +81,7 @@ class WhisperDetailController extends GetxController {
|
|||||||
Future sendMsg() async {
|
Future sendMsg() async {
|
||||||
feedBack();
|
feedBack();
|
||||||
String message = replyContentController.text;
|
String message = replyContentController.text;
|
||||||
final userInfo = userInfoCache.get('userInfoCache');
|
final UserInfoData? userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo == null) {
|
if (userInfo == null) {
|
||||||
SmartDialog.showToast('请先登录');
|
SmartDialog.showToast('请先登录');
|
||||||
return;
|
return;
|
||||||
@ -90,7 +91,7 @@ class WhisperDetailController extends GetxController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var result = await MsgHttp.sendMsg(
|
var result = await MsgHttp.sendMsg(
|
||||||
senderUid: userInfo.mid,
|
senderUid: userInfo.mid!,
|
||||||
receiverId: int.parse(mid),
|
receiverId: int.parse(mid),
|
||||||
content: {'content': message},
|
content: {'content': message},
|
||||||
msgType: 1,
|
msgType: 1,
|
||||||
|
|||||||
@ -2,14 +2,12 @@ import 'dart:async';
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'package:pilipala/models/video/reply/emote.dart';
|
import 'package:pilipala/models/video/reply/emote.dart';
|
||||||
import 'package:pilipala/pages/emote/index.dart';
|
import 'package:pilipala/pages/emote/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply_new/toolbar_icon_button.dart';
|
import 'package:pilipala/pages/video/detail/reply_new/toolbar_icon_button.dart';
|
||||||
import 'package:pilipala/pages/whisper_detail/controller.dart';
|
import 'package:pilipala/pages/whisper_detail/controller.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
import '../../utils/storage.dart';
|
|
||||||
import 'widget/chat_item.dart';
|
import 'widget/chat_item.dart';
|
||||||
|
|
||||||
class WhisperDetailPage extends StatefulWidget {
|
class WhisperDetailPage extends StatefulWidget {
|
||||||
@ -30,7 +28,6 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
|||||||
late double emoteHeight = 230.0;
|
late double emoteHeight = 230.0;
|
||||||
double keyboardHeight = 0.0; // 键盘高度
|
double keyboardHeight = 0.0; // 键盘高度
|
||||||
RxString toolbarType = ''.obs;
|
RxString toolbarType = ''.obs;
|
||||||
Box userInfoCache = GStorage.userInfo;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|||||||
@ -278,19 +278,18 @@ class PlPlayerController {
|
|||||||
|
|
||||||
// 添加一个私有构造函数
|
// 添加一个私有构造函数
|
||||||
PlPlayerController._internal(this.videoType) {
|
PlPlayerController._internal(this.videoType) {
|
||||||
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();
|
||||||
@ -929,6 +928,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 +1051,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);
|
||||||
|
|||||||
@ -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),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -5,54 +5,60 @@ 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;
|
||||||
|
// sponsorBlock开关
|
||||||
|
static bool enableSponsorBlock = false;
|
||||||
|
// 视频评论开关
|
||||||
|
static List<String> enableComment = ['video', 'bangumi'];
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalDataCache._();
|
GlobalDataCache._();
|
||||||
@ -64,19 +70,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 +103,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 +121,17 @@ 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);
|
||||||
|
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,10 @@ class SettingBoxKey {
|
|||||||
enableAi = 'enableAi',
|
enableAi = 'enableAi',
|
||||||
enableAutoExpand = 'enableAutoExpand',
|
enableAutoExpand = 'enableAutoExpand',
|
||||||
defaultHomePage = 'defaultHomePage',
|
defaultHomePage = 'defaultHomePage',
|
||||||
enableRelatedVideo = 'enableRelatedVideo';
|
enableRelatedVideo = 'enableRelatedVideo',
|
||||||
|
enableDlna = 'enableDlna',
|
||||||
|
enableSponsorBlock = 'enableSponsorBlock',
|
||||||
|
enableComment = 'enableComment';
|
||||||
|
|
||||||
/// 外观
|
/// 外观
|
||||||
static const String themeMode = 'themeMode',
|
static const String themeMode = 'themeMode',
|
||||||
|
|||||||
Reference in New Issue
Block a user