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,
children: [
Container(
color: Theme.of(context).colorScheme.onInverseSurface,
color:
Theme.of(context).colorScheme.onInverseSurface,
width: 200,
height: 11,
margin: const EdgeInsets.only(bottom: 5),
),
Container(
color: Theme.of(context).colorScheme.onInverseSurface,
color:
Theme.of(context).colorScheme.onInverseSurface,
width: 150,
height: 13,
),
const Spacer(),
Container(
color: Theme.of(context).colorScheme.onInverseSurface,
color:
Theme.of(context).colorScheme.onInverseSurface,
width: 100,
height: 13,
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 += ' ';
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (videoItem.title is String)
Expanded(
child: Text(
videoItem.title as String,
videoItem.title,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
@@ -197,20 +196,18 @@ class VideoCardH extends StatelessWidget {
)
else
Expanded(
child: RichText(
child: Text.rich(
overflow: TextOverflow.ellipsis,
maxLines: 2,
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
TextSpan(
children: [
for (final i in videoItem.title) ...[
TextSpan(
text: i['text'] as String,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.bodyMedium!
.fontSize,
fontSize:
Theme.of(context).textTheme.bodyMedium!.fontSize,
height: 1.42,
letterSpacing: 0.3,
color: i['type'] == 'em'
? 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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...[
Expanded(
child: Text(
videoItem.smallCoverV5.base.title,
@@ -152,7 +150,6 @@ class VideoCardHGrpc extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
),
],
// const Spacer(),
// if (videoItem.rcmdReason != null &&
// 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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...[
Expanded(
child: Text(
// videoItem.season?['title'] ?? videoItem.title ?? '',
@@ -151,7 +149,6 @@ class VideoCardHMemberVideo extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
),
],
Text(
videoItem.season != null
? 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(),
Expanded(
flex: 0,
child: RichText(
child: Text.rich(
maxLines: 1,
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
TextSpan(
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize,
@@ -337,10 +336,9 @@ class VideoCardV extends StatelessWidget {
const Spacer(),
Expanded(
flex: 0,
child: RichText(
child: Text.rich(
maxLines: 1,
textScaler: MediaQuery.textScalerOf(context),
text: TextSpan(
TextSpan(
style: TextStyle(
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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -102,7 +101,6 @@ class FavItem extends StatelessWidget {
),
],
),
),
);
}
}

View File

@@ -61,6 +61,7 @@ class _FavDetailPageState extends State<FavDetailPage> {
}
},
child: Scaffold(
resizeToAvoidBottomInset: false,
floatingActionButton: Obx(
() => (_favDetailController.item.value.mediaCount ?? -1) > 0
? 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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Stack(
children: [
Column(
@@ -169,8 +168,7 @@ class FavVideoCardH extends StatelessWidget {
Text(
videoItem.intro,
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
@@ -179,15 +177,13 @@ class FavVideoCardH extends StatelessWidget {
Text(
Utils.dateFormat(videoItem.favTime),
style: TextStyle(
fontSize: 11,
color: Theme.of(context).colorScheme.outline),
fontSize: 11, color: Theme.of(context).colorScheme.outline),
),
if (videoItem.owner.name != '') ...[
Text(
videoItem.owner.name,
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
@@ -236,8 +232,7 @@ class FavVideoCardH extends StatelessWidget {
child: Text(
'取消',
style: TextStyle(
color:
Theme.of(context).colorScheme.outline),
color: Theme.of(context).colorScheme.outline),
),
),
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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -336,8 +335,7 @@ class HistoryItem extends StatelessWidget {
Text(
videoItem.authorName,
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
@@ -349,8 +347,7 @@ class HistoryItem extends StatelessWidget {
Text(
Utils.dateFormat(videoItem.viewAt!),
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline),
),
SizedBox(
@@ -410,7 +407,6 @@ class HistoryItem extends StatelessWidget {
),
],
),
),
);
}
}

View File

@@ -34,6 +34,7 @@ class _LaterPageState extends State<LaterPage> {
}
},
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBarWidget(
visible: _laterController.enableMultiSelect.value,
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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -97,7 +96,6 @@ class SeasonSeriesCard extends StatelessWidget {
const Spacer(),
],
),
),
);
}
}

View File

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

View File

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

View File

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

View File

@@ -75,12 +75,10 @@ Widget searchBangumiPanel(context, ctr, LoadingState loadingState) {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4),
RichText(
Text.rich(
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
textScaler:
MediaQuery.textScalerOf(context),
text: TextSpan(
TextSpan(
style: TextStyle(
color: Theme.of(context)
.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(
child: Stack(
children: [
Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
@@ -117,7 +116,6 @@ class SubItem extends StatelessWidget {
const Spacer(),
],
),
),
Positioned(
bottom: 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) {
return Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 2, 6, 0),
child: Stack(
children: [
Column(
@@ -129,8 +128,7 @@ class SubVideoCardH extends StatelessWidget {
Text(
Utils.dateFormat(videoItem.pubtime),
style: TextStyle(
fontSize: 11,
color: Theme.of(context).colorScheme.outline),
fontSize: 11, color: Theme.of(context).colorScheme.outline),
),
Padding(
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(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -198,9 +197,7 @@ class _MediaListPanelState extends State<MediaListPanel> {
? FontWeight.bold
: null,
color: item.bvid == widget.getBvId()
? Theme.of(context)
.colorScheme
.primary
? Theme.of(context).colorScheme.primary
: null,
),
),
@@ -235,7 +232,6 @@ class _MediaListPanelState extends State<MediaListPanel> {
],
),
),
)
],
),
);