From ba8d7b871c7469b88734e3b510e1df52a8b0544e Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 14 Jan 2025 13:46:02 +0800 Subject: [PATCH] opt: silent info widget Signed-off-by: bggRGjQaUbCoE --- .../member/new/widget/user_info_card.dart | 40 +++++++++++-------- lib/pages/video/detail/introduction/view.dart | 7 ++-- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/lib/pages/member/new/widget/user_info_card.dart b/lib/pages/member/new/widget/user_info_card.dart index b50b851f..897e7059 100644 --- a/lib/pages/member/new/widget/user_info_card.dart +++ b/lib/pages/member/new/widget/user_info_card.dart @@ -267,6 +267,7 @@ class UserInfoCard extends StatelessWidget { Builder(builder: (context) { bool isLight = Theme.of(context).brightness == Brightness.light; return Container( + width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), color: isLight @@ -275,24 +276,29 @@ class UserInfoCard extends StatelessWidget { ), margin: const EdgeInsets.only(left: 20, top: 8, right: 20), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - child: Row( - children: [ - Icon( - Icons.info, - size: MediaQuery.textScalerOf(context).scale(18), - color: isLight - ? Theme.of(context).colorScheme.onErrorContainer - : Theme.of(context).colorScheme.onError, - ), - Text( - ' 该账号封禁中${endTime ?? ''}', - style: TextStyle( - color: isLight - ? Theme.of(context).colorScheme.onErrorContainer - : Theme.of(context).colorScheme.onError, + child: Text.rich( + TextSpan( + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Icon( + Icons.info, + size: 17, + color: isLight + ? Theme.of(context).colorScheme.onErrorContainer + : Theme.of(context).colorScheme.onError, + ), ), - ), - ], + TextSpan( + text: ' 该账号封禁中${endTime ?? ''}', + style: TextStyle( + color: isLight + ? Theme.of(context).colorScheme.onErrorContainer + : Theme.of(context).colorScheme.onError, + ), + ), + ], + ), ), ); }), diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index d49834bf..de0a2c2f 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -165,16 +165,14 @@ class _VideoInfoState extends State with TickerProviderStateMixin { children: [ Icon( Icons.shield_outlined, - size: - MediaQuery.textScalerOf(context).scale(16), + size: 16, color: Theme.of(context) .colorScheme .onSecondaryContainer, ), Icon( Icons.play_arrow_rounded, - size: - MediaQuery.textScalerOf(context).scale(12), + size: 12, color: Theme.of(context) .colorScheme .onSecondaryContainer, @@ -183,6 +181,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ), Text( videoDetailCtr.videoLabel.value, + textScaler: TextScaler.linear(1), strutStyle: StrutStyle(leading: 0, height: 1), style: TextStyle( height: 1,