mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-29 23:10:13 +08:00
opt reply item
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -71,7 +71,7 @@ class _PgcIntroPageState extends State<PgcIntroPage>
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final item = pgcIntroController.pgcItem;
|
||||
final isLandscape =
|
||||
MediaQuery.of(context).orientation == Orientation.landscape;
|
||||
MediaQuery.orientationOf(context) == Orientation.landscape;
|
||||
return SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
left: StyleString.safeSpace,
|
||||
|
||||
@@ -180,7 +180,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
||||
Success(:var response) => response?.isNotEmpty == true
|
||||
? SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 80,
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
),
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: Grid.videoCardHDelegate(context),
|
||||
|
||||
@@ -433,7 +433,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
|
||||
),
|
||||
SizedBox(
|
||||
height: (isV ? 50 : 10) +
|
||||
MediaQuery.of(context).padding.bottom),
|
||||
MediaQuery.paddingOf(context).bottom),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -17,7 +17,7 @@ class VideoReplyPanel extends StatefulWidget {
|
||||
final String? bvid;
|
||||
final int oid;
|
||||
final int rpid;
|
||||
final String replyLevel;
|
||||
final int replyLevel;
|
||||
final String heroTag;
|
||||
final Function(ReplyInfo replyItem, int? rpid) replyReply;
|
||||
final VoidCallback? onViewImage;
|
||||
@@ -30,7 +30,7 @@ class VideoReplyPanel extends StatefulWidget {
|
||||
this.bvid,
|
||||
required this.oid,
|
||||
this.rpid = 0,
|
||||
this.replyLevel = '1',
|
||||
this.replyLevel = 1,
|
||||
required this.heroTag,
|
||||
required this.replyReply,
|
||||
this.onViewImage,
|
||||
@@ -163,7 +163,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 14,
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 14,
|
||||
right: 14,
|
||||
child: SlideTransition(
|
||||
position: _videoReplyController.anim,
|
||||
@@ -198,7 +198,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
Success(:var response) => response?.isNotEmpty == true
|
||||
? SliverList.builder(
|
||||
itemBuilder: (context, index) {
|
||||
double bottom = MediaQuery.of(context).padding.bottom;
|
||||
double bottom = MediaQuery.paddingOf(context).bottom;
|
||||
if (index == response.length) {
|
||||
_videoReplyController.onLoadMore();
|
||||
return Container(
|
||||
|
||||
@@ -51,7 +51,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
this.onToggleTop,
|
||||
});
|
||||
final ReplyInfo replyItem;
|
||||
final String replyLevel;
|
||||
final int replyLevel;
|
||||
final Function(ReplyInfo replyItem, int? rpid)? replyReply;
|
||||
final bool needDivider;
|
||||
final VoidCallback? onReply;
|
||||
@@ -230,7 +230,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
replyLevel == ''
|
||||
replyLevel == 0
|
||||
? DateTime.fromMillisecondsSinceEpoch(
|
||||
replyItem.ctime.toInt() * 1000)
|
||||
.toString()
|
||||
@@ -259,7 +259,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 10,
|
||||
left: replyLevel == '' ? 6 : 45,
|
||||
left: replyLevel == 0 ? 6 : 45,
|
||||
right: 6,
|
||||
bottom: 4,
|
||||
),
|
||||
@@ -272,7 +272,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
);
|
||||
TextPainter? textPainter;
|
||||
bool? didExceedMaxLines;
|
||||
if (replyLevel == '1' && GlobalData().replyLengthLimit != 0) {
|
||||
if (replyLevel == 1 && GlobalData().replyLengthLimit != 0) {
|
||||
textPainter = TextPainter(
|
||||
text: TextSpan(text: text, style: style),
|
||||
maxLines: GlobalData().replyLengthLimit,
|
||||
@@ -316,12 +316,10 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
// 操作区域
|
||||
if (replyLevel != '')
|
||||
if (replyLevel != 0)
|
||||
buttonAction(context, theme, replyItem.replyControl),
|
||||
// 一楼的评论
|
||||
if (replyLevel == '1' &&
|
||||
(replyItem.replies.isNotEmpty ||
|
||||
replyItem.replyControl.subReplyEntryText.isNotEmpty)) ...[
|
||||
if (replyLevel == 1 && replyItem.replies.isNotEmpty) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5, bottom: 12),
|
||||
child: replyItemRow(context, theme),
|
||||
@@ -397,9 +395,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
color: theme.colorScheme.secondary,
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize),
|
||||
),
|
||||
if (replyLevel == '2' &&
|
||||
needDivider &&
|
||||
replyItem.id != replyItem.dialog)
|
||||
if (replyLevel == 2 && needDivider && replyItem.id != replyItem.dialog)
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
@@ -424,8 +420,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
|
||||
Widget replyItemRow(BuildContext context, ThemeData theme) {
|
||||
final bool extraRow = replyItem.replies.length < replyItem.count.toInt();
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 42, right: 4),
|
||||
child: Material(
|
||||
color: theme.colorScheme.onInverseSurface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
@@ -1132,7 +1128,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
leading: Icon(Icons.error_outline, color: errorColor, size: 19),
|
||||
title: Text('举报', style: style!.copyWith(color: errorColor)),
|
||||
),
|
||||
if (replyLevel == '1' && !isSubReply && ownerMid == upMid)
|
||||
if (replyLevel == 1 && !isSubReply && ownerMid == upMid)
|
||||
ListTile(
|
||||
onTap: () => menuActionHandler('top'),
|
||||
minLeadingWidth: 0,
|
||||
|
||||
@@ -178,7 +178,7 @@ class _VideoReplyReplyPanelState
|
||||
if (index == 0) {
|
||||
return ReplyItemGrpc(
|
||||
replyItem: firstFloor!,
|
||||
replyLevel: '2',
|
||||
replyLevel: 2,
|
||||
needDivider: false,
|
||||
onReply: () => _onReply(firstFloor!, -1),
|
||||
upMid: _videoReplyReplyController.upMid,
|
||||
@@ -384,8 +384,8 @@ class _VideoReplyReplyPanelState
|
||||
_videoReplyReplyController.onLoadMore();
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom),
|
||||
margin:
|
||||
EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom),
|
||||
height: 125,
|
||||
child: Text(
|
||||
_videoReplyReplyController.isEnd ? '没有更多了' : '加载中...',
|
||||
@@ -426,7 +426,7 @@ class _VideoReplyReplyPanelState
|
||||
Widget _replyItem(ReplyInfo replyItem, int index) {
|
||||
return ReplyItemGrpc(
|
||||
replyItem: replyItem,
|
||||
replyLevel: widget.isDialogue ? '3' : '2',
|
||||
replyLevel: widget.isDialogue ? 3 : 2,
|
||||
onReply: () => _onReply(replyItem, index),
|
||||
onDelete: (subIndex) {
|
||||
_videoReplyReplyController.onRemove(index, null);
|
||||
|
||||
@@ -624,7 +624,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
? height -
|
||||
(!isPortrait || removeSafeArea
|
||||
? 0
|
||||
: MediaQuery.of(this.context).padding.top)
|
||||
: MediaQuery.paddingOf(this.context).top)
|
||||
: videoDetailController.isExpanding ||
|
||||
videoDetailController.isCollapsing
|
||||
? animHeight
|
||||
|
||||
@@ -15,7 +15,7 @@ class ScrollAppBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
final double statusBarHeight = MediaQuery.paddingOf(context).top;
|
||||
final videoHeight = MediaQuery.sizeOf(context).width * 9 / 16;
|
||||
double scrollDistance = scrollVal;
|
||||
if (scrollVal > videoHeight - kToolbarHeight) {
|
||||
|
||||
@@ -1863,7 +1863,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
onPressed: () {
|
||||
if (isFullScreen) {
|
||||
widget.controller.triggerFullScreen(status: false);
|
||||
} else if (MediaQuery.of(context).orientation ==
|
||||
} else if (MediaQuery.orientationOf(context) ==
|
||||
Orientation.landscape &&
|
||||
!horizontalScreen) {
|
||||
verticalScreenForTwoSeconds();
|
||||
@@ -1874,7 +1874,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
if (!isFullScreen ||
|
||||
MediaQuery.of(context).orientation != Orientation.portrait)
|
||||
MediaQuery.orientationOf(context) != Orientation.portrait)
|
||||
SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
@@ -1895,7 +1895,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
(isFullScreen ||
|
||||
(!isFullScreen &&
|
||||
!horizontalScreen &&
|
||||
MediaQuery.of(context).orientation ==
|
||||
MediaQuery.orientationOf(context) ==
|
||||
Orientation.landscape)))
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -1996,7 +1996,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
Obx(
|
||||
() {
|
||||
if ((isFullScreen || !horizontalScreen) &&
|
||||
MediaQuery.of(context).orientation ==
|
||||
MediaQuery.orientationOf(context) ==
|
||||
Orientation.landscape) {
|
||||
startClock();
|
||||
return Text(
|
||||
|
||||
Reference in New Issue
Block a user