mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
移除Expanded,避免部分机型番剧搜索灰屏
This commit is contained in:
@@ -13,151 +13,146 @@ import '../../../utils/grid.dart';
|
|||||||
|
|
||||||
Widget searchMbangumiPanel(BuildContext context, ctr, list) {
|
Widget searchMbangumiPanel(BuildContext context, ctr, list) {
|
||||||
TextStyle style =
|
TextStyle style =
|
||||||
TextStyle(fontSize: Theme.of(context).textTheme.labelMedium!.fontSize);
|
TextStyle(fontSize: Theme.of(context).textTheme.labelMedium!.fontSize);
|
||||||
return Expanded(
|
return CustomScrollView(
|
||||||
child: CustomScrollView(
|
controller: ctr.scrollController,
|
||||||
controller: ctr.scrollController,
|
slivers: [
|
||||||
slivers: [
|
SliverGrid(
|
||||||
SliverGrid(
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
mainAxisSpacing: StyleString.cardSpace,
|
||||||
mainAxisSpacing: StyleString.cardSpace,
|
crossAxisSpacing: StyleString.safeSpace,
|
||||||
crossAxisSpacing: StyleString.safeSpace,
|
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
||||||
maxCrossAxisExtent: Grid.maxRowWidth * 2,
|
mainAxisExtent: 157,
|
||||||
mainAxisExtent: 157,),
|
),
|
||||||
delegate:
|
delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
|
||||||
SliverChildBuilderDelegate((BuildContext context, int index) {
|
var i = list![index];
|
||||||
var i = list![index];
|
return InkWell(
|
||||||
return InkWell(
|
onTap: () {
|
||||||
onTap: () {
|
/// TODO 番剧详情页面
|
||||||
/// TODO 番剧详情页面
|
// Get.toNamed('/video?bvid=${i.bvid}&cid=${i.cid}', arguments: {
|
||||||
// Get.toNamed('/video?bvid=${i.bvid}&cid=${i.cid}', arguments: {
|
// 'videoItem': i,
|
||||||
// 'videoItem': i,
|
// 'heroTag': Utils.makeHeroTag(i.id),
|
||||||
// 'heroTag': Utils.makeHeroTag(i.id),
|
// 'videoType': SearchType.media_bangumi
|
||||||
// 'videoType': SearchType.media_bangumi
|
// });
|
||||||
// });
|
},
|
||||||
},
|
child: Padding(
|
||||||
child: Padding(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
padding: const EdgeInsets.fromLTRB(
|
StyleString.safeSpace, 7, StyleString.safeSpace, 2),
|
||||||
StyleString.safeSpace, 7, StyleString.safeSpace, 2),
|
child: Row(
|
||||||
child: Row(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Stack(
|
||||||
Stack(
|
children: [
|
||||||
|
NetworkImgLayer(
|
||||||
|
width: 111,
|
||||||
|
height: 148,
|
||||||
|
src: i.cover,
|
||||||
|
),
|
||||||
|
PBadge(
|
||||||
|
text: i.mediaType == 1 ? '番剧' : '国创',
|
||||||
|
top: 6.0,
|
||||||
|
right: 4.0,
|
||||||
|
bottom: null,
|
||||||
|
left: null,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
NetworkImgLayer(
|
const SizedBox(height: 4),
|
||||||
width: 111,
|
RichText(
|
||||||
height: 148,
|
maxLines: 1,
|
||||||
src: i.cover,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.onSurface),
|
||||||
|
children: [
|
||||||
|
for (var i in i.title) ...[
|
||||||
|
TextSpan(
|
||||||
|
text: i['text'],
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: MediaQuery.textScalerOf(context)
|
||||||
|
.scale(Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleSmall!
|
||||||
|
.fontSize!),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: i['type'] == 'em'
|
||||||
|
? Theme.of(context).colorScheme.primary
|
||||||
|
: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onSurface,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text('评分:${i.mediaScore['score'].toString()}',
|
||||||
|
style: style),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(i.areas, style: style),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
const Text('·'),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
Text(Utils.dateFormat(i.pubtime).toString(),
|
||||||
|
style: style),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(i.styles, style: style),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
const Text('·'),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
Text(i.indexShow, style: style),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 18),
|
||||||
|
SizedBox(
|
||||||
|
height: 32,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
SmartDialog.showLoading(msg: '获取中...');
|
||||||
|
var res = await SearchHttp.bangumiInfo(
|
||||||
|
seasonId: i.seasonId);
|
||||||
|
SmartDialog.dismiss().then((value) {
|
||||||
|
if (res['status']) {
|
||||||
|
EpisodeItem episode =
|
||||||
|
res['data'].episodes.first;
|
||||||
|
String bvid = episode.bvid!;
|
||||||
|
int cid = episode.cid!;
|
||||||
|
String pic = episode.cover!;
|
||||||
|
String heroTag = Utils.makeHeroTag(cid);
|
||||||
|
Get.toNamed(
|
||||||
|
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}',
|
||||||
|
arguments: {
|
||||||
|
'pic': pic,
|
||||||
|
'heroTag': heroTag,
|
||||||
|
'videoType': SearchType.media_bangumi,
|
||||||
|
'bangumiItem': res['data'],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: const Text('观看'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
PBadge(
|
|
||||||
text: i.mediaType == 1 ? '番剧' : '国创',
|
|
||||||
top: 6.0,
|
|
||||||
right: 4.0,
|
|
||||||
bottom: null,
|
|
||||||
left: null,
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
),
|
||||||
Expanded(
|
],
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
RichText(
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
text: TextSpan(
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
Theme.of(context).colorScheme.onSurface),
|
|
||||||
children: [
|
|
||||||
for (var i in i.title) ...[
|
|
||||||
TextSpan(
|
|
||||||
text: i['text'],
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: MediaQuery.textScalerOf(context)
|
|
||||||
.scale(Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.titleSmall!
|
|
||||||
.fontSize!),
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: i['type'] == 'em'
|
|
||||||
? Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.primary
|
|
||||||
: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSurface,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
Text('评分:${i.mediaScore['score'].toString()}',
|
|
||||||
style: style),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(i.areas, style: style),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
const Text('·'),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
Text(Utils.dateFormat(i.pubtime).toString(),
|
|
||||||
style: style),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(i.styles, style: style),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
const Text('·'),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
Text(i.indexShow, style: style),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 18),
|
|
||||||
SizedBox(
|
|
||||||
height: 32,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
SmartDialog.showLoading(msg: '获取中...');
|
|
||||||
var res = await SearchHttp.bangumiInfo(
|
|
||||||
seasonId: i.seasonId);
|
|
||||||
SmartDialog.dismiss().then((value) {
|
|
||||||
if (res['status']) {
|
|
||||||
EpisodeItem episode =
|
|
||||||
res['data'].episodes.first;
|
|
||||||
String bvid = episode.bvid!;
|
|
||||||
int cid = episode.cid!;
|
|
||||||
String pic = episode.cover!;
|
|
||||||
String heroTag = Utils.makeHeroTag(cid);
|
|
||||||
Get.toNamed(
|
|
||||||
'/video?bvid=$bvid&cid=$cid&seasonId=${i.seasonId}',
|
|
||||||
arguments: {
|
|
||||||
'pic': pic,
|
|
||||||
'heroTag': heroTag,
|
|
||||||
'videoType': SearchType.media_bangumi,
|
|
||||||
'bangumiItem': res['data'],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: const Text('观看'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}, childCount: list.length),
|
);
|
||||||
),
|
}, childCount: list.length),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user