mod: 样式修改

This commit is contained in:
guozhigq
2023-07-25 20:01:57 +08:00
parent 4e6cf1c2f2
commit f59354954d
14 changed files with 182 additions and 122 deletions

View File

@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
class StyleString { class StyleString {
static const double cardSpace = 8; static const double cardSpace = 8;
static const double safeSpace = 14; static const double safeSpace = 12;
static BorderRadius mdRadius = BorderRadius.circular(16); static BorderRadius mdRadius = BorderRadius.circular(10);
static const Radius imgRadius = Radius.circular(16); static const Radius imgRadius = Radius.circular(10);
static const double aspectRatio = 16 / 10; static const double aspectRatio = 16 / 10;
} }

View File

@ -53,7 +53,7 @@ class VideoCardVSkeleton extends StatelessWidget {
), ),
Container( Container(
width: 80, width: 80,
height: 13, height: 12,
color: Theme.of(context).colorScheme.background, color: Theme.of(context).colorScheme.background,
), ),
], ],

View File

@ -136,7 +136,7 @@ class VideoContent extends StatelessWidget {
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
letterSpacing: 0.3, letterSpacing: 0.3,
), ),
maxLines: 2, maxLines: 2,

View File

@ -118,7 +118,7 @@ class VideoContent extends StatelessWidget {
return Expanded( return Expanded(
child: Padding( child: Padding(
// 多列 // 多列
padding: const EdgeInsets.fromLTRB(4, 5, 6, 12), padding: const EdgeInsets.fromLTRB(4, 5, 6, 10),
// 单列 // 单列
// padding: const EdgeInsets.fromLTRB(14, 10, 4, 8), // padding: const EdgeInsets.fromLTRB(14, 10, 4, 8),
child: Column( child: Column(
@ -130,91 +130,91 @@ class VideoContent extends StatelessWidget {
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
letterSpacing: 0.3, letterSpacing: 0.3,
), ),
maxLines: Get.find<RcmdController>().crossAxisCount, maxLines: Get.find<RcmdController>().crossAxisCount,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
// SizedBox( SizedBox(
// height: 18, height: 18,
// child: Row( child: Row(
// children: [ children: [
// if (videoItem.rcmdReason != null && if (videoItem.rcmdReason != null &&
// videoItem.rcmdReason.content != '') ...[ videoItem.rcmdReason.content != '') ...[
// Container( Container(
// padding: const EdgeInsets.fromLTRB(3, 1, 3, 1), padding: const EdgeInsets.fromLTRB(3, 1, 3, 1),
// decoration: BoxDecoration( decoration: BoxDecoration(
// color: Theme.of(context) color: Theme.of(context)
// .colorScheme .colorScheme
// .primaryContainer .primaryContainer
// .withOpacity(0.6), .withOpacity(0.6),
// borderRadius: BorderRadius.circular(3)), borderRadius: BorderRadius.circular(3)),
// child: Text( child: Text(
// videoItem.rcmdReason.content, videoItem.rcmdReason.content,
// style: TextStyle( style: TextStyle(
// fontSize: fontSize:
// Theme.of(context).textTheme.labelSmall!.fontSize, Theme.of(context).textTheme.labelSmall!.fontSize,
// color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
// ), ),
// ), ),
// ), ),
// const SizedBox(width: 4) const SizedBox(width: 4)
// ] else if (videoItem.isFollowed == 1) ...[ ] else if (videoItem.isFollowed == 1) ...[
// Container( Container(
// padding: const EdgeInsets.fromLTRB(3, 1, 3, 1), padding: const EdgeInsets.fromLTRB(3, 1, 3, 1),
// decoration: BoxDecoration( decoration: BoxDecoration(
// color: Theme.of(context) color: Theme.of(context)
// .colorScheme .colorScheme
// .primaryContainer .primaryContainer
// .withOpacity(0.6), .withOpacity(0.6),
// borderRadius: BorderRadius.circular(3)), borderRadius: BorderRadius.circular(3)),
// child: Text( child: Text(
// '已关注', '已关注',
// style: TextStyle( style: TextStyle(
// fontSize: fontSize:
// Theme.of(context).textTheme.labelSmall!.fontSize, Theme.of(context).textTheme.labelSmall!.fontSize,
// color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
// ), ),
// ), ),
// ), ),
// const SizedBox(width: 4) const SizedBox(width: 4)
// ], ],
// Expanded( Expanded(
// child: LayoutBuilder(builder: child: LayoutBuilder(builder:
// (BuildContext context, BoxConstraints constraints) { (BuildContext context, BoxConstraints constraints) {
// return SizedBox( return SizedBox(
// width: constraints.maxWidth, width: constraints.maxWidth,
// child: Text( child: Text(
// videoItem.owner.name, videoItem.owner.name,
// maxLines: 1, maxLines: 1,
// style: TextStyle( style: TextStyle(
// fontSize: Theme.of(context) fontSize: Theme.of(context)
// .textTheme .textTheme
// .labelMedium! .labelMedium!
// .fontSize, .fontSize,
// color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
// ), ),
// ), ),
// ); );
// }), }),
// ), ),
// ], ],
// ), ),
// ),
Row(
children: [
StatView(
theme: 'black',
view: videoItem.stat.view,
),
const SizedBox(width: 6),
StatDanMu(
theme: 'black',
danmu: videoItem.stat.danmaku,
),
],
), ),
// Row(
// children: [
// StatView(
// theme: 'black',
// view: videoItem.stat.view,
// ),
// const SizedBox(width: 6),
// StatDanMu(
// theme: 'black',
// danmu: videoItem.stat.danmaku,
// ),
// ],
// ),
], ],
), ),
), ),

