mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
opt mouse control
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:PiliPlus/pages/pgc_review/post/view.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/num_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -108,6 +109,76 @@ class _PgcReviewChildPageState extends State<PgcReviewChildPage>
|
||||
}
|
||||
|
||||
Widget _itemWidget(ThemeData theme, int index, PgcReviewItemModel item) {
|
||||
void showMore() => showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (item.author!.mid == Accounts.main.mid) ...[
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'编辑',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return PgcReviewPostPanel(
|
||||
name: widget.name,
|
||||
mediaId: widget.mediaId,
|
||||
reviewId: item.reviewId,
|
||||
content: item.content,
|
||||
score: item.score,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'删除',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showConfirmDialog(
|
||||
context: context,
|
||||
title: '删除短评,同时删除评分?',
|
||||
onConfirm: () => _controller.onDel(index, item.reviewId),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'举报',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () => Get
|
||||
..back()
|
||||
..toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/appeal/?reviewId=${item.reviewId}&type=shortComment&mediaId=${widget.mediaId}',
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
@@ -120,78 +191,8 @@ class _PgcReviewChildPageState extends State<PgcReviewChildPage>
|
||||
},
|
||||
)
|
||||
: null,
|
||||
onLongPress: isLongReview
|
||||
? null
|
||||
: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (item.author!.mid == Accounts.main.mid) ...[
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'编辑',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return PgcReviewPostPanel(
|
||||
name: widget.name,
|
||||
mediaId: widget.mediaId,
|
||||
reviewId: item.reviewId,
|
||||
content: item.content,
|
||||
score: item.score,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'删除',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showConfirmDialog(
|
||||
context: context,
|
||||
title: '删除短评,同时删除评分?',
|
||||
onConfirm: () =>
|
||||
_controller.onDel(index, item.reviewId),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'举报',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () => Get
|
||||
..back()
|
||||
..toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/appeal/?reviewId=${item.reviewId}&type=shortComment&mediaId=${widget.mediaId}',
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onLongPress: !isLongReview && Utils.isMobile ? showMore : null,
|
||||
onSecondaryTap: !isLongReview && !Utils.isMobile ? showMore : null,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user