opt: bottom sheet

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-09 16:33:09 +08:00
parent fe2a6ec006
commit 0ccd15047b
10 changed files with 428 additions and 421 deletions

View File

@@ -221,6 +221,7 @@ class AuthorPanel extends StatelessWidget {
onPressed: () {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
@@ -235,210 +236,205 @@ class AuthorPanel extends StatelessWidget {
);
Widget morePanel(context) {
return MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius:
const BorderRadius.all(Radius.circular(3))),
),
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius: const BorderRadius.all(Radius.circular(3))),
),
),
),
if (item.type == 'DYNAMIC_TYPE_AV')
ListTile(
onTap: () async {
try {
String bvid = item.modules.moduleDynamic.major.archive.bvid;
var res = await UserHttp.toViewLater(bvid: bvid);
SmartDialog.showToast(res['msg']);
Get.back();
} catch (err) {
SmartDialog.showToast('出错了:${err.toString()}');
}
},
minLeadingWidth: 0,
// dense: true,
leading: const Icon(Icons.watch_later_outlined, size: 19),
title: Text(
'稍后再看',
style: Theme.of(context).textTheme.titleSmall,
),
),
),
if (item.type == 'DYNAMIC_TYPE_AV')
ListTile(
onTap: () async {
try {
String bvid = item.modules.moduleDynamic.major.archive.bvid;
var res = await UserHttp.toViewLater(bvid: bvid);
SmartDialog.showToast(res['msg']);
Get.back();
} catch (err) {
SmartDialog.showToast('出错了:${err.toString()}');
}
},
minLeadingWidth: 0,
// dense: true,
leading: const Icon(Icons.watch_later_outlined, size: 19),
title: Text(
'分享动态',
'稍后再看',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.share_outlined, size: 19),
),
ListTile(
title: Text(
'分享动态',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.share_outlined, size: 19),
onTap: () {
Get.back();
Utils.shareText(
'${HttpString.dynamicShareBaseUrl}/${item.idStr}');
},
minLeadingWidth: 0,
),
ListTile(
title: Text(
'临时屏蔽:${item.modules.moduleAuthor.name}',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.visibility_off_outlined, size: 19),
onTap: () {
Get.back();
DynamicsController dynamicsController =
Get.find<DynamicsController>();
dynamicsController.tempBannedList
.add(item.modules.moduleAuthor.mid);
SmartDialog.showToast(
'已临时屏蔽${item.modules.moduleAuthor.name}(${item.modules.moduleAuthor.mid}),重启恢复');
},
minLeadingWidth: 0,
),
ListTile(
onTap: () {
Get.back();
SavePanel.toSavePanel(item: item);
},
minLeadingWidth: 0,
leading: const Icon(Icons.save_alt, size: 19),
title: Text('保存动态', style: Theme.of(context).textTheme.titleSmall!),
),
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
ListTile(
onTap: () {
Get.back();
Utils.shareText(
'${HttpString.dynamicShareBaseUrl}/${item.idStr}');
Utils.checkCreatedDyn(id: item.idStr, isManual: true);
},
minLeadingWidth: 0,
),
ListTile(
title: Text(
'临时屏蔽:${item.modules.moduleAuthor.name}',
style: Theme.of(context).textTheme.titleSmall,
leading: Stack(
alignment: Alignment.center,
children: [
const Icon(Icons.shield_outlined, size: 19),
const Icon(Icons.published_with_changes_sharp, size: 12),
],
),
leading: const Icon(Icons.visibility_off_outlined, size: 19),
onTap: () {
Get.back();
DynamicsController dynamicsController =
Get.find<DynamicsController>();
dynamicsController.tempBannedList
.add(item.modules.moduleAuthor.mid);
SmartDialog.showToast(
'已临时屏蔽${item.modules.moduleAuthor.name}(${item.modules.moduleAuthor.mid}),重启恢复');
},
minLeadingWidth: 0,
),
ListTile(
onTap: () {
Get.back();
SavePanel.toSavePanel(item: item);
},
minLeadingWidth: 0,
leading: const Icon(Icons.save_alt, size: 19),
title:
Text('保存动态', style: Theme.of(context).textTheme.titleSmall!),
Text('检查动态', style: Theme.of(context).textTheme.titleSmall!),
),
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
if (onRemove != null)
ListTile(
onTap: () {
Get.back();
Utils.checkCreatedDyn(id: item.idStr, isManual: true);
},
minLeadingWidth: 0,
leading: Stack(
alignment: Alignment.center,
children: [
const Icon(Icons.shield_outlined, size: 19),
const Icon(Icons.published_with_changes_sharp, size: 12),
],
),
title: Text('检查动态',
style: Theme.of(context).textTheme.titleSmall!),
),
if (onRemove != null)
ListTile(
onTap: () {
Get.back();
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('确定删除该动态?'),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
),
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('确定删除该动态?'),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
),
),
TextButton(
onPressed: () {
Get.back();
onRemove?.call(item.idStr);
},
child: const Text('确定'),
),
],
),
);
},
minLeadingWidth: 0,
leading: Icon(Icons.delete_outline,
color: Theme.of(context).colorScheme.error, size: 19),
title: Text('删除',
style: Theme.of(context).textTheme.titleSmall!.copyWith(
color: Theme.of(context).colorScheme.error)),
),
],
if (Accounts.main.isLogin)
ListTile(
title: Text(
'举报',
style: Theme.of(context).textTheme.titleSmall!.copyWith(
color: Theme.of(context).colorScheme.error,
),
),
leading: Icon(
Icons.error_outline_outlined,
size: 19,
color: Theme.of(context).colorScheme.error,
),
onTap: () {
Get.back();
autoWrapReportDialog(
context,
ReportOptions.dynamicReport,
(reasonType, reasonDesc, banUid) async {
if (banUid) {
VideoHttp.relationMod(
mid: item.modules.moduleAuthor.mid,
act: 5,
reSrc: 11,
);
}
final res = await Request().post(
'/x/dynamic/feed/dynamic_report/add',
queryParameters: {
'csrf': await Request.getCsrf(),
},
data: {
"accused_uid": item.modules.moduleAuthor.mid,
"dynamic_id": item.idStr,
"reason_type": reasonType,
"reason_desc": reasonType == 0 ? reasonDesc : null,
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
return res.data as Map;
},
TextButton(
onPressed: () {
Get.back();
onRemove?.call(item.idStr);
},
child: const Text('确定'),
),
],
),
);
},
minLeadingWidth: 0,
leading: Icon(Icons.delete_outline,
color: Theme.of(context).colorScheme.error, size: 19),
title: Text('删除',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Theme.of(context).colorScheme.error)),
),
const Divider(thickness: 0.1, height: 1),
ListTile(
onTap: Get.back,
minLeadingWidth: 0,
dense: true,
title: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
textAlign: TextAlign.center,
),
),
],
),
if (Accounts.main.isLogin)
ListTile(
title: Text(
'举报',
style: Theme.of(context).textTheme.titleSmall!.copyWith(
color: Theme.of(context).colorScheme.error,
),
),
leading: Icon(
Icons.error_outline_outlined,
size: 19,
color: Theme.of(context).colorScheme.error,
),
onTap: () {
Get.back();
autoWrapReportDialog(
context,
ReportOptions.dynamicReport,
(reasonType, reasonDesc, banUid) async {
if (banUid) {
VideoHttp.relationMod(
mid: item.modules.moduleAuthor.mid,
act: 5,
reSrc: 11,
);
}
final res = await Request().post(
'/x/dynamic/feed/dynamic_report/add',
queryParameters: {
'csrf': await Request.getCsrf(),
},
data: {
"accused_uid": item.modules.moduleAuthor.mid,
"dynamic_id": item.idStr,
"reason_type": reasonType,
"reason_desc": reasonType == 0 ? reasonDesc : null,
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
),
);
return res.data as Map;
},
);
},
minLeadingWidth: 0,
),
const Divider(thickness: 0.1, height: 1),
ListTile(
onTap: Get.back,
minLeadingWidth: 0,
dense: true,
title: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
textAlign: TextAlign.center,
),
),
],
),
);
}

