This commit is contained in:
orz12
2024-06-17 01:26:52 +08:00
parent ff3484e4b5
commit 45aaa3d075
95 changed files with 282 additions and 282 deletions

View File

@@ -59,9 +59,9 @@ class VideoDetailController extends GetxController
RxString hwdec = 'auto-safe'.obs;
/// 本地存储
Box userInfoCache = GStrorage.userInfo;
Box localCache = GStrorage.localCache;
Box setting = GStrorage.setting;
Box userInfoCache = GStorage.userInfo;
Box localCache = GStorage.localCache;
Box setting = GStorage.setting;
RxInt oid = 0.obs;
// 评论id 请求楼中楼评论使用

View File

@@ -51,7 +51,7 @@ class VideoIntroController extends GetxController {
RxBool hasCoin = false.obs;
// 是否收藏
RxBool hasFav = false.obs;
Box userInfoCache = GStrorage.userInfo;
Box userInfoCache = GStorage.userInfo;
bool userLogin = false;
Rx<FavFolderData> favFolderData = FavFolderData().obs;
List addMediaIdsNew = [];
@@ -461,15 +461,15 @@ class VideoIntroController extends GetxController {
// 重新获取视频资源
final VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: heroTag);
final ReleatedController releatedCtr =
Get.find<ReleatedController>(tag: heroTag);
final RelatedController relatedCtr =
Get.find<RelatedController>(tag: heroTag);
videoDetailCtr.bvid = bvid;
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
videoDetailCtr.cid.value = cid;
videoDetailCtr.danmakuCid.value = cid;
videoDetailCtr.queryVideoUrl();
releatedCtr.bvid = bvid;
releatedCtr.queryRelatedVideo();
relatedCtr.bvid = bvid;
relatedCtr.queryRelatedVideo();
// 重新请求评论
try {
/// 未渲染回复组件时可能异常

View File

@@ -128,7 +128,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
late final VideoDetailController videoDetailCtr;
late final Map<dynamic, dynamic> videoItem;
final Box<dynamic> setting = GStrorage.setting;
final Box<dynamic> setting = GStorage.setting;
late final bool loadingStatus; // 加载状态

View File

@@ -118,7 +118,7 @@ class IntroDetail extends StatelessWidget {
// type
// 1 普通文本
// 2 @用户
final List<TextSpan> spanChilds = List.generate(descV2.length, (index) {
final List<TextSpan> spanChildren = List.generate(descV2.length, (index) {
final currentDesc = descV2[index];
switch (currentDesc.type) {
case 1:
@@ -186,6 +186,6 @@ class IntroDetail extends StatelessWidget {
return const TextSpan();
}
});
return TextSpan(children: spanChilds);
return TextSpan(children: spanChildren);
}
}

View File

@@ -3,7 +3,7 @@ import 'package:get/get.dart';
import 'package:PiliPalaX/http/video.dart';
import '../../../../models/model_hot_video_item.dart';
class ReleatedController extends GetxController {
class RelatedController extends GetxController {
// 视频aid
String bvid = Get.parameters['bvid'] ?? "";
// 推荐视频列表

View File

@@ -18,7 +18,7 @@ class RelatedVideoPanel extends StatefulWidget {
class _RelatedVideoPanelState extends State<RelatedVideoPanel>
with AutomaticKeepAliveClientMixin {
late ReleatedController _releatedController;
late RelatedController _relatedController;
late Future _futureBuilder;
@override
@@ -27,8 +27,8 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
@override
void initState() {
super.initState();
_releatedController = Get.put(ReleatedController(), tag: widget.heroTag);
_futureBuilder = _releatedController.queryRelatedVideo();
_relatedController = Get.put(RelatedController(), tag: widget.heroTag);
_futureBuilder = _relatedController.queryRelatedVideo();
}
@override
@@ -44,7 +44,7 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
return const SliverToBoxAdapter(child: SizedBox());
}
if (snapshot.data!['status'] && snapshot.hasData) {
RxList relatedVideoList = _releatedController.relatedVideoList;
RxList relatedVideoList = _relatedController.relatedVideoList;
// 请求成功
return Obx(
() => SliverGrid(
@@ -65,17 +65,17 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
showPubdate: true,
longPress: () {
try {
_releatedController.popupDialog =
_createPopupDialog(_releatedController
_relatedController.popupDialog =
_createPopupDialog(_relatedController
.relatedVideoList[index]);
Overlay.of(context)
.insert(_releatedController.popupDialog!);
.insert(_relatedController.popupDialog!);
} catch (err) {
return {};
}
},
longPressEnd: () {
_releatedController.popupDialog?.remove();
_relatedController.popupDialog?.remove();
},
),
);
@@ -108,10 +108,10 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
OverlayEntry _createPopupDialog(videoItem) {
return OverlayEntry(
builder: (BuildContext context) => AnimatedDialog(
closeFn: _releatedController.popupDialog?.remove,
closeFn: _relatedController.popupDialog?.remove,
child: OverlayPop(
videoItem: videoItem,
closeFn: _releatedController.popupDialog?.remove),
closeFn: _relatedController.popupDialog?.remove),
),
);
}

View File

@@ -36,7 +36,7 @@ class VideoReplyController extends GetxController {
RxString sortTypeTitle = ReplySortType.time.titles.obs;
RxString sortTypeLabel = ReplySortType.time.labels.obs;
Box setting = GStrorage.setting;
Box setting = GStorage.setting;
@override
void onInit() {

View File

@@ -20,7 +20,7 @@ import 'package:PiliPalaX/utils/utils.dart';
import '../../../../../utils/app_scheme.dart';
import 'zan.dart';
Box setting = GStrorage.setting;
Box setting = GStorage.setting;
class ReplyItem extends StatelessWidget {
const ReplyItem({
@@ -268,7 +268,7 @@ class ReplyItem extends StatelessWidget {
)),
),
// 操作区域
bottonAction(context, replyItem!.replyControl),
buttonAction(context, replyItem!.replyControl),
// 一楼的评论
if ((replyItem!.replyControl!.isShow! ||
replyItem!.replies!.isNotEmpty) &&
@@ -289,7 +289,7 @@ class ReplyItem extends StatelessWidget {
}
// 感谢、回复、复制
Widget bottonAction(BuildContext context, replyControl) {
Widget buttonAction(BuildContext context, replyControl) {
return Row(
children: <Widget>[
const SizedBox(width: 32),
@@ -528,14 +528,14 @@ InlineSpan buildContent(
// replyReply 查看二楼回复(回复详情)回调
// fReplyItem 父级回复内容,用作二楼回复(回复详情)展示
final content = replyItem.content;
final List<InlineSpan> spanChilds = <InlineSpan>[];
final List<InlineSpan> spanChildren = <InlineSpan>[];
// 投票
if (content.vote.isNotEmpty) {
content.message.splitMapJoin(RegExp(r"\{vote:.*?\}"),
onMatch: (Match match) {
// String matchStr = match[0]!;
spanChilds.add(
spanChildren.add(
TextSpan(
text: '投票: ${content.vote['title']}',
style: TextStyle(
@@ -587,7 +587,7 @@ InlineSpan buildContent(
final RegExp pattern = RegExp(patternStr);
List<String> matchedStrs = [];
void addPlainTextSpan(str) {
spanChilds.add(TextSpan(
spanChildren.add(TextSpan(
text: str,
));
// TextSpan(
@@ -606,7 +606,7 @@ InlineSpan buildContent(
if (content.emote.containsKey(matchStr)) {
// 处理表情
final int size = content.emote[matchStr]['meta']['size'];
spanChilds.add(WidgetSpan(
spanChildren.add(WidgetSpan(
child: ExcludeSemantics(
child: NetworkImgLayer(
src: content.emote[matchStr]['url'],
@@ -621,7 +621,7 @@ InlineSpan buildContent(
// 处理@用户
final String userName = matchStr.substring(1);
final int userId = content.atNameToMid[userName];
spanChilds.add(
spanChildren.add(
TextSpan(
text: matchStr,
style: TextStyle(
@@ -640,7 +640,7 @@ InlineSpan buildContent(
} else if (RegExp(r'^\b(?:\d+[:])?[0-5]?[0-9][:][0-5]?[0-9]\b$')
.hasMatch(matchStr)) {
matchStr = matchStr.replaceAll('', ':');
spanChilds.add(
spanChildren.add(
TextSpan(
text: ' $matchStr ',
style: isVideoPage
@@ -677,7 +677,7 @@ InlineSpan buildContent(
addPlainTextSpan(matchStr);
return "";
}
spanChilds.addAll(
spanChildren.addAll(
[
if (content.jumpUrl[matchStr]?['prefix_icon'] != null) ...[
WidgetSpan(
@@ -721,7 +721,7 @@ InlineSpan buildContent(
source: '',
dataString: redirectUrl,
);
PiliSchame.routePush(scheme);
PiliScheme.routePush(scheme);
// final String pathSegment = Uri.parse(redirectUrl).path;
// final String lastPathSegment =
// pathSegment.split('/').last;
@@ -788,7 +788,7 @@ InlineSpan buildContent(
} else if (content
.topicsMeta[matchStr.substring(1, matchStr.length - 1)] !=
null) {
spanChilds.add(
spanChildren.add(
TextSpan(
text: matchStr,
style: TextStyle(
@@ -822,7 +822,7 @@ InlineSpan buildContent(
if (unmatchedItems.isNotEmpty) {
for (int i = 0; i < unmatchedItems.length; i++) {
String patternStr = unmatchedItems[i];
spanChilds.addAll(
spanChildren.addAll(
[
if (content.jumpUrl[patternStr]?['prefix_icon'] != null) ...[
WidgetSpan(
@@ -859,11 +859,11 @@ InlineSpan buildContent(
if (content.pictures.isNotEmpty) {
final List<String> picList = <String>[];
final int len = content.pictures.length;
spanChilds.add(const TextSpan(text: '\n'));
spanChildren.add(const TextSpan(text: '\n'));
if (len == 1) {
Map pictureItem = content.pictures.first;
picList.add(pictureItem['img_src']);
spanChilds.add(
spanChildren.add(
WidgetSpan(
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints box) {
@@ -948,7 +948,7 @@ InlineSpan buildContent(
),
);
}
spanChilds.add(
spanChildren.add(
WidgetSpan(
child: Semantics(
explicitChildNodes: true,
@@ -985,7 +985,7 @@ InlineSpan buildContent(
// 笔记链接
if (content.richText.isNotEmpty) {
spanChilds.add(
spanChildren.add(
TextSpan(
text: ' 笔记',
style: TextStyle(
@@ -1003,8 +1003,8 @@ InlineSpan buildContent(
),
);
}
// spanChilds.add(TextSpan(text: matchMember));
return TextSpan(children: spanChilds);
// spanChildren.add(TextSpan(text: matchMember));
return TextSpan(children: spanChildren);
}
class MorePanel extends StatelessWidget {
@@ -1111,7 +1111,7 @@ class MorePanel extends StatelessWidget {
),
),
// 已登录用户才显示删除
if (GStrorage.userInfo.get('userInfoCache') != null)
if (GStorage.userInfo.get('userInfoCache') != null)
ListTile(
onTap: () async => await menuActionHandler('delete'),
minLeadingWidth: 0,

View File

@@ -51,7 +51,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
// 自动聚焦
_autoFocus();
// 监听聚焦状态
_focuslistener();
_focusListener();
}
_autoFocus() async {
@@ -61,7 +61,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
}
}
_focuslistener() {
_focusListener() {
replyContentFocusNode.addListener(() {
if (replyContentFocusNode.hasFocus) {
setState(() {

View File

@@ -49,8 +49,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
PlayerStatus playerStatus = PlayerStatus.playing;
double doubleOffset = 0;
final Box<dynamic> localCache = GStrorage.localCache;
final Box<dynamic> setting = GStrorage.setting;
final Box<dynamic> localCache = GStorage.localCache;
final Box<dynamic> setting = GStorage.setting;
late Future _futureBuilderFuture;
// 自动退出全屏
late bool autoExitFullscreen;
@@ -487,12 +487,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
children: [
Obx(
() {
double videoheight = context.width * 9 / 16;
final double videowidth = context.width;
double videoHeight = context.width * 9 / 16;
final double videoWidth = context.width;
// print(videoDetailController.tabCtr.index);
if (enableVerticalExpand &&
plPlayerController?.direction.value == 'vertical') {
videoheight = context.width;
videoHeight = context.width;
}
if (MediaQuery.of(context).orientation ==
Orientation.landscape &&
@@ -521,7 +521,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
removeSafeArea
? 0
: MediaQuery.of(context).padding.top)
: videoheight,
: videoHeight,
width: context.width,
child: PopScope(
canPop: isFullScreen.value != true &&
@@ -562,8 +562,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
type: 'emote',
src: videoDetailController
.videoItem['pic'],
width: videowidth,
height: videoheight,
width: videoWidth,
height: videoHeight,
),
),
),
@@ -653,16 +653,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Widget childWhenDisabledAlmostSquareInner = Obx(() {
if (enableVerticalExpand &&
plPlayerController?.direction.value == 'vertical') {
final double videoheight = context.height -
final double videoHeight = context.height -
(removeSafeArea
? 0
: (MediaQuery.of(context).padding.top +
MediaQuery.of(context).padding.bottom));
final double videowidth = videoheight * 9 / 16;
final double videoWidth = videoHeight * 9 / 16;
return Row(children: [
SizedBox(
height: videoheight,
width: isFullScreen.value == true ? context.width : videowidth,
height: videoHeight,
width: isFullScreen.value == true ? context.width : videoWidth,
child: PopScope(
canPop: isFullScreen.value != true,
onPopInvoked: (bool didPop) {
@@ -694,8 +694,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: NetworkImgLayer(
type: 'emote',
src: videoDetailController.videoItem['pic'],
width: videowidth,
height: videoheight,
width: videoWidth,
height: videoHeight,
),
),
),
@@ -745,19 +745,19 @@ class _VideoDetailPageState extends State<VideoDetailPage>
),
]);
}
final double videoheight = context.height / 2.5;
final double videowidth = context.width;
final double videoHeight = context.height / 2.5;
final double videoWidth = context.width;
return Column(
children: [
SizedBox(
width: videowidth,
width: videoWidth,
height: isFullScreen.value == true
? context.height -
(removeSafeArea
? 0
: (MediaQuery.of(context).padding.top +
MediaQuery.of(context).padding.bottom))
: videoheight,
: videoHeight,
child: PopScope(
canPop: isFullScreen.value != true,
onPopInvoked: (bool didPop) {
@@ -789,8 +789,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: NetworkImgLayer(
type: 'emote',
src: videoDetailController.videoItem['pic'],
width: videowidth,
height: videoheight,
width: videoWidth,
height: videoHeight,
),
),
),
@@ -833,14 +833,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Widget childWhenDisabledLandscapeInner = Obx(() {
if (enableVerticalExpand &&
plPlayerController?.direction.value == 'vertical') {
final double videoheight = context.height -
final double videoHeight = context.height -
(removeSafeArea ? 0 : MediaQuery.of(context).padding.top);
final double videowidth = videoheight * 9 / 16;
final double videoWidth = videoHeight * 9 / 16;
return Row(
children: [
SizedBox(
height: videoheight,
width: isFullScreen.value == true ? context.width : videowidth,
height: videoHeight,
width: isFullScreen.value == true ? context.width : videoWidth,
child: PopScope(
canPop: isFullScreen.value != true,
onPopInvoked: (bool didPop) {
@@ -873,8 +873,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: NetworkImgLayer(
type: 'emote',
src: videoDetailController.videoItem['pic'],
width: videowidth,
height: videoheight,
width: videoWidth,
height: videoHeight,
),
),
),
@@ -951,18 +951,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
],
);
}
final double videowidth =
final double videoWidth =
max(context.height / context.width * 1.04, 1 / 2) * context.width;
final double videoheight = videowidth * 9 / 16;
final double videoHeight = videoWidth * 9 / 16;
return Row(
children: [
Column(
children: [
SizedBox(
width:
isFullScreen.value == true ? context.width : videowidth,
isFullScreen.value == true ? context.width : videoWidth,
height:
isFullScreen.value == true ? context.height : videoheight,
isFullScreen.value == true ? context.height : videoHeight,
child: PopScope(
canPop: isFullScreen.value != true,
onPopInvoked: (bool didPop) {
@@ -998,8 +998,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
type: 'emote',
src: videoDetailController
.videoItem['pic'],
width: videowidth,
height: videoheight,
width: videoWidth,
height: videoHeight,
),
),
),
@@ -1011,11 +1011,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
))),
SizedBox(
width:
isFullScreen.value == true ? context.width : videowidth,
isFullScreen.value == true ? context.width : videoWidth,
height: isFullScreen.value == true
? 0
: context.height -
videoheight -
videoHeight -
(removeSafeArea
? 0
: MediaQuery.of(context).padding.top),
@@ -1041,7 +1041,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
width: isFullScreen.value == true
? 0
: (context.width -
videowidth -
videoWidth -
(removeSafeArea
? 0
: (MediaQuery.of(context).padding.left +

View File

@@ -160,7 +160,7 @@ class AiDetail extends StatelessWidget {
// type
// 1 普通文本
// 2 @用户
List<TextSpan> spanChilds = List.generate(descV2.length, (index) {
List<TextSpan> spanChildren = List.generate(descV2.length, (index) {
final currentDesc = descV2[index];
switch (currentDesc.type) {
case 1:
@@ -226,6 +226,6 @@ class AiDetail extends StatelessWidget {
return const TextSpan();
}
});
return TextSpan(children: spanChilds);
return TextSpan(children: spanChildren);
}
}

View File

@@ -49,8 +49,8 @@ class _HeaderControlState extends State<HeaderControl> {
static const TextStyle subTitleStyle = TextStyle(fontSize: 12);
static const TextStyle titleStyle = TextStyle(fontSize: 14);
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
final Box<dynamic> localCache = GStrorage.localCache;
final Box<dynamic> videoStorage = GStrorage.video;
final Box<dynamic> localCache = GStorage.localCache;
final Box<dynamic> videoStorage = GStorage.video;
double buttonSpace = 8;
bool isFullScreen = false;
late String heroTag;