opt: pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-28 21:57:57 +08:00
parent 959d4de78a
commit 5231faf254
18 changed files with 680 additions and 717 deletions

View File

@@ -39,51 +39,55 @@ class VideoCardHSkeleton extends StatelessWidget {
), ),
// VideoContent(videoItem: videoItem) // VideoContent(videoItem: videoItem)
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(10, 4, 6, 4), padding: const EdgeInsets.fromLTRB(10, 4, 6, 4),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
color: Theme.of(context).colorScheme.onInverseSurface, color:
width: 200, Theme.of(context).colorScheme.onInverseSurface,
height: 11, width: 200,
margin: const EdgeInsets.only(bottom: 5), height: 11,
), margin: const EdgeInsets.only(bottom: 5),
Container( ),
color: Theme.of(context).colorScheme.onInverseSurface, Container(
width: 150, color:
height: 13, Theme.of(context).colorScheme.onInverseSurface,
), width: 150,
const Spacer(), height: 13,
Container( ),
color: Theme.of(context).colorScheme.onInverseSurface, const Spacer(),
width: 100, Container(
height: 13, color:
margin: const EdgeInsets.only(bottom: 5), Theme.of(context).colorScheme.onInverseSurface,
), width: 100,
Row( height: 13,
children: [ margin: const EdgeInsets.only(bottom: 5),
Container( ),
color: Theme.of(context) Row(
.colorScheme children: [
.onInverseSurface, Container(
width: 40, color: Theme.of(context)
height: 13, .colorScheme
margin: const EdgeInsets.only(right: 8), .onInverseSurface,
), width: 40,
Container( height: 13,
color: Theme.of(context) margin: const EdgeInsets.only(right: 8),
.colorScheme ),
.onInverseSurface, Container(
width: 40, color: Theme.of(context)
height: 13, .colorScheme
), .onInverseSurface,
], width: 40,
) height: 13,
], ),
],
)
],
),
), ),
)), ),
], ],
), ),
); );

View File

