mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 03:26:22 +08:00
@@ -309,8 +309,12 @@ Widget addWidget(
|
||||
onTap: () {
|
||||
showVoteDialog(
|
||||
context,
|
||||
vote.voteId,
|
||||
item.idStr,
|
||||
vote.voteId!,
|
||||
item.idStr is int
|
||||
? item.idStr
|
||||
: item.idStr is String
|
||||
? int.parse(item.idStr)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
@@ -358,8 +362,12 @@ Widget addWidget(
|
||||
onPressed: () {
|
||||
showVoteDialog(
|
||||
context,
|
||||
vote.voteId,
|
||||
item.idStr,
|
||||
vote.voteId!,
|
||||
item.idStr is int
|
||||
? item.idStr
|
||||
: item.idStr is String
|
||||
? int.parse(item.idStr)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
|
||||
@@ -123,7 +123,10 @@ TextSpan? richNode(
|
||||
),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
showVoteDialog(context, i.rid, item.basic?.commentIdStr);
|
||||
final dynIdStr = item.basic?.commentIdStr;
|
||||
final dynId =
|
||||
dynIdStr != null ? int.tryParse(dynIdStr) : null;
|
||||
showVoteDialog(context, int.parse(i.rid!), dynId);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -256,7 +256,8 @@ class PercentageChip extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Future showVoteDialog(BuildContext context, voteId, [dynamicId]) async {
|
||||
Future showVoteDialog(BuildContext context, int voteId,
|
||||
[int? dynamicId]) async {
|
||||
final voteInfo = await DynamicsHttp.voteInfo(voteId);
|
||||
if (context.mounted) {
|
||||
if (voteInfo.isSuccess) {
|
||||
|
||||
Reference in New Issue
Block a user