mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-30 06:10:10 +08:00
opt: simple dialog
This commit is contained in:
@@ -431,41 +431,37 @@ class AuthorPanel extends StatelessWidget {
|
||||
final reply = response.upReply;
|
||||
final enableReply = reply.status == 1;
|
||||
|
||||
return AlertDialog(
|
||||
return SimpleDialog(
|
||||
clipBehavior: .hardEdge,
|
||||
contentPadding: const .symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: .min,
|
||||
crossAxisAlignment: .start,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: selection.canModify,
|
||||
title: Text(
|
||||
'${enableSelection ? '停止' : '开启'}评论精选',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetReplySubject!(
|
||||
enableSelection ? 2 : 1,
|
||||
);
|
||||
},
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: selection.canModify,
|
||||
title: Text(
|
||||
'${enableSelection ? '停止' : '开启'}评论精选',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: reply.canModify,
|
||||
title: Text(
|
||||
'${enableReply ? '关闭' : '恢复'}评论',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetReplySubject!(enableReply ? 3 : 4);
|
||||
},
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetReplySubject!(
|
||||
enableSelection ? 2 : 1,
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: reply.canModify,
|
||||
title: Text(
|
||||
'${enableReply ? '关闭' : '恢复'}评论',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onSetReplySubject!(enableReply ? 3 : 4);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -504,32 +500,29 @@ class AuthorPanel extends StatelessWidget {
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder: (context) => SimpleDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const .symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: isPrivate,
|
||||
title: const Text(
|
||||
'所有用户可见',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: onTap,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: isPrivate,
|
||||
title: const Text(
|
||||
'所有用户可见',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: !isPrivate,
|
||||
title: const Text(
|
||||
'仅自己可见',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: onTap,
|
||||
onTap: onTap,
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
enabled: !isPrivate,
|
||||
title: const Text(
|
||||
'仅自己可见',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: onTap,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -159,57 +159,52 @@ class _VotePanelState extends State<VotePanel> {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
return AlertDialog(
|
||||
return SimpleDialog(
|
||||
clipBehavior: .hardEdge,
|
||||
title: const Text('关注的人的投票'),
|
||||
contentPadding: const .only(top: 10, bottom: 12),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: .min,
|
||||
children: list
|
||||
.map(
|
||||
(e) => ListTile(
|
||||
dense: true,
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${e.mid}'),
|
||||
leading: NetworkImgLayer(
|
||||
src: e.face,
|
||||
width: 40,
|
||||
height: 40,
|
||||
type: .avatar,
|
||||
),
|
||||
title: Text.rich(
|
||||
style: const TextStyle(fontSize: 13),
|
||||
children: list
|
||||
.map(
|
||||
(e) => ListTile(
|
||||
dense: true,
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${e.mid}'),
|
||||
leading: NetworkImgLayer(
|
||||
src: e.face,
|
||||
width: 40,
|
||||
height: 40,
|
||||
type: .avatar,
|
||||
),
|
||||
title: Text.rich(
|
||||
style: const TextStyle(fontSize: 13),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: e.name),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: e.name),
|
||||
TextSpan(
|
||||
text: ' 投给了',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: colorScheme.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
text: ' 投给了',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
style: const TextStyle(fontSize: 13),
|
||||
e.votes
|
||||
.map(
|
||||
(vote) => _voteInfo.options
|
||||
.firstWhereOrNull(
|
||||
(e) => e.optIdx == vote,
|
||||
)
|
||||
?.optDesc,
|
||||
)
|
||||
.join('、'),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
style: const TextStyle(fontSize: 13),
|
||||
e.votes
|
||||
.map(
|
||||
(vote) => _voteInfo.options
|
||||
.firstWhereOrNull(
|
||||
(e) => e.optIdx == vote,
|
||||
)
|
||||
?.optDesc,
|
||||
)
|
||||
.join('、'),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user