@@ -151,7 +151,8 @@ class VideoCardH extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
), ),
@@ -176,107 +177,102 @@ class VideoCardH extends StatelessWidget {
: ''; : '';
if (pubdate != '') pubdate += ' '; if (pubdate != '') pubdate += ' ';
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, if (videoItem.title is String)
children: [ Expanded(
if (videoItem.title is String) child: Text(
Expanded( videoItem.title,
child: Text( textAlign: TextAlign.start,
videoItem.title as String, style: TextStyle(
textAlign: TextAlign.start, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
style: TextStyle( height: 1.42,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, letterSpacing: 0.3,
height: 1.42,
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
) maxLines: 2,
else overflow: TextOverflow.ellipsis,
Expanded( ),
child: RichText( )
overflow: TextOverflow.ellipsis, else
maxLines: 2, Expanded(
textScaler: MediaQuery.textScalerOf(context), child: Text.rich(
text: TextSpan( overflow: TextOverflow.ellipsis,
children: [ maxLines: 2,
for (final i in videoItem.title) ...[ TextSpan(
TextSpan( children: [
text: i['text'] as String, for (final i in videoItem.title) ...[
style: TextStyle( TextSpan(
fontSize: Theme.of(context) text: i['text'] as String,
.textTheme style: TextStyle(
.bodyMedium! fontSize:
.fontSize, Theme.of(context).textTheme.bodyMedium!.fontSize,
letterSpacing: 0.3, height: 1.42,
color: i['type'] == 'em' letterSpacing: 0.3,
? Theme.of(context).colorScheme.primary color: i['type'] == 'em'
: Theme.of(context).colorScheme.onSurface, ? Theme.of(context).colorScheme.primary
), : Theme.of(context).colorScheme.onSurface,
), ),
] ),
], ]
), ],
), ),
), ),
// const Spacer(),
// if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '')
// Container(
// padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4),
// border: Border.all(
// color: Theme.of(context).colorScheme.surfaceTint),
// ),
// child: Text(
// videoItem.rcmdReason.content,
// style: TextStyle(
// fontSize: 9,
// color: Theme.of(context).colorScheme.surfaceTint),
// ),
// ),
// const SizedBox(height: 4),
if (showOwner || showPubdate)
Expanded(
flex: 0,
child: Text(
"$pubdate ${showOwner ? videoItem.owner.name : ''}",
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
),
),
),
const SizedBox(height: 3),
Row(
children: [
if (showView) ...[
statView(
context: context,
theme: 'gray',
view: videoItem.stat.view as int,
),
const SizedBox(width: 8),
],
if (showDanmaku)
statDanMu(
context: context,
theme: 'gray',
danmu: videoItem.stat.danmu as int,
),
const Spacer(),
if (source == 'normal') const SizedBox(width: 24),
],
), ),
], // const Spacer(),
), // if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '')
// Container(
// padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4),
// border: Border.all(
// color: Theme.of(context).colorScheme.surfaceTint),
// ),
// child: Text(
// videoItem.rcmdReason.content,
// style: TextStyle(
// fontSize: 9,
// color: Theme.of(context).colorScheme.surfaceTint),
// ),
// ),
// const SizedBox(height: 4),
if (showOwner || showPubdate)
Expanded(
flex: 0,
child: Text(
"$pubdate ${showOwner ? videoItem.owner.name : ''}",
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
),
),
),
const SizedBox(height: 3),
Row(
children: [
if (showView) ...[
statView(
context: context,
theme: 'gray',
view: videoItem.stat.view as int,
),
const SizedBox(width: 8),
],
if (showDanmaku)
statDanMu(
context: context,
theme: 'gray',
danmu: videoItem.stat.danmu as int,
),
const Spacer(),
if (source == 'normal') const SizedBox(width: 24),
],
),
],
), ),
); );
} }

View File

@@ -111,7 +111,8 @@ class VideoCardHGrpc extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
); );
}, },
@@ -133,58 +134,43 @@ class VideoCardHGrpc extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: Text(
...[ videoItem.smallCoverV5.base.title,
Expanded( textAlign: TextAlign.start,
child: Text( style: TextStyle(
videoItem.smallCoverV5.base.title, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
textAlign: TextAlign.start, height: 1.42,
style: TextStyle( letterSpacing: 0.3,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
height: 1.42,
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
), ),
], maxLines: 2,
// const Spacer(), overflow: TextOverflow.ellipsis,
// if (videoItem.rcmdReason != null && ),
// videoItem.rcmdReason.content != '') ),
// Container( // const Spacer(),
// padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), // if (videoItem.rcmdReason != null &&
// decoration: BoxDecoration( // videoItem.rcmdReason.content != '')
// borderRadius: BorderRadius.circular(4), // Container(
// border: Border.all( // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5),
// color: Theme.of(context).colorScheme.surfaceTint), // decoration: BoxDecoration(
// ), // borderRadius: BorderRadius.circular(4),
// child: Text( // border: Border.all(
// videoItem.rcmdReason.content, // color: Theme.of(context).colorScheme.surfaceTint),
// style: TextStyle( // ),
// fontSize: 9, // child: Text(
// color: Theme.of(context).colorScheme.surfaceTint), // videoItem.rcmdReason.content,
// ), // style: TextStyle(
// ), // fontSize: 9,
// const SizedBox(height: 4), // color: Theme.of(context).colorScheme.surfaceTint),
if (showOwner || showPubdate) // ),
Text( // ),
videoItem.smallCoverV5.rightDesc1, // const SizedBox(height: 4),
maxLines: 1, if (showOwner || showPubdate)
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
),
),
const SizedBox(height: 3),
Text( Text(
videoItem.smallCoverV5.rightDesc2, videoItem.smallCoverV5.rightDesc1,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
@@ -193,26 +179,36 @@ class VideoCardHGrpc extends StatelessWidget {
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
), ),
), ),
// Row( const SizedBox(height: 3),
// children: [ Text(
// if (showView) ...[ videoItem.smallCoverV5.rightDesc2,
// StatView( maxLines: 1,
// theme: 'gray', style: TextStyle(
// view: videoItem.stat.view as int, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
// ), height: 1,
// const SizedBox(width: 8), color: Theme.of(context).colorScheme.outline,
// ], overflow: TextOverflow.clip,
// if (showDanmaku) ),
// StatDanMu( ),
// theme: 'gray', // Row(
// danmu: videoItem.stat.danmu as int, // children: [
// ), // if (showView) ...[
// const Spacer(), // StatView(
// if (source == 'normal') const SizedBox(width: 24), // theme: 'gray',
// ], // view: videoItem.stat.view as int,
// ), // ),
], // const SizedBox(width: 8),
), // ],
// if (showDanmaku)
// StatDanMu(
// theme: 'gray',
// danmu: videoItem.stat.danmu as int,
// ),
// const Spacer(),
// if (source == 'normal') const SizedBox(width: 24),
// ],
// ),
],
), ),
); );
} }

