mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 19:28:27 +08:00
@@ -6,7 +6,7 @@ import 'package:PiliPlus/pages/search_panel/controller.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
|
||||
class SearchAllController
|
||||
extends SearchPanelController<SearchAllModel, dynamic> {
|
||||
extends SearchPanelController<SearchAllData, dynamic> {
|
||||
SearchAllController({
|
||||
required super.keyword,
|
||||
required super.searchType,
|
||||
@@ -38,7 +38,7 @@ class SearchAllController
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<SearchAllModel>> customGetData() => SearchHttp.searchAll(
|
||||
Future<LoadingState<SearchAllData>> customGetData() => SearchHttp.searchAll(
|
||||
keyword: keyword,
|
||||
page: page,
|
||||
order: order.value,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/video_card/video_card_h.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/pages/bangumi/widgets/bangumi_card_v_search.dart';
|
||||
import 'package:PiliPlus/pages/search_panel/all/controller.dart';
|
||||
import 'package:PiliPlus/pages/search_panel/all/widgets/pgc_card_v_search.dart';
|
||||
import 'package:PiliPlus/pages/search_panel/pgc/widgets/item.dart';
|
||||
import 'package:PiliPlus/pages/search_panel/user/widgets/item.dart';
|
||||
import 'package:PiliPlus/pages/search_panel/view.dart';
|
||||
@@ -24,7 +24,7 @@ class SearchAllPanel extends CommonSearchPanel {
|
||||
}
|
||||
|
||||
class _SearchAllPanelState
|
||||
extends CommonSearchPanelState<SearchAllPanel, SearchAllModel, dynamic> {
|
||||
extends CommonSearchPanelState<SearchAllPanel, SearchAllData, dynamic> {
|
||||
@override
|
||||
late final SearchAllController controller = Get.put(
|
||||
SearchAllController(
|
||||
@@ -58,7 +58,7 @@ class _SearchAllPanelState
|
||||
showPubdate: true,
|
||||
),
|
||||
),
|
||||
List<SearchMBangumiItemModel>() => item.length == 1
|
||||
List<SearchPgcItemModel>() => item.length == 1
|
||||
? SizedBox(
|
||||
height: 160,
|
||||
child: SearchPgcItem(item: item.first),
|
||||
@@ -80,7 +80,7 @@ class _SearchAllPanelState
|
||||
? StyleString.safeSpace
|
||||
: 0,
|
||||
),
|
||||
child: BangumiCardVSearch(item: item[index]),
|
||||
child: PgcCardVSearch(item: item[index]),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
70
lib/pages/search_panel/all/widgets/pgc_card_v_search.dart
Normal file
70
lib/pages/search_panel/all/widgets/pgc_card_v_search.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// 视频卡片 - 垂直布局
|
||||
class PgcCardVSearch extends StatelessWidget {
|
||||
const PgcCardVSearch({
|
||||
super.key,
|
||||
required this.item,
|
||||
});
|
||||
|
||||
final SearchPgcItemModel item;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
child: InkWell(
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((e) => e.text).join(),
|
||||
cover: item.cover,
|
||||
),
|
||||
onTap: () => PageUtils.viewPgc(seasonId: item.seasonId),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 0.75,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
final double maxWidth = boxConstraints.maxWidth;
|
||||
final double maxHeight = boxConstraints.maxHeight;
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
src: item.cover,
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
),
|
||||
PBadge(
|
||||
text: item.seasonTypeName,
|
||||
right: 6,
|
||||
top: 6,
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(4, 5, 0, 3),
|
||||
child: Text(
|
||||
item.title.map((e) => e.text).join(),
|
||||
textAlign: TextAlign.start,
|
||||
style: const TextStyle(
|
||||
letterSpacing: 0.3,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user