mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
@@ -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),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user