View File

@@ -103,7 +103,8 @@ class VideoCardHMemberVideo extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
); );
}, },
@@ -125,66 +126,61 @@ class VideoCardHMemberVideo extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
children: [ child: Text(
...[ // videoItem.season?['title'] ?? videoItem.title ?? '',
Expanded( videoItem.title ?? '',
child: Text( textAlign: TextAlign.start,
// videoItem.season?['title'] ?? videoItem.title ?? '', style: TextStyle(
videoItem.title ?? '', fontWeight: videoItem.bvid != null && videoItem.bvid == bvid
textAlign: TextAlign.start, ? FontWeight.bold
style: TextStyle( : null,
fontWeight: videoItem.bvid != null && videoItem.bvid == bvid fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
? FontWeight.bold height: 1.42,
: null, letterSpacing: 0.3,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, color: videoItem.bvid != null && videoItem.bvid == bvid
height: 1.42, ? Theme.of(context).colorScheme.primary
letterSpacing: 0.3, : null,
color: videoItem.bvid != null && videoItem.bvid == bvid ),
? Theme.of(context).colorScheme.primary maxLines: 2,
: null, overflow: TextOverflow.ellipsis,
), ),
maxLines: 2, ),
overflow: TextOverflow.ellipsis, Text(
), videoItem.season != null
? Utils.dateFormat(videoItem.season?['mtime'])
: videoItem.publishTimeText ?? '',
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
),
),
const SizedBox(height: 3),
Row(
children: [
statView(
context: context,
theme: 'gray',
// view: videoItem.season?['view_content'] ??
// videoItem.viewContent,
view: videoItem.viewContent,
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
// danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku,
danmu: videoItem.danmaku,
), ),
], ],
Text( ),
videoItem.season != null ],
? Utils.dateFormat(videoItem.season?['mtime'])
: videoItem.publishTimeText ?? '',
maxLines: 1,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
),
),
const SizedBox(height: 3),
Row(
children: [
statView(
context: context,
theme: 'gray',
// view: videoItem.season?['view_content'] ??
// videoItem.viewContent,
view: videoItem.viewContent,
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
// danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku,
danmu: videoItem.danmaku,
),
],
),
],
),
), ),
); );
} }

View File

