Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-05 18:55:07 +08:00
parent 707d2f4b07
commit b149ee4998
39 changed files with 472 additions and 535 deletions

View File

@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/models/common/stat_type.dart';
import 'package:PiliPlus/models_new/fav/fav_article/item.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -74,35 +75,34 @@ class FavArticleItem extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
),
Row(
children: [
// StatView(
// context: context,
// value: item.stat!.view!,
// goto: 'picture',
// textColor: theme.colorScheme.outline,
// ),
// const SizedBox(width: 16),
StatView(
context: context,
goto: 'like',
value:
item.stat!.like == '' ? 0 : item.stat!.like!,
textColor: theme.colorScheme.outline,
),
],
),
const SizedBox(height: 3),
Text(
'${item.author!.name} · ${item.pubTime}',
item.author!.name!,
maxLines: 1,
style: TextStyle(
fontSize: 13,
height: 1,
color: theme.colorScheme.outline,
overflow: TextOverflow.clip,
),
),
const SizedBox(height: 3),
Row(
children: [
StatWidget(
type: StatType.like,
value: item.stat!.like,
textColor: theme.colorScheme.outline,
),
Text(
' · ${item.pubTime}',
maxLines: 1,
style: TextStyle(
fontSize: 13,
height: 1,
color: theme.colorScheme.outline,
),
),
],
),
],
),
),

View File

@@ -47,56 +47,14 @@ class FavNoteItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
spacing: 10,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.title ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
height: 1.4,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
const Spacer(),
Text(
item.summary ?? '',
maxLines: 1,
style: TextStyle(
fontSize: 14,
height: 1,
color: theme.colorScheme.outline,
overflow: TextOverflow.clip,
),
),
const Spacer(),
Text(
item.message ?? '',
maxLines: 1,
style: TextStyle(
fontSize: 13,
height: 1,
color: theme.colorScheme.outline,
overflow: TextOverflow.clip,
),
),
],
),
),
if (item.pic?.isNotEmpty == true) ...[
const SizedBox(width: 10),
if (item.pic?.isNotEmpty == true)
AspectRatio(
aspectRatio: StyleString.aspectRatio,
child: LayoutBuilder(
builder:
(BuildContext context, BoxConstraints boxConstraints) {
builder: (context, boxConstraints) {
return Stack(
clipBehavior: Clip.none,
children: [
@@ -161,7 +119,42 @@ class FavNoteItem extends StatelessWidget {
},
),
),
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.title ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
height: 1.4,
fontSize: 14,
),
),
const Spacer(),
Text(
item.summary ?? '',
maxLines: 1,
style: TextStyle(
fontSize: 14,
height: 1,
color: theme.colorScheme.outline,
),
),
const Spacer(),
Text(
item.message ?? '',
maxLines: 1,
style: TextStyle(
fontSize: 13,
height: 1,
color: theme.colorScheme.outline,
),
),
],
),
),
],
),
),

View File

@@ -51,7 +51,14 @@ class _FavTopicPageState extends State<FavTopicPage>
Widget _buildBody(
ThemeData theme, LoadingState<List<FavTopicItem>?> loadingState) {
return switch (loadingState) {
Loading() => const SliverToBoxAdapter(child: LinearProgressIndicator()),
Loading() => const SliverToBoxAdapter(
child: SizedBox(
height: 125,
child: Center(
child: CircularProgressIndicator(),
),
),
),
Success(:var response) => response?.isNotEmpty == true
? SliverGrid(
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(

View File

@@ -91,7 +91,7 @@ class FavVideoItem extends StatelessWidget {
),
const Spacer(),
Text(
Utils.isPublicFavText(item.attr ?? 0),
Utils.isPublicFavText(item.attr),
style: TextStyle(
fontSize: fontSize,
color: color,