View File

@ -77,8 +77,12 @@ class _DynamicDetailPageState extends State<DynamicDetailPage> {
Get.to( Get.to(
() => Scaffold( () => Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('评论详情'), titleSpacing: 0,
centerTitle: false, centerTitle: false,
title: Text(
'评论详情',
style: Theme.of(context).textTheme.titleMedium,
),
), ),
body: VideoReplyReplyPanel( body: VideoReplyReplyPanel(
oid: oid, oid: oid,

View File

@ -136,8 +136,10 @@ class VideoContent extends StatelessWidget {
videoItem.title, videoItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.titleSmall!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500,
letterSpacing: 0.3,
),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),

View File

@ -43,8 +43,12 @@ class _FollowPageState extends State<FollowPage> {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
scrolledUnderElevation: 0, scrolledUnderElevation: 0,
titleSpacing: 0,
centerTitle: false, centerTitle: false,
title: const Text('我的关注'), title: Text(
'我的关注',
style: Theme.of(context).textTheme.titleMedium,
),
), ),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: () async => onRefresh: () async =>

View File

@ -152,8 +152,10 @@ class VideoContent extends StatelessWidget {
videoItem.title, videoItem.title,
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.titleSmall!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500,
letterSpacing: 0.3,
),
maxLines: videoItem.videos > 1 ? 1 : 2, maxLines: videoItem.videos > 1 ? 1 : 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),

View File

@ -29,7 +29,7 @@ class _HomePageState extends State<HomePage>
appBar: AppBar( appBar: AppBar(
titleSpacing: 0, titleSpacing: 0,
title: Padding( title: Padding(
padding: const EdgeInsets.only(left: 12, right: 12, bottom: 8), padding: const EdgeInsets.only(left: 12, right: 12, bottom: 0),
child: Stack( child: Stack(
children: [ children: [
const Align( const Align(
@ -79,12 +79,15 @@ class _HomePageState extends State<HomePage>
indicatorPadding: const EdgeInsets.symmetric( indicatorPadding: const EdgeInsets.symmetric(
horizontal: 4, vertical: 5), horizontal: 4, vertical: 5),
indicator: BoxDecoration( indicator: BoxDecoration(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context)
.colorScheme
.primaryContainer
.withOpacity(0.8),
borderRadius: borderRadius:
const BorderRadius.all(Radius.circular(20)), const BorderRadius.all(Radius.circular(20)),
), ),
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).colorScheme.onPrimary, labelColor: Theme.of(context).colorScheme.primary,
labelStyle: const TextStyle(fontSize: 13), labelStyle: const TextStyle(fontSize: 13),
dividerColor: Colors.transparent, dividerColor: Colors.transparent,
unselectedLabelColor: unselectedLabelColor:

View File

@ -26,8 +26,12 @@ class _LaterPageState extends State<LaterPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('稍后再看'), titleSpacing: 0,
centerTitle: false, centerTitle: false,
title: Text(
'稍后再看',
style: Theme.of(context).textTheme.titleMedium,
),
), ),
body: CustomScrollView( body: CustomScrollView(
controller: _laterController.scrollController, controller: _laterController.scrollController,

View File

@ -24,10 +24,10 @@ class LiveCardV extends StatelessWidget {
String heroTag = Utils.makeHeroTag(liveItem.roomId); String heroTag = Utils.makeHeroTag(liveItem.roomId);
return Card( return Card(
elevation: 0, elevation: 0,
// clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
// shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
// borderRadius: StyleString.mdRadius, borderRadius: StyleString.mdRadius,
// ), ),
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: GestureDetector( child: GestureDetector(
onLongPress: () { onLongPress: () {
@ -114,7 +114,7 @@ class LiveContent extends StatelessWidget {
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
letterSpacing: 0.3, letterSpacing: 0.3,
), ),
maxLines: 2, maxLines: 2,

View File

@ -157,7 +157,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
.titleMedium! .titleMedium!
.copyWith( .copyWith(
letterSpacing: 0.5, letterSpacing: 0.5,
fontWeight: FontWeight.bold), fontWeight: FontWeight.w500),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
@ -238,10 +238,11 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
seasonPanel(widget.videoDetail!.ugcSeason!, seasonPanel(widget.videoDetail!.ugcSeason!,
widget.videoDetail!.pages!.first.cid, sheetHeight) widget.videoDetail!.pages!.first.cid, sheetHeight)
], ],
Divider( // Divider(
height: 26, // height: 26,
color: Theme.of(context).dividerColor.withOpacity(0.1), // color: Theme.of(context).dividerColor.withOpacity(0.1),
), // ),
const SizedBox(height: 20),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
int mid = !widget.loadingStatus int mid = !widget.loadingStatus
@ -257,6 +258,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
}, },
child: Row( child: Row(
children: [ children: [
const SizedBox(width: 5),
NetworkImgLayer( NetworkImgLayer(
type: 'avatar', type: 'avatar',
src: !widget.loadingStatus src: !widget.loadingStatus
@ -293,17 +295,48 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
opacity: widget.loadingStatus ? 0 : 1, opacity: widget.loadingStatus ? 0 : 1,
duration: const Duration(milliseconds: 150), duration: const Duration(milliseconds: 150),
child: SizedBox( child: SizedBox(
height: 34, height: 32,
child: Obx( child: Obx(
() => videoIntroController.followStatus.isNotEmpty () => videoIntroController.followStatus.isNotEmpty
? ElevatedButton( ? TextButton(
onPressed: () => videoIntroController onPressed: () => videoIntroController
.actionRelationMod(), .actionRelationMod(),
child: Text(videoIntroController style: TextButton.styleFrom(
.followStatus['attribute'] == padding: const EdgeInsets.only(
0 left: 8, right: 8),
? '关注' foregroundColor:
: '已关注'), videoIntroController.followStatus[
'attribute'] !=
0
? Theme.of(context)
.colorScheme
.outline
: Theme.of(context)
.colorScheme
.onPrimary,
backgroundColor:
videoIntroController.followStatus[
'attribute'] !=
0
? Theme.of(context)
.colorScheme
.onInverseSurface
: Theme.of(context)
.colorScheme
.primary, // 设置按钮背景色
),
child: Text(
videoIntroController.followStatus[
'attribute'] !=
0
? '已关注'
: '关注',
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelMedium!
.fontSize),
),
) )
: ElevatedButton( : ElevatedButton(
onPressed: () => videoIntroController onPressed: () => videoIntroController
@ -313,14 +346,15 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
), ),
), ),
), ),
const SizedBox(width: 4)
], ],
), ),
), ),
const SizedBox(height: 8), const SizedBox(height: 12),
Divider( // Divider(
height: 12, // height: 12,
color: Theme.of(context).dividerColor.withOpacity(0.1), // color: Theme.of(context).dividerColor.withOpacity(0.1),
), // ),
], ],
) )
: const SizedBox( : const SizedBox(

View File

@ -28,7 +28,7 @@ class IntroDetail extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Container( Container(
height: 25, height: 40,
padding: const EdgeInsets.only(bottom: 2), padding: const EdgeInsets.only(bottom: 2),
child: Center( child: Center(
child: Container( child: Container(
@ -51,7 +51,7 @@ class IntroDetail extends StatelessWidget {
Text( Text(
videoDetail!.title, videoDetail!.title,
style: Theme.of(context).textTheme.titleMedium!.copyWith( style: Theme.of(context).textTheme.titleMedium!.copyWith(
letterSpacing: 0.5, fontWeight: FontWeight.bold), letterSpacing: 0.5, fontWeight: FontWeight.w500),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Row( Row(

View File

@ -75,21 +75,28 @@ Widget seasonPanel(UgcSeason ugcSeason, cid, sheetHeight) {
), ),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
'合集:${ugcSeason.title!}', '合集:${ugcSeason.title!}',
style: Theme.of(context).textTheme.labelMedium,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Image.asset(
'assets/images/live.gif',
color: Theme.of(context).colorScheme.primary,
height: 11,
),
const SizedBox(width: 4),
Text( Text(
'${currentIndex + 1} / ${ugcSeason.epCount}', '${currentIndex + 1} / ${ugcSeason.epCount}',
style: Theme.of(context).textTheme.labelSmall, style: Theme.of(context).textTheme.labelMedium,
), ),
const SizedBox(width: 2), const SizedBox(width: 6),
const Icon( const Icon(
Icons.arrow_forward_ios_outlined, Icons.arrow_forward_ios_outlined,
size: 13, size: 13,