View File

@@ -131,6 +131,7 @@ class AuthorPanelGrpc extends StatelessWidget {
onPressed: () {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
@@ -162,137 +163,130 @@ class MorePanel extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius:
const BorderRadius.all(Radius.circular(3))),
),
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius: const BorderRadius.all(Radius.circular(3))),
),
),
),
if (item.type == 'DYNAMIC_TYPE_AV')
ListTile(
onTap: () async {
try {
String bvid = item.modules.moduleDynamic.major.archive.bvid;
var res = await UserHttp.toViewLater(bvid: bvid);
SmartDialog.showToast(res['msg']);
Get.back();
} catch (err) {
SmartDialog.showToast('出错了:${err.toString()}');
}
},
minLeadingWidth: 0,
// dense: true,
leading: const Icon(Icons.watch_later_outlined, size: 19),
title: Text(
'稍后再看',
style: Theme.of(context).textTheme.titleSmall,
),
),
),
if (item.type == 'DYNAMIC_TYPE_AV')
ListTile(
title: Text(
'分享动态',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.share_outlined, size: 19),
onTap: () {
Get.back();
Utils.shareText(
'${HttpString.dynamicShareBaseUrl}/${item.idStr}');
},
minLeadingWidth: 0,
),
ListTile(
title: Text(
'临时屏蔽:${item.modules.moduleAuthor.name}',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.visibility_off_outlined, size: 19),
onTap: () {
Get.back();
DynamicsController dynamicsController =
Get.find<DynamicsController>();
dynamicsController.tempBannedList
.add(item.modules.moduleAuthor.mid);
SmartDialog.showToast(
'已临时屏蔽${item.modules.moduleAuthor.name}(${item.modules.moduleAuthor.mid}),重启恢复');
},
minLeadingWidth: 0,
),
if (item.modules.moduleAuthor.mid == Accounts.main.mid)
ListTile(
onTap: () async {
onTap: () async {
try {
String bvid = item.modules.moduleDynamic.major.archive.bvid;
var res = await UserHttp.toViewLater(bvid: bvid);
SmartDialog.showToast(res['msg']);
Get.back();
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('确定删除该动态?'),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(
color:
Theme.of(context).colorScheme.outline,
),
} catch (err) {
SmartDialog.showToast('出错了:${err.toString()}');
}
},
minLeadingWidth: 0,
// dense: true,
leading: const Icon(Icons.watch_later_outlined, size: 19),
title: Text(
'稍后再看',
style: Theme.of(context).textTheme.titleSmall,
),
),
ListTile(
title: Text(
'分享动态',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.share_outlined, size: 19),
onTap: () {
Get.back();
Utils.shareText(
'${HttpString.dynamicShareBaseUrl}/${item.idStr}');
},
minLeadingWidth: 0,
),
ListTile(
title: Text(
'临时屏蔽:${item.modules.moduleAuthor.name}',
style: Theme.of(context).textTheme.titleSmall,
),
leading: const Icon(Icons.visibility_off_outlined, size: 19),
onTap: () {
Get.back();
DynamicsController dynamicsController =
Get.find<DynamicsController>();
dynamicsController.tempBannedList
.add(item.modules.moduleAuthor.mid);
SmartDialog.showToast(
'已临时屏蔽${item.modules.moduleAuthor.name}(${item.modules.moduleAuthor.mid}),重启恢复');
},
minLeadingWidth: 0,
),
if (item.modules.moduleAuthor.mid == Accounts.main.mid)
ListTile(
onTap: () async {
Get.back();
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text('确定删除该动态?'),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
),
),
TextButton(
onPressed: () {
Get.back();
onRemove?.call(item.idStr);
},
child: const Text('确定'),
),
],
));
},
minLeadingWidth: 0,
leading: Icon(Icons.delete_outline,
color: Theme.of(context).colorScheme.error, size: 19),
title: Text('删除',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Theme.of(context).colorScheme.error)),
),
const Divider(thickness: 0.1, height: 1),
ListTile(
onTap: () => Get.back(),
),
TextButton(
onPressed: () {
Get.back();
onRemove?.call(item.idStr);
},
child: const Text('确定'),
),
],
));
},
minLeadingWidth: 0,
dense: true,
title: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
textAlign: TextAlign.center,
),
leading: Icon(Icons.delete_outline,
color: Theme.of(context).colorScheme.error, size: 19),
title: Text('删除',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Theme.of(context).colorScheme.error)),
),
],
),
const Divider(thickness: 0.1, height: 1),
ListTile(
onTap: () => Get.back(),
minLeadingWidth: 0,
dense: true,
title: Text(
'取消',
style: TextStyle(color: Theme.of(context).colorScheme.outline),
textAlign: TextAlign.center,
),
),
],
),
);
}

