mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-28 03:58:39 +00:00
tweaks (#1821)
* opt: _onTapUp * opt: set contains * opt: elementAtOrNull
This commit is contained in:
committed by
GitHub
parent
37fa165f59
commit
7260a387f9
@@ -10,7 +10,6 @@ import 'package:PiliPlus/models_new/dynamic/dyn_topic_pub_search/data.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/models_new/search/search_rcmd/data.dart';
|
||||
import 'package:PiliPlus/models_new/search/search_trending/data.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/wbi_sign.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
@@ -183,7 +182,8 @@ abstract final class SearchHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
if (res.data['data'] case List list) {
|
||||
return part != null
|
||||
? (list.getOrNull(part - 1)?['cid'] ?? list.firstOrNull?['cid'])
|
||||
? (list.elementAtOrNull(part - 1)?['cid'] ??
|
||||
list.firstOrNull?['cid'])
|
||||
: list.firstOrNull?['cid'];
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user