mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-09 19:47:57 +08:00
@@ -182,69 +182,66 @@ class HistoryItem extends StatelessWidget {
|
||||
Positioned(
|
||||
right: 12,
|
||||
bottom: 0,
|
||||
child: SizedBox(
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: PopupMenuButton(
|
||||
padding: EdgeInsets.zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: theme.colorScheme.outline,
|
||||
size: 18,
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
itemBuilder: (_) => [
|
||||
if (item.authorMid != null &&
|
||||
item.authorName?.isNotEmpty == true)
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${item.authorMid}'),
|
||||
height: 38,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
MdiIcons.accountCircleOutline,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'访问:${item.authorName}',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (business != 'pgc' &&
|
||||
item.badge != '番剧' &&
|
||||
item.tagName?.contains('动画') != true &&
|
||||
business != 'live' &&
|
||||
business?.contains('article') != true)
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
UserHttp.toViewLater(bvid: item.history.bvid),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.watch_later_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('稍后再看', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: PopupMenuButton(
|
||||
padding: EdgeInsets.zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: theme.colorScheme.outline,
|
||||
size: 18,
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
itemBuilder: (_) => [
|
||||
if (item.authorMid != null &&
|
||||
item.authorName?.isNotEmpty == true)
|
||||
PopupMenuItem(
|
||||
onTap: () => onDelete(item.kid!, business!),
|
||||
onTap: () => Get.toNamed('/member?mid=${item.authorMid}'),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13)),
|
||||
const Icon(
|
||||
MdiIcons.accountCircleOutline,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'访问:${item.authorName}',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (business != 'pgc' &&
|
||||
item.badge != '番剧' &&
|
||||
item.tagName?.contains('动画') != true &&
|
||||
business != 'live' &&
|
||||
business?.contains('article') != true)
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
UserHttp.toViewLater(bvid: item.history.bvid),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.watch_later_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('稍后再看', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => onDelete(item.kid!, business!),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
import 'package:PiliPlus/common/widgets/flutter/text_field/controller.dart';
|
||||
@@ -308,41 +309,38 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
Positioned(
|
||||
left: padding.left + 25,
|
||||
bottom: 25,
|
||||
width: 255,
|
||||
child: Obx(() {
|
||||
final item = _liveRoomController.fsSC.value;
|
||||
if (item == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
try {
|
||||
return SizedBox(
|
||||
return Stack(
|
||||
key: ValueKey(item.id),
|
||||
width: 255,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 6, top: 6),
|
||||
child: SuperChatCard(
|
||||
item: item,
|
||||
onRemove: () => _liveRoomController.fsSC.value = null,
|
||||
onReport: () => _liveRoomController.reportSC(item),
|
||||
),
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 6, top: 6),
|
||||
child: SuperChatCard(
|
||||
item: item,
|
||||
onRemove: () => _liveRoomController.fsSC.value = null,
|
||||
onReport: () => _liveRoomController.reportSC(item),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
child: iconButton(
|
||||
size: 24,
|
||||
iconSize: 14,
|
||||
bgColor: const Color(0xEEFFFFFF),
|
||||
iconColor: Colors.black54,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () =>
|
||||
_liveRoomController.fsSC.value = null,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
child: iconButton(
|
||||
size: 24,
|
||||
iconSize: 14,
|
||||
bgColor: const Color(0xEEFFFFFF),
|
||||
iconColor: Colors.black54,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () => _liveRoomController.fsSC.value = null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} catch (_) {
|
||||
if (kDebugMode) rethrow;
|
||||
@@ -428,7 +426,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
}
|
||||
|
||||
Widget _buildPH(bool isFullScreen) {
|
||||
final height = maxWidth * 9 / 16;
|
||||
final height = maxWidth / StyleString.aspectRatio16x9;
|
||||
final videoHeight = isFullScreen ? maxHeight - padding.top : height;
|
||||
final bottomHeight = maxHeight - padding.top - height - kToolbarHeight;
|
||||
return Column(
|
||||
@@ -476,24 +474,20 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 55 + bottomHeight,
|
||||
height: maxHeight * 0.32,
|
||||
child: Offstage(
|
||||
offstage: isFullScreen,
|
||||
child: SizedBox(
|
||||
height: maxHeight * 0.32,
|
||||
child: _buildChatWidget(true),
|
||||
),
|
||||
child: _buildChatWidget(true),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
height: bottomHeight,
|
||||
child: Offstage(
|
||||
offstage: isFullScreen,
|
||||
child: SizedBox(
|
||||
height: bottomHeight,
|
||||
child: _buildInputWidget,
|
||||
),
|
||||
child: _buildInputWidget,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -998,7 +992,7 @@ class _RenderBorderIndicator extends RenderBox {
|
||||
|
||||
@override
|
||||
void performLayout() {
|
||||
size = constraints.constrain(Size(constraints.maxWidth, _radius.x));
|
||||
size = constraints.constrainDimensions(constraints.maxWidth, _radius.x);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1011,7 +1005,7 @@ class _RenderBorderIndicator extends RenderBox {
|
||||
}
|
||||
BoxBorder.paintNonUniformBorder(
|
||||
canvas,
|
||||
Rect.fromLTWH(0, 0, width, size.height),
|
||||
Rect.fromLTRB(0, 0, width, size.height),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: _isLeft ? _radius : .zero,
|
||||
topRight: _isLeft ? .zero : _radius,
|
||||
|
||||
@@ -214,8 +214,9 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 12,
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: VideoPopupMenu(
|
||||
size: 29,
|
||||
iconSize: 17,
|
||||
videoItem: videoItem,
|
||||
),
|
||||
|
||||
@@ -410,7 +410,8 @@ class _SavePanelState extends State<SavePanel> {
|
||||
src: cover!,
|
||||
height: coverSize,
|
||||
width: coverType == _CoverType.def16_9
|
||||
? coverSize * 16 / 9
|
||||
? coverSize *
|
||||
StyleString.aspectRatio16x9
|
||||
: coverSize,
|
||||
quality: 100,
|
||||
borderRadius: const BorderRadius.all(
|
||||
|
||||
@@ -140,17 +140,15 @@ class SubItem extends StatelessWidget {
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: SizedBox(
|
||||
height: 35,
|
||||
width: 35,
|
||||
child: IconButton(
|
||||
onPressed: cancelSub,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: theme.colorScheme.outline,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
icon: const Icon(Icons.delete_outline, size: 18),
|
||||
height: 35,
|
||||
width: 35,
|
||||
child: IconButton(
|
||||
onPressed: cancelSub,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: theme.colorScheme.outline,
|
||||
padding: EdgeInsets.zero,
|
||||
),
|
||||
icon: const Icon(Icons.delete_outline, size: 18),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -478,7 +478,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
maxHeight = size.height;
|
||||
|
||||
final shortestSide = size.shortestSide;
|
||||
final minVideoHeight = shortestSide * 9 / 16;
|
||||
final minVideoHeight = shortestSide / StyleString.aspectRatio16x9;
|
||||
final maxVideoHeight = max(size.longestSide * 0.65, shortestSide);
|
||||
videoDetailController
|
||||
..isPortrait = isPortrait = maxHeight >= maxWidth
|
||||
@@ -960,7 +960,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
enableVerticalExpand &&
|
||||
!isPortrait) {
|
||||
final double videoHeight = maxHeight - padding.vertical;
|
||||
final double width = videoHeight * 9 / 16;
|
||||
final double width = videoHeight / StyleString.aspectRatio16x9;
|
||||
final videoWidth = isFullScreen ? maxWidth : width;
|
||||
final introWidth = (maxWidth - padding.horizontal - width) / 2;
|
||||
final introHeight = maxHeight - padding.top;
|
||||
@@ -1022,10 +1022,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
width = maxWidth - clampDouble(maxWidth - width, 280, 425);
|
||||
}
|
||||
final videoWidth = isFullScreen ? maxWidth : width;
|
||||
final double height = width * 9 / 16;
|
||||
final double height = width / StyleString.aspectRatio16x9;
|
||||
final videoHeight = isFullScreen ? maxHeight - padding.top : height;
|
||||
if (height > maxHeight) {
|
||||
return childSplit(16 / 9);
|
||||
return childSplit(StyleString.aspectRatio16x9);
|
||||
}
|
||||
final introHeight = maxHeight - height - padding.top;
|
||||
final showIntro =
|
||||
@@ -1396,7 +1396,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
child = childWhenDisabled;
|
||||
} else if (maxWidth / maxHeight >= kScreenRatio) {
|
||||
child = childWhenDisabledLandscape;
|
||||
} else if (maxWidth * (9 / 16) < (2 / 5) * maxHeight) {
|
||||
} else if (maxWidth / StyleString.aspectRatio16x9 < 0.4 * maxHeight) {
|
||||
child = childWhenDisabled;
|
||||
} else {
|
||||
child = childWhenDisabledAlmostSquare;
|
||||
@@ -1620,21 +1620,19 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, maxHeight * 0.25) : 75,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
),
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -134,10 +134,10 @@ class WhisperDetailController extends CommonListController<RspSessionMsg, Msg> {
|
||||
|
||||
Future<LoadingState> onReport(Msg item, int reasonType, String reasonDesc) {
|
||||
return MsgHttp.imMsgReport(
|
||||
accusedUid: item.senderUid,
|
||||
accusedUid: item.senderUid.toInt(),
|
||||
reasonType: reasonType,
|
||||
reasonDesc: reasonDesc,
|
||||
comment: {'group_id': 0, 'msg_key': item.msgKey},
|
||||
comment: {'group_id': 0, 'msg_key': item.msgKey.toString()},
|
||||
extra: {"msg_keys": []},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -435,7 +435,8 @@ class ChatItem extends StatelessWidget {
|
||||
NetworkImgLayer(
|
||||
type: ImageType.emote,
|
||||
width: constrains.maxWidth,
|
||||
height: constrains.maxWidth * 9 / 16,
|
||||
height:
|
||||
constrains.maxWidth / StyleString.aspectRatio16x9,
|
||||
src: content['cover'],
|
||||
),
|
||||
PBadge(
|
||||
|
||||
Reference in New Issue
Block a user