@@ -314,10 +314,9 @@ class VideoCardV extends StatelessWidget {
const Spacer(), const Spacer(),
Expanded( Expanded(
flex: 0, flex: 0,
child: RichText( child: Text.rich(
maxLines: 1, maxLines: 1,
textScaler: MediaQuery.textScalerOf(context), TextSpan(
text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize, Theme.of(context).textTheme.labelSmall!.fontSize,
@@ -337,10 +336,9 @@ class VideoCardV extends StatelessWidget {
const Spacer(), const Spacer(),
Expanded( Expanded(
flex: 0, flex: 0,
child: RichText( child: Text.rich(
maxLines: 1, maxLines: 1,
textScaler: MediaQuery.textScalerOf(context), TextSpan(
text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize, Theme.of(context).textTheme.labelSmall!.fontSize,

View File

@@ -53,7 +53,8 @@ class FavItem extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -65,43 +66,40 @@ class FavItem extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ favFolderItem.title ?? '',
Text( textAlign: TextAlign.start,
favFolderItem.title ?? '', style: const TextStyle(
textAlign: TextAlign.start, letterSpacing: 0.3,
style: const TextStyle(
letterSpacing: 0.3,
),
), ),
if (favFolderItem.intro?.isNotEmpty == true) ),
Text( if (favFolderItem.intro?.isNotEmpty == true)
favFolderItem.intro!,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
Text( Text(
'${favFolderItem.mediaCount}个内容', favFolderItem.intro!,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
), ),
), ),
const Spacer(), Text(
Text( '${favFolderItem.mediaCount}个内容',
Utils.isPublicText(favFolderItem.attr ?? 0), style: TextStyle(
style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline,
color: Theme.of(context).colorScheme.outline,
),
), ),
], ),
), const Spacer(),
Text(
Utils.isPublicText(favFolderItem.attr ?? 0),
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
],
), ),
); );
} }

View File

@@ -61,6 +61,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
} }
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: Obx( floatingActionButton: Obx(
() => (_favDetailController.item.value.mediaCount ?? -1) > 0 () => (_favDetailController.item.value.mediaCount ?? -1) > 0
? FloatingActionButton.extended( ? FloatingActionButton.extended(

View File

@@ -137,7 +137,8 @@ class FavVideoCardH extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -149,113 +150,106 @@ class FavVideoCardH extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Stack(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), children: [
child: Stack( Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ videoItem.title,
Text( textAlign: TextAlign.start,
videoItem.title, style: const TextStyle(
textAlign: TextAlign.start, letterSpacing: 0.3,
style: const TextStyle(
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
if (videoItem.ogv != null) ...[ maxLines: 2,
Text( overflow: TextOverflow.ellipsis,
videoItem.intro, ),
style: TextStyle( if (videoItem.ogv != null) ...[
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
],
const Spacer(),
Text( Text(
Utils.dateFormat(videoItem.favTime), videoItem.intro,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline), color: Theme.of(context).colorScheme.outline,
),
if (videoItem.owner.name != '') ...[
Text(
videoItem.owner.name,
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
],
Padding(
padding: const EdgeInsets.only(top: 2),
child: Row(
children: [
statView(
context: context,
theme: 'gray',
view: videoItem.cntInfo['play'],
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
danmu: videoItem.cntInfo['danmaku'],
),
const Spacer(),
],
), ),
), ),
], ],
), const Spacer(),
if (searchType != 1 && isOwner) Text(
Positioned( Utils.dateFormat(videoItem.favTime),
right: 0, style: TextStyle(
bottom: 0, fontSize: 11, color: Theme.of(context).colorScheme.outline),
child: iconButton( ),
context: context, if (videoItem.owner.name != '') ...[
icon: Icons.clear, Text(
tooltip: '取消收藏', videoItem.owner.name,
iconColor: Theme.of(context).colorScheme.onSurfaceVariant, style: TextStyle(
bgColor: Colors.transparent, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
onPressed: () { color: Theme.of(context).colorScheme.outline,
showDialog( ),
context: Get.context!, ),
builder: (context) { ],
return AlertDialog( Padding(
title: const Text('提示'), padding: const EdgeInsets.only(top: 2),
content: const Text('要取消收藏吗?'), child: Row(
actions: [ children: [
TextButton( statView(
onPressed: Get.back, context: context,
child: Text( theme: 'gray',
'取消', view: videoItem.cntInfo['play'],
style: TextStyle( ),
color: const SizedBox(width: 8),
Theme.of(context).colorScheme.outline), statDanMu(
), context: context,
), theme: 'gray',
TextButton( danmu: videoItem.cntInfo['danmaku'],
onPressed: () async { ),
await callFn?.call(); const Spacer(),
Get.back(); ],
},
child: const Text('确定取消'),
)
],
);
},
);
},
), ),
), ),
], ],
), ),
if (searchType != 1 && isOwner)
Positioned(
right: 0,
bottom: 0,
child: iconButton(
context: context,
icon: Icons.clear,
tooltip: '取消收藏',
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
bgColor: Colors.transparent,
onPressed: () {
showDialog(
context: Get.context!,
builder: (context) {
return AlertDialog(
title: const Text('提示'),
content: const Text('要取消收藏吗?'),
actions: [
TextButton(
onPressed: Get.back,
child: Text(
'取消',
style: TextStyle(
color: Theme.of(context).colorScheme.outline),
),
),
TextButton(
onPressed: () async {
await callFn?.call();
Get.back();
},
child: const Text('确定取消'),
)
],
);
},
);
},
),
),
],
), ),
); );
} }

