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

@@ -45,19 +45,22 @@ class VideoCardHSkeleton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
color: Theme.of(context).colorScheme.onInverseSurface, color:
Theme.of(context).colorScheme.onInverseSurface,
width: 200, width: 200,
height: 11, height: 11,
margin: const EdgeInsets.only(bottom: 5), margin: const EdgeInsets.only(bottom: 5),
), ),
Container( Container(
color: Theme.of(context).colorScheme.onInverseSurface, color:
Theme.of(context).colorScheme.onInverseSurface,
width: 150, width: 150,
height: 13, height: 13,
), ),
const Spacer(), const Spacer(),
Container( Container(
color: Theme.of(context).colorScheme.onInverseSurface, color:
Theme.of(context).colorScheme.onInverseSurface,
width: 100, width: 100,
height: 13, height: 13,
margin: const EdgeInsets.only(bottom: 5), margin: const EdgeInsets.only(bottom: 5),
@@ -83,7 +86,8 @@ class VideoCardHSkeleton extends StatelessWidget {
) )
], ],
), ),
)), ),
),
], ],
), ),
); );

View File

@@ -151,7 +151,8 @@ class VideoCardH extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
), ),
@@ -176,15 +177,13 @@ class VideoCardH extends StatelessWidget {
: ''; : '';
if (pubdate != '') pubdate += ' '; if (pubdate != '') pubdate += ' ';
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (videoItem.title is String) if (videoItem.title is String)
Expanded( Expanded(
child: Text( child: Text(
videoItem.title as String, videoItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
@@ -197,20 +196,18 @@ class VideoCardH extends StatelessWidget {
) )
else else
Expanded( Expanded(
child: RichText( child: Text.rich(
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
textScaler: MediaQuery.textScalerOf(context), TextSpan(
text: TextSpan(
children: [ children: [
for (final i in videoItem.title) ...[ for (final i in videoItem.title) ...[
TextSpan( TextSpan(
text: i['text'] as String, text: i['text'] as String,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context) fontSize:
.textTheme Theme.of(context).textTheme.bodyMedium!.fontSize,
.bodyMedium! height: 1.42,
.fontSize,
letterSpacing: 0.3, letterSpacing: 0.3,
color: i['type'] == 'em' color: i['type'] == 'em'
? Theme.of(context).colorScheme.primary ? Theme.of(context).colorScheme.primary
@@ -277,7 +274,6 @@ class VideoCardH extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

View File

@@ -111,7 +111,8 @@ class VideoCardHGrpc extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
); );
}, },
@@ -133,12 +134,9 @@ class VideoCardHGrpc extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...[
Expanded( Expanded(
child: Text( child: Text(
videoItem.smallCoverV5.base.title, videoItem.smallCoverV5.base.title,
@@ -152,7 +150,6 @@ class VideoCardHGrpc extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
],
// const Spacer(), // const Spacer(),
// if (videoItem.rcmdReason != null && // if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '') // videoItem.rcmdReason.content != '')
@@ -213,7 +210,6 @@ class VideoCardHGrpc extends StatelessWidget {
// ), // ),
], ],
), ),
),
); );
} }
} }

View File

@@ -103,7 +103,8 @@ class VideoCardHMemberVideo extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
); );
}, },
@@ -125,12 +126,9 @@ class VideoCardHMemberVideo extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...[
Expanded( Expanded(
child: Text( child: Text(
// videoItem.season?['title'] ?? videoItem.title ?? '', // videoItem.season?['title'] ?? videoItem.title ?? '',
@@ -151,7 +149,6 @@ class VideoCardHMemberVideo extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
],
Text( Text(
videoItem.season != null videoItem.season != null
? Utils.dateFormat(videoItem.season?['mtime']) ? Utils.dateFormat(videoItem.season?['mtime'])
@@ -185,7 +182,6 @@ class VideoCardHMemberVideo extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

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,8 +66,6 @@ class FavItem extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -102,7 +101,6 @@ class FavItem extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

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,8 +150,6 @@ class FavVideoCardH extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Stack( child: Stack(
children: [ children: [
Column( Column(
@@ -169,8 +168,7 @@ class FavVideoCardH extends StatelessWidget {
Text( Text(
videoItem.intro, videoItem.intro,
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,
), ),
), ),
@@ -179,15 +177,13 @@ class FavVideoCardH extends StatelessWidget {
Text( Text(
Utils.dateFormat(videoItem.favTime), Utils.dateFormat(videoItem.favTime),
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11, color: Theme.of(context).colorScheme.outline),
color: Theme.of(context).colorScheme.outline),
), ),
if (videoItem.owner.name != '') ...[ if (videoItem.owner.name != '') ...[
Text( Text(
videoItem.owner.name, videoItem.owner.name,
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,
), ),
), ),
@@ -236,8 +232,7 @@ class FavVideoCardH extends StatelessWidget {
child: Text( child: Text(
'取消', '取消',
style: TextStyle( style: TextStyle(
color: color: Theme.of(context).colorScheme.outline),
Theme.of(context).colorScheme.outline),
), ),
), ),
TextButton( TextButton(
@@ -256,7 +251,6 @@ class FavVideoCardH extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

View File

@@ -291,7 +291,8 @@ class HistoryItem extends StatelessWidget {
), ),
], ],
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -303,8 +304,6 @@ class HistoryItem extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -336,8 +335,7 @@ class HistoryItem extends StatelessWidget {
Text( Text(
videoItem.authorName, 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,
), ),
), ),
@@ -349,8 +347,7 @@ class HistoryItem extends StatelessWidget {
Text( Text(
Utils.dateFormat(videoItem.viewAt!), Utils.dateFormat(videoItem.viewAt!),
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( SizedBox(
@@ -410,7 +407,6 @@ class HistoryItem extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

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,8 +68,6 @@ class SeasonSeriesCard extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -97,7 +96,6 @@ class SeasonSeriesCard extends StatelessWidget {
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,25 +153,19 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
); );
}), }),
), ),
const SizedBox(width: 10),
Expanded( Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
10, 2, 6, 0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
RichText( Text.rich(
maxLines: 2, maxLines: 2,
textScaler: TextSpan(
MediaQuery.textScalerOf(
context),
text: TextSpan(
children: [ children: [
for (var i in loadingState for (var i in loadingState
.response[index] .response[index].title) ...[
.title) ...[
TextSpan( TextSpan(
text: i['text'], text: i['text'],
style: TextStyle( style: TextStyle(
@@ -191,8 +185,8 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
const Spacer(), const Spacer(),
Text( Text(
Utils.dateFormat( Utils.dateFormat(
loadingState.response[index] loadingState
.pubTime, .response[index].pubTime,
formatType: 'detail'), formatType: 'detail'),
style: textStyle), style: textStyle),
Row( Row(
@@ -209,7 +203,6 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
], ],
), ),
), ),
),
], ],
), ),
); );

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,9 +85,7 @@ class SubItem extends StatelessWidget {
return Expanded( return Expanded(
child: Stack( child: Stack(
children: [ children: [
Padding( Column(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
@@ -117,7 +116,6 @@ class SubItem extends StatelessWidget {
const Spacer(), const Spacer(),
], ],
), ),
),
Positioned( Positioned(
bottom: 0, bottom: 0,
right: 0, right: 0,

View File

@@ -97,7 +97,8 @@ class SubVideoCardH extends StatelessWidget {
}, },
), ),
), ),
videoContent(context) const SizedBox(width: 10),
videoContent(context),
], ],
), ),
); );
@@ -109,8 +110,6 @@ class SubVideoCardH extends StatelessWidget {
Widget videoContent(context) { Widget videoContent(context) {
return Expanded( return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Stack( child: Stack(
children: [ children: [
Column( Column(
@@ -129,8 +128,7 @@ class SubVideoCardH extends StatelessWidget {
Text( Text(
Utils.dateFormat(videoItem.pubtime), Utils.dateFormat(videoItem.pubtime),
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11, color: Theme.of(context).colorScheme.outline),
color: Theme.of(context).colorScheme.outline),
), ),
Padding( Padding(
padding: const EdgeInsets.only(top: 2), padding: const EdgeInsets.only(top: 2),
@@ -155,7 +153,6 @@ class SubVideoCardH extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }

View File

@@ -182,9 +182,8 @@ class _MediaListPanelState extends State<MediaListPanel> {
}, },
), ),
), ),
const SizedBox(width: 10),
Expanded( Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -198,9 +197,7 @@ class _MediaListPanelState extends State<MediaListPanel> {
? FontWeight.bold ? FontWeight.bold
: null, : null,
color: item.bvid == widget.getBvId() color: item.bvid == widget.getBvId()
? Theme.of(context) ? Theme.of(context).colorScheme.primary
.colorScheme
.primary
: null, : null,
), ),
), ),
@@ -235,7 +232,6 @@ class _MediaListPanelState extends State<MediaListPanel> {
], ],
), ),
), ),
)
], ],
), ),
); );