View File

@@ -200,7 +200,8 @@ class _MainAppState extends State<MainApp>
body: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (useSideBar || context.orientation == Orientation.landscape)
if (useSideBar ||
context.orientation == Orientation.landscape) ...[
Obx(
() => _mainController.navigationBars.length > 1
? NavigationRail(
@@ -235,12 +236,14 @@ class _MainAppState extends State<MainApp>
child: userAndSearchVertical,
),
),
VerticalDivider(
width: 1,
indent: MediaQuery.of(context).padding.top,
endIndent: MediaQuery.of(context).padding.bottom,
color: Theme.of(context).colorScheme.outline.withOpacity(0.06),
),
VerticalDivider(
width: 1,
indent: MediaQuery.of(context).padding.top,
endIndent: MediaQuery.of(context).padding.bottom,
color:
Theme.of(context).colorScheme.outline.withOpacity(0.06),
),
],
Expanded(
child: _mainController.mainTabBarView
? CustomTabBarView(

View File

@@ -1,3 +1,5 @@
import 'dart:math';
import 'package:PiliPlus/common/widgets/custom_sliver_persistent_header_delegate.dart';
import 'package:PiliPlus/common/widgets/http_error.dart';
import 'package:PiliPlus/common/widgets/image_save.dart';
@@ -257,8 +259,13 @@ class ArticlePanelController extends GetxController {
) {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
clipBehavior: Clip.hardEdge,
backgroundColor: Theme.of(context).colorScheme.surface,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (context) => SingleChildScrollView(
child: Container(
width: double.infinity,

View File

@@ -1,3 +1,5 @@
import 'dart:math';
import 'package:PiliPlus/common/widgets/custom_sliver_persistent_header_delegate.dart';
import 'package:PiliPlus/common/widgets/http_error.dart';
import 'package:PiliPlus/common/widgets/loading_widget.dart';
@@ -208,8 +210,13 @@ class UserPanelController extends GetxController {
) {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
clipBehavior: Clip.hardEdge,
backgroundColor: Theme.of(context).colorScheme.surface,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (context) => SingleChildScrollView(
child: Container(
width: double.infinity,

View File

@@ -1,3 +1,5 @@
import 'dart:math';
import 'package:PiliPlus/common/widgets/custom_sliver_persistent_header_delegate.dart';
import 'package:PiliPlus/common/widgets/http_error.dart';
import 'package:PiliPlus/common/widgets/loading_widget.dart';
@@ -209,8 +211,13 @@ class VideoPanelController extends GetxController {
) {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
clipBehavior: Clip.hardEdge,
backgroundColor: Theme.of(context).colorScheme.surface,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (context) => StatefulBuilder(
builder: (context, setState) {
Widget dateWidget([bool isFirst = true]) {

View File

@@ -133,6 +133,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
void showBottomSheet(index) {
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
clipBehavior: Clip.hardEdge,
backgroundColor: Theme.of(context).colorScheme.surface,
@@ -140,32 +141,27 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (context) {
return MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 10),
...sheetMenu.map(
(item) => ListTile(
onTap: () {
Navigator.pop(context);
menuAction(index, item['id']);
},
minLeadingWidth: 0,
iconColor: Theme.of(context).colorScheme.onSurface,
leading: item['leading'],
title: Text(
item['title'],
style: Theme.of(context).textTheme.titleSmall,
),
return Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 10),
...sheetMenu.map(
(item) => ListTile(
onTap: () {
Navigator.pop(context);
menuAction(index, item['id']);
},
minLeadingWidth: 0,
iconColor: Theme.of(context).colorScheme.onSurface,
leading: item['leading'],
title: Text(
item['title'],
style: Theme.of(context).textTheme.titleSmall,
),
),
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
],
),
),
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
],
);
},
);

View File

@@ -72,6 +72,7 @@ class ReplyItem extends StatelessWidget {
feedBack();
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
@@ -500,6 +501,7 @@ class ReplyItem extends StatelessWidget {
feedBack();
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),

View File

@@ -79,6 +79,7 @@ class ReplyItemGrpc extends StatelessWidget {
// );
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
@@ -534,6 +535,7 @@ class ReplyItemGrpc extends StatelessWidget {
feedBack();
showModalBottomSheet(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
@@ -1218,108 +1220,95 @@ class ReplyItemGrpc extends StatelessWidget {
Color errorColor = Theme.of(context).colorScheme.error;
return MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius:
const BorderRadius.all(Radius.circular(3))),
),
return Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: Get.back,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(28),
topRight: Radius.circular(28),
),
child: Container(
height: 35,
padding: const EdgeInsets.only(bottom: 2),
child: Center(
child: Container(
width: 32,
height: 3,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.outline,
borderRadius: const BorderRadius.all(Radius.circular(3))),
),
),
),
if (ownerMid == upMid.toInt() ||
ownerMid == item.member.mid.toInt())
ListTile(
onTap: () => menuActionHandler('delete'),
minLeadingWidth: 0,
leading:
Icon(Icons.delete_outlined, color: errorColor, size: 19),
title: Text('删除',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: errorColor)),
),
if (ownerMid != 0)
ListTile(
onTap: () => menuActionHandler('report'),
minLeadingWidth: 0,
leading: Icon(Icons.error_outline, color: errorColor, size: 19),
title: Text('举报',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: errorColor)),
),
if (replyLevel == '1' &&
isSubReply.not &&
ownerMid == upMid.toInt())
ListTile(
onTap: () => menuActionHandler('top'),
minLeadingWidth: 0,
leading: Icon(Icons.vertical_align_top, size: 19),
title: Text('${replyItem.replyControl.isUpTop ? '取消' : ''}置顶',
style: Theme.of(context).textTheme.titleSmall!),
),
),
if (ownerMid == upMid.toInt() || ownerMid == item.member.mid.toInt())
ListTile(
onTap: () => menuActionHandler('copyAll'),
onTap: () => menuActionHandler('delete'),
minLeadingWidth: 0,
leading: const Icon(Icons.copy_all_outlined, size: 19),
title:
Text('复制全部', style: Theme.of(context).textTheme.titleSmall),
leading: Icon(Icons.delete_outlined, color: errorColor, size: 19),
title: Text('删除',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: errorColor)),
),
if (ownerMid != 0)
ListTile(
onTap: () => menuActionHandler('copyFreedom'),
onTap: () => menuActionHandler('report'),
minLeadingWidth: 0,
leading: const Icon(Icons.copy_outlined, size: 19),
title:
Text('自由复制', style: Theme.of(context).textTheme.titleSmall),
leading: Icon(Icons.error_outline, color: errorColor, size: 19),
title: Text('举报',
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: errorColor)),
),
if (replyLevel == '1' && isSubReply.not && ownerMid == upMid.toInt())
ListTile(
onTap: () => menuActionHandler('saveReply'),
onTap: () => menuActionHandler('top'),
minLeadingWidth: 0,
leading: const Icon(Icons.save_alt, size: 19),
title:
Text('保存评论', style: Theme.of(context).textTheme.titleSmall),
leading: Icon(Icons.vertical_align_top, size: 19),
title: Text('${replyItem.replyControl.isUpTop ? '取消' : ''}置顶',
style: Theme.of(context).textTheme.titleSmall!),
),
if (item.mid.toInt() == ownerMid)
ListTile(
onTap: () => menuActionHandler('checkReply'),
minLeadingWidth: 0,
leading: Stack(
alignment: Alignment.center,
children: [
const Icon(Icons.shield_outlined, size: 19),
const Icon(Icons.reply, size: 12),
],
),
title:
Text('检查评论', style: Theme.of(context).textTheme.titleSmall),
ListTile(
onTap: () => menuActionHandler('copyAll'),
minLeadingWidth: 0,
leading: const Icon(Icons.copy_all_outlined, size: 19),
title: Text('复制全部', style: Theme.of(context).textTheme.titleSmall),
),
ListTile(
onTap: () => menuActionHandler('copyFreedom'),
minLeadingWidth: 0,
leading: const Icon(Icons.copy_outlined, size: 19),
title: Text('自由复制', style: Theme.of(context).textTheme.titleSmall),
),
ListTile(
onTap: () => menuActionHandler('saveReply'),
minLeadingWidth: 0,
leading: const Icon(Icons.save_alt, size: 19),
title: Text('保存评论', style: Theme.of(context).textTheme.titleSmall),
),
if (item.mid.toInt() == ownerMid)
ListTile(
onTap: () => menuActionHandler('checkReply'),
minLeadingWidth: 0,
leading: Stack(
alignment: Alignment.center,
children: [
const Icon(Icons.shield_outlined, size: 19),
const Icon(Icons.reply, size: 12),
],
),
],
),
title:
Text('检查评论', style: Theme.of(context).textTheme.titleSmall),
),
],
),
);
}

View File

@@ -769,6 +769,9 @@ class Utils {
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
sheetAnimationStyle: AnimationStyle(curve: Curves.ease),
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (BuildContext context) {
return DraggableScrollableSheet(
minChildSize: 0,
@@ -1185,6 +1188,9 @@ class Utils {
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
sheetAnimationStyle: AnimationStyle(curve: Curves.ease),
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (BuildContext context) {
return DraggableScrollableSheet(
minChildSize: 0,