opt: handle response

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-01 08:59:12 +08:00
parent 312ce6e639
commit 11398ca64b
25 changed files with 339 additions and 306 deletions

View File

@@ -1,4 +1,5 @@
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:dio/dio.dart';
import '../models/dynamics/result.dart';
@@ -10,7 +11,6 @@ class DynamicsHttp {
String? type,
String? offset,
int? mid,
required bool antiGoodsDyn,
}) async {
Map<String, dynamic> data = {
'type': type ?? 'all',
@@ -26,7 +26,7 @@ class DynamicsHttp {
if (res.data['code'] == 0) {
try {
DynamicsDataModel data = DynamicsDataModel.fromJson(res.data['data']);
if (antiGoodsDyn) {
if (GStorage.antiGoodsDyn) {
data.items?.removeWhere(
(item) =>
item.orig?.modules?.moduleDynamic?.additional?.type ==