mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 08:06:21 +08:00
@@ -261,10 +261,10 @@ class DynamicsHttp {
|
||||
}
|
||||
|
||||
static Future<LoadingState<VoteInfo>> doVote({
|
||||
required voteId,
|
||||
required int voteId,
|
||||
required List<int> votes,
|
||||
bool anonymity = false,
|
||||
dynamicId,
|
||||
int? dynamicId,
|
||||
}) async {
|
||||
final csrf = Accounts.main.csrf;
|
||||
final data = {
|
||||
|
||||
@@ -246,7 +246,7 @@ class OpusContent extends StatelessWidget {
|
||||
showVoteDialog(
|
||||
context,
|
||||
element.linkCard!.card!.vote?.voteId ??
|
||||
element.linkCard!.card!.oid,
|
||||
int.parse(element.linkCard!.card!.oid!),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class ReadOpus extends StatelessWidget {
|
||||
}
|
||||
case 'vote-card card':
|
||||
if (card.id != null) {
|
||||
showVoteDialog(context, card.id);
|
||||
showVoteDialog(context, int.parse(card.id!));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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