View File

@@ -291,7 +291,8 @@ class HistoryItem extends StatelessWidget {
), ),
], ],
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -303,113 +304,108 @@ class HistoryItem extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ videoItem.title,
textAlign: TextAlign.start,
style: const TextStyle(
letterSpacing: 0.3,
),
maxLines: videoItem.videos > 1 ? 1 : 2,
overflow: TextOverflow.ellipsis,
),
if (videoItem.isFullScreen != null) ...[
const SizedBox(height: 2),
Text( Text(
videoItem.title, videoItem.isFullScreen,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: const TextStyle( style: TextStyle(
letterSpacing: 0.3, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
), color: Theme.of(context).colorScheme.outline),
maxLines: videoItem.videos > 1 ? 1 : 2, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
if (videoItem.isFullScreen != null) ...[ ],
const SizedBox(height: 2), const Spacer(),
Text( if (videoItem.authorName != '')
videoItem.isFullScreen,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
const Spacer(),
if (videoItem.authorName != '')
Row(
children: [
Text(
videoItem.authorName,
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
],
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
Utils.dateFormat(videoItem.viewAt!), videoItem.authorName,
style: TextStyle( style: TextStyle(
fontSize: fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline,
color: Theme.of(context).colorScheme.outline),
),
SizedBox(
width: 24,
height: 24,
child: PopupMenuButton<String>(
padding: EdgeInsets.zero,
tooltip: '功能菜单',
icon: Icon(
Icons.more_vert_outlined,
color: Theme.of(context).colorScheme.outline,
size: 18,
),
position: PopupMenuPosition.under,
// constraints: const BoxConstraints(maxHeight: 35),
onSelected: (String type) {},
itemBuilder: (BuildContext context) =>
<PopupMenuEntry<String>>[
if (videoItem.history?.business != 'pgc' &&
videoItem.badge != '番剧' &&
!videoItem.tagName.contains('动画') &&
videoItem.history.business != 'live' &&
!videoItem.history.business.contains('article'))
PopupMenuItem<String>(
onTap: () async {
var res = await UserHttp.toViewLater(
bvid: videoItem.history.bvid);
SmartDialog.showToast(res['msg']);
},
value: 'pause',
height: 35,
child: const Row(
children: [
Icon(Icons.watch_later_outlined, size: 16),
SizedBox(width: 6),
Text('稍后再看', style: TextStyle(fontSize: 13))
],
),
),
PopupMenuItem<String>(
onTap: () => ctr!.delHistory(
videoItem.kid, videoItem.history.business),
value: 'pause',
height: 35,
child: const Row(
children: [
Icon(Icons.close_outlined, size: 16),
SizedBox(width: 6),
Text('删除记录', style: TextStyle(fontSize: 13))
],
),
),
],
), ),
), ),
], ],
), ),
], Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
Utils.dateFormat(videoItem.viewAt!),
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline),
),
SizedBox(
width: 24,
height: 24,
child: PopupMenuButton<String>(
padding: EdgeInsets.zero,
tooltip: '功能菜单',
icon: Icon(
Icons.more_vert_outlined,
color: Theme.of(context).colorScheme.outline,
size: 18,
),
position: PopupMenuPosition.under,
// constraints: const BoxConstraints(maxHeight: 35),
onSelected: (String type) {},
itemBuilder: (BuildContext context) =>
<PopupMenuEntry<String>>[
if (videoItem.history?.business != 'pgc' &&
videoItem.badge != '番剧' &&
!videoItem.tagName.contains('动画') &&
videoItem.history.business != 'live' &&
!videoItem.history.business.contains('article'))
PopupMenuItem<String>(
onTap: () async {
var res = await UserHttp.toViewLater(
bvid: videoItem.history.bvid);
SmartDialog.showToast(res['msg']);
},
value: 'pause',
height: 35,
child: const Row(
children: [
Icon(Icons.watch_later_outlined, size: 16),
SizedBox(width: 6),
Text('稍后再看', style: TextStyle(fontSize: 13))
],
),
),
PopupMenuItem<String>(
onTap: () => ctr!.delHistory(
videoItem.kid, videoItem.history.business),
value: 'pause',
height: 35,
child: const Row(
children: [
Icon(Icons.close_outlined, size: 16),
SizedBox(width: 6),
Text('删除记录', style: TextStyle(fontSize: 13))
],
),
),
],
),
),
],
),
],
), ),
); );
} }

