mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-25 04:45:54 +08:00
@@ -3,6 +3,7 @@ import 'dart:io' show Platform;
|
||||
import 'package:PiliPlus/common/widgets/image/custom_grid_view.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart'
|
||||
show SourceModel;
|
||||
@@ -288,15 +289,14 @@ TextSpan? richNode(
|
||||
}
|
||||
|
||||
DynamicsHttp.dynPic(i.rid).then((res) {
|
||||
if (res.isSuccess) {
|
||||
final list = res.data;
|
||||
if (res case Success(:final response)) {
|
||||
if (Platform.isAndroid) {
|
||||
i.pics = list;
|
||||
i.pics = response;
|
||||
} else {
|
||||
i.dynPic = list;
|
||||
i.dynPic = response;
|
||||
}
|
||||
if (list != null && list.isNotEmpty) {
|
||||
onView(list);
|
||||
if (response != null && response.isNotEmpty) {
|
||||
onView(response);
|
||||
}
|
||||
} else {
|
||||
res.toast();
|
||||
|
||||
@@ -53,8 +53,9 @@ class _VotePanelState extends State<VotePanel> {
|
||||
_voteInfo = widget.voteInfo;
|
||||
if (isLogin) {
|
||||
DynamicsHttp.followeeVotes(voteId: _voteInfo.voteId).then((res) {
|
||||
if (mounted && res.isSuccess) {
|
||||
followeeVote.value = res.data;
|
||||
if (!mounted) return;
|
||||
if (res case Success(:final response)) {
|
||||
followeeVote.value = response;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -118,15 +119,13 @@ class _VotePanelState extends State<VotePanel> {
|
||||
groupValue.toSet(),
|
||||
anonymous,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_enabled = false;
|
||||
_showPercentage = true;
|
||||
_voteInfo = res.data;
|
||||
_percentage = _cnt2Percentage(_voteInfo.options);
|
||||
});
|
||||
}
|
||||
if (!mounted) return;
|
||||
if (res case Success(:final response)) {
|
||||
_enabled = false;
|
||||
_showPercentage = true;
|
||||
_voteInfo = response;
|
||||
_percentage = _cnt2Percentage(_voteInfo.options);
|
||||
setState(() {});
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user