mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-02 08:09:47 +08:00
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
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';
|
||||
@@ -17,9 +18,9 @@ class PgcCardVSearch extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius),
|
||||
child: InkWell(
|
||||
borderRadius: StyleString.mdRadius,
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((e) => e.text).join(),
|
||||
cover: item.cover,
|
||||
|
||||
@@ -65,7 +65,6 @@ class SearchArticleController
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: min(640, context.mediaQueryShortestSide),
|
||||
),
|
||||
|
||||
@@ -18,75 +18,78 @@ class SearchArticleItem extends StatelessWidget {
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
color: theme.colorScheme.outline,
|
||||
);
|
||||
return InkWell(
|
||||
onTap: () => Get.toNamed(
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'id': '${item.id}',
|
||||
'type': 'read',
|
||||
},
|
||||
),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((item) => item.text).join(),
|
||||
cover: item.imageUrls?.firstOrNull,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
vertical: 5,
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => Get.toNamed(
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'id': '${item.id}',
|
||||
'type': 'read',
|
||||
},
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
if (item.imageUrls?.isNotEmpty == true)
|
||||
AspectRatio(
|
||||
aspectRatio: StyleString.aspectRatio,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
double maxWidth = boxConstraints.maxWidth;
|
||||
double maxHeight = boxConstraints.maxHeight;
|
||||
return NetworkImgLayer(
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
src: item.imageUrls?.firstOrNull,
|
||||
);
|
||||
}),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((item) => item.text).join(),
|
||||
cover: item.imageUrls?.firstOrNull,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
vertical: 5,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
if (item.imageUrls?.isNotEmpty == true)
|
||||
AspectRatio(
|
||||
aspectRatio: StyleString.aspectRatio,
|
||||
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||
double maxWidth = boxConstraints.maxWidth;
|
||||
double maxHeight = boxConstraints.maxHeight;
|
||||
return NetworkImgLayer(
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
src: item.imageUrls?.firstOrNull,
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text.rich(
|
||||
maxLines: 2,
|
||||
TextSpan(
|
||||
children: item.title
|
||||
.map((e) => TextSpan(
|
||||
text: e.text,
|
||||
style: TextStyle(
|
||||
color: e.isEm
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
Utils.dateFormat(item.pubTime, formatType: 'detail'),
|
||||
style: textStyle,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('${item.view}浏览', style: textStyle),
|
||||
Text(' • ', style: textStyle),
|
||||
Text('${item.reply}评论', style: textStyle),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text.rich(
|
||||
maxLines: 2,
|
||||
TextSpan(
|
||||
children: item.title
|
||||
.map((e) => TextSpan(
|
||||
text: e.text,
|
||||
style: TextStyle(
|
||||
color: e.isEm
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
Utils.dateFormat(item.pubTime, formatType: 'detail'),
|
||||
style: textStyle,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('${item.view}浏览', style: textStyle),
|
||||
Text(' • ', style: textStyle),
|
||||
Text('${item.reply}评论', style: textStyle),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/image_save.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/models/common/image_type.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -15,9 +14,7 @@ class LiveItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Card(
|
||||
elevation: 1,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: EdgeInsets.zero,
|
||||
child: InkWell(
|
||||
onTap: () => Get.toNamed('/liveRoom?roomid=${liveItem.roomid}'),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
@@ -36,9 +33,9 @@ class LiveItem extends StatelessWidget {
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
src: liveItem.cover,
|
||||
type: ImageType.emote,
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
radius: 0,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
@@ -19,86 +19,89 @@ class SearchPgcItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
const TextStyle style = TextStyle(fontSize: 13);
|
||||
return InkWell(
|
||||
onTap: () => PageUtils.viewPgc(seasonId: item.seasonId),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((item) => item.text).join(),
|
||||
cover: item.cover,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
vertical: StyleString.cardSpace,
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => PageUtils.viewPgc(seasonId: item.seasonId),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title.map((item) => item.text).join(),
|
||||
cover: item.cover,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: 111,
|
||||
height: 148,
|
||||
src: item.cover,
|
||||
),
|
||||
PBadge(
|
||||
text: item.seasonTypeName,
|
||||
top: 6.0,
|
||||
right: 4.0,
|
||||
bottom: null,
|
||||
left: null,
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: StyleString.safeSpace,
|
||||
vertical: StyleString.cardSpace,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: item.title
|
||||
.map((e) => TextSpan(
|
||||
text: e.text,
|
||||
style: TextStyle(
|
||||
color: e.isEm
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text('评分:${item.mediaScore?['score']}', style: style),
|
||||
Row(
|
||||
children: [
|
||||
if (item.areas?.isNotEmpty == true)
|
||||
Text(item.areas!, style: style),
|
||||
const SizedBox(width: 3),
|
||||
const Text('·'),
|
||||
const SizedBox(width: 3),
|
||||
Text(
|
||||
Utils.dateFormat(item.pubtime).toString(),
|
||||
style: style,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
if (item.styles?.isNotEmpty == true)
|
||||
Text(item.styles!, style: style),
|
||||
const SizedBox(width: 3),
|
||||
const Text('·'),
|
||||
const SizedBox(width: 3),
|
||||
if (item.indexShow?.isNotEmpty == true)
|
||||
Text(item.indexShow!, style: style),
|
||||
],
|
||||
NetworkImgLayer(
|
||||
width: 111,
|
||||
height: 148,
|
||||
src: item.cover,
|
||||
),
|
||||
PBadge(
|
||||
text: item.seasonTypeName,
|
||||
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),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: item.title
|
||||
.map((e) => TextSpan(
|
||||
text: e.text,
|
||||
style: TextStyle(
|
||||
color: e.isEm
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface,
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text('评分:${item.mediaScore?['score']}', style: style),
|
||||
Row(
|
||||
children: [
|
||||
if (item.areas?.isNotEmpty == true)
|
||||
Text(item.areas!, style: style),
|
||||
const SizedBox(width: 3),
|
||||
const Text('·'),
|
||||
const SizedBox(width: 3),
|
||||
Text(
|
||||
Utils.dateFormat(item.pubtime).toString(),
|
||||
style: style,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
if (item.styles?.isNotEmpty == true)
|
||||
Text(item.styles!, style: style),
|
||||
const SizedBox(width: 3),
|
||||
const Text('·'),
|
||||
const SizedBox(width: 3),
|
||||
if (item.indexShow?.isNotEmpty == true)
|
||||
Text(item.indexShow!, style: style),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -37,7 +37,6 @@ class SearchUserController
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: min(640, context.mediaQueryShortestSide),
|
||||
),
|
||||
|
||||
@@ -14,62 +14,61 @@ class SearchUserItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String heroTag = Utils.makeHeroTag(item.mid);
|
||||
final theme = Theme.of(context);
|
||||
final style = TextStyle(
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
color: theme.colorScheme.outline,
|
||||
);
|
||||
return InkWell(
|
||||
onTap: () => Get.toNamed(
|
||||
'/member?mid=${item.mid}',
|
||||
arguments: {'heroTag': heroTag, 'face': item.upic},
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 15),
|
||||
PendantAvatar(
|
||||
avatar: item.upic,
|
||||
size: 42,
|
||||
isVip: false,
|
||||
officialType: item.officialVerify?['type'],
|
||||
roomId: item.isLive == 1 ? item.roomId : null,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
item.uname!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () => Get.toNamed('/member?mid=${item.mid}'),
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 15),
|
||||
PendantAvatar(
|
||||
avatar: item.upic,
|
||||
size: 42,
|
||||
isVip: false,
|
||||
officialType: item.officialVerify?['type'],
|
||||
roomId: item.isLive == 1 ? item.roomId : null,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
item.uname!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Image.asset(
|
||||
'assets/images/lv/lv${item.isSeniorMember == 1 ? '6_s' : item.level}.png',
|
||||
height: 11,
|
||||
semanticLabel: '等级${item.level}',
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'粉丝:${Utils.numFormat(item.fans)} 视频:${Utils.numFormat(item.videos)}',
|
||||
style: style,
|
||||
),
|
||||
if (item.officialVerify?['desc'] != null &&
|
||||
item.officialVerify?['desc'] != '')
|
||||
const SizedBox(width: 6),
|
||||
Image.asset(
|
||||
'assets/images/lv/lv${item.isSeniorMember == 1 ? '6_s' : item.level}.png',
|
||||
height: 11,
|
||||
semanticLabel: '等级${item.level}',
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
item.officialVerify?['desc'],
|
||||
'粉丝:${Utils.numFormat(item.fans)} 视频:${Utils.numFormat(item.videos)}',
|
||||
style: style,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
if (item.officialVerify?['desc'] != null &&
|
||||
item.officialVerify?['desc'] != '')
|
||||
Text(
|
||||
item.officialVerify?['desc'],
|
||||
style: style,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,6 @@ class SearchVideoController
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: min(640, context.mediaQueryShortestSide),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user