View File

@@ -34,6 +34,7 @@ class _LaterPageState extends State<LaterPage> {
} }
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBarWidget( appBar: AppBarWidget(
visible: _laterController.enableMultiSelect.value, visible: _laterController.enableMultiSelect.value,
child1: AppBar( child1: AppBar(

View File

@@ -58,7 +58,8 @@ class SeasonSeriesCard extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
), ),
@@ -67,36 +68,33 @@ class SeasonSeriesCard extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ item['meta']['name'],
Text( textAlign: TextAlign.start,
item['meta']['name'], style: TextStyle(
textAlign: TextAlign.start, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
style: TextStyle( height: 1.42,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, letterSpacing: 0.3,
height: 1.42,
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
const Spacer(), maxLines: 2,
Text( overflow: TextOverflow.ellipsis,
Utils.dateFormat(item['meta']['ptime']), ),
maxLines: 1, const Spacer(),
style: TextStyle( Text(
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, Utils.dateFormat(item['meta']['ptime']),
height: 1, maxLines: 1,
color: Theme.of(context).colorScheme.outline, style: TextStyle(
overflow: TextOverflow.clip, fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
), height: 1,
color: Theme.of(context).colorScheme.outline,
overflow: TextOverflow.clip,
), ),
const Spacer(), ),
], const Spacer(),
), ],
), ),
); );
} }

View File

@@ -69,7 +69,11 @@ class _SearchPanelState extends State<SearchPanel>
SliverGrid( SliverGrid(
gridDelegate: SliverGridDelegateWithExtentAndRatio( gridDelegate: SliverGridDelegateWithExtentAndRatio(
mainAxisSpacing: 2, mainAxisSpacing: 2,
maxCrossAxisExtent: Grid.smallCardWidth * 2, maxCrossAxisExtent: (widget.searchType == SearchType.video ||
widget.searchType == SearchType.article
? Grid.mediumCardWidth
: Grid.smallCardWidth) *
2,
childAspectRatio: StyleString.aspectRatio * childAspectRatio: StyleString.aspectRatio *
(widget.searchType == SearchType.media_bangumi || (widget.searchType == SearchType.media_bangumi ||
widget.searchType == SearchType.media_ft widget.searchType == SearchType.media_ft

View File

@@ -153,61 +153,54 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
); );
}), }),
), ),
const SizedBox(width: 10),
Expanded( Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB( mainAxisSize: MainAxisSize.min,
10, 2, 6, 0), crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, children: [
crossAxisAlignment: Text.rich(
CrossAxisAlignment.start, maxLines: 2,
children: [ TextSpan(
RichText(
maxLines: 2,
textScaler:
MediaQuery.textScalerOf(
context),
text: TextSpan(
children: [
for (var i in loadingState
.response[index]
.title) ...[
TextSpan(
text: i['text'],
style: TextStyle(
color: i['type'] == 'em'
? Theme.of(context)
.colorScheme
.primary
: Theme.of(context)
.colorScheme
.onSurface,
),
),
]
],
),
),
const Spacer(),
Text(
Utils.dateFormat(
loadingState.response[index]
.pubTime,
formatType: 'detail'),
style: textStyle),
Row(
children: [ children: [
Text( for (var i in loadingState
'${loadingState.response[index].view}浏览', .response[index].title) ...[
style: textStyle), TextSpan(
Text('', style: textStyle), text: i['text'],
Text( style: TextStyle(
'${loadingState.response[index].reply}评论', color: i['type'] == 'em'
style: textStyle), ? Theme.of(context)
.colorScheme
.primary
: Theme.of(context)
.colorScheme
.onSurface,
),
),
]
], ],
), ),
], ),
), const Spacer(),
Text(
Utils.dateFormat(
loadingState
.response[index].pubTime,
formatType: 'detail'),
style: textStyle),
Row(
children: [
Text(
'${loadingState.response[index].view}浏览',
style: textStyle),
Text('', style: textStyle),
Text(
'${loadingState.response[index].reply}评论',
style: textStyle),
],
),
],
), ),
), ),
], ],

View File

@@ -127,9 +127,8 @@ class LiveContent extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
RichText( Text.rich(
textScaler: MediaQuery.textScalerOf(context), TextSpan(
text: TextSpan(
children: [ children: [
for (var i in liveItem.title) ...[ for (var i in liveItem.title) ...[
TextSpan( TextSpan(

View File

@@ -75,12 +75,10 @@ Widget searchBangumiPanel(context, ctr, LoadingState loadingState) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
const SizedBox(height: 4), const SizedBox(height: 4),
RichText( Text.rich(
// maxLines: 1, // maxLines: 1,
// overflow: TextOverflow.ellipsis, // overflow: TextOverflow.ellipsis,
textScaler: TextSpan(
MediaQuery.textScalerOf(context),
text: TextSpan(
style: TextStyle( style: TextStyle(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme

View File

@@ -62,7 +62,8 @@ class SubItem extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -84,39 +85,36 @@ class SubItem extends StatelessWidget {
return Expanded( return Expanded(
child: Stack( child: Stack(
children: [ children: [
Padding( Column(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ subFolderItem.title!,
Text( textAlign: TextAlign.start,
subFolderItem.title!, style: const TextStyle(
textAlign: TextAlign.start, letterSpacing: 0.3,
style: const TextStyle(
letterSpacing: 0.3,
),
), ),
const SizedBox(height: 2), ),
Text( const SizedBox(height: 2),
'[$typeString] UP主${subFolderItem.upper!.name!}', Text(
textAlign: TextAlign.start, '[$typeString] UP主${subFolderItem.upper!.name!}',
style: TextStyle( textAlign: TextAlign.start,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, style: TextStyle(
color: Theme.of(context).colorScheme.outline, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
), color: Theme.of(context).colorScheme.outline,
), ),
const SizedBox(height: 2), ),
Text( const SizedBox(height: 2),
'${subFolderItem.mediaCount}个视频', Text(
textAlign: TextAlign.start, '${subFolderItem.mediaCount}个视频',
style: TextStyle( textAlign: TextAlign.start,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, style: TextStyle(
color: Theme.of(context).colorScheme.outline, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
), color: Theme.of(context).colorScheme.outline,
), ),
const Spacer(), ),
], const Spacer(),
), ],
), ),
Positioned( Positioned(
bottom: 0, bottom: 0,

View File

@@ -97,7 +97,8 @@ class SubVideoCardH extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -109,52 +110,48 @@ class SubVideoCardH extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding( child: Stack(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), children: [
child: Stack( Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ '${videoItem.title}',
Text( textAlign: TextAlign.start,
'${videoItem.title}', style: const TextStyle(
textAlign: TextAlign.start, letterSpacing: 0.3,
style: const TextStyle(
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
const Spacer(), maxLines: 2,
Text( overflow: TextOverflow.ellipsis,
Utils.dateFormat(videoItem.pubtime), ),
style: TextStyle( const Spacer(),
fontSize: 11, Text(
color: Theme.of(context).colorScheme.outline), Utils.dateFormat(videoItem.pubtime),
style: TextStyle(
fontSize: 11, color: Theme.of(context).colorScheme.outline),
),
Padding(
padding: const EdgeInsets.only(top: 2),
child: Row(
children: [
statView(
context: context,
theme: 'gray',
view: videoItem.cntInfo?['play'],
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
danmu: videoItem.cntInfo?['danmaku'],
),
const Spacer(),
],
), ),
Padding( ),
padding: const EdgeInsets.only(top: 2), ],
child: Row( ),
children: [ ],
statView(
context: context,
theme: 'gray',
view: videoItem.cntInfo?['play'],
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
danmu: videoItem.cntInfo?['danmaku'],
),
const Spacer(),
],
),
),
],
),
],
),
), ),
); );
} }

View File

@@ -182,60 +182,56 @@ class _MediaListPanelState extends State<MediaListPanel> {
}, },
), ),
), ),
const SizedBox(width: 10),
Expanded( Expanded(
child: Padding( child: Column(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ item.title as String,
Text( textAlign: TextAlign.start,
item.title as String, maxLines: 2,
textAlign: TextAlign.start, overflow: TextOverflow.ellipsis,
maxLines: 2, style: TextStyle(
overflow: TextOverflow.ellipsis, fontWeight: item.bvid == widget.getBvId()
style: TextStyle( ? FontWeight.bold
fontWeight: item.bvid == widget.getBvId() : null,
? FontWeight.bold color: item.bvid == widget.getBvId()
: null, ? Theme.of(context).colorScheme.primary
color: item.bvid == widget.getBvId() : null,
? Theme.of(context) ),
.colorScheme ),
.primary const Spacer(),
: null, Text(
item.upper?.name as String,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelMedium!
.fontSize,
color:
Theme.of(context).colorScheme.outline,
),
),
const SizedBox(height: 2),
Row(
children: [
statView(
context: context,
theme: 'gray',
view: item.cntInfo!['play'] as int,
), ),
), const SizedBox(width: 8),
const Spacer(), statDanMu(
Text( context: context,
item.upper?.name as String, theme: 'gray',
style: TextStyle( danmu: item.cntInfo!['danmaku'] as int,
fontSize: Theme.of(context)
.textTheme
.labelMedium!
.fontSize,
color:
Theme.of(context).colorScheme.outline,
), ),
), ],
const SizedBox(height: 2), ),
Row( ],
children: [
statView(
context: context,
theme: 'gray',
view: item.cntInfo!['play'] as int,
),
const SizedBox(width: 8),
statDanMu(
context: context,
theme: 'gray',
danmu: item.cntInfo!['danmaku'] as int,
),
],
),
],
),
), ),
) ),
], ],
), ),
); );