diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index 1814b080a..b889093fe 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -12,6 +12,7 @@ class PBadge extends StatelessWidget { final double? fs; final String? semanticsLabel; final bool bold; + final double? textScaleFactor; const PBadge({ super.key, @@ -26,6 +27,7 @@ class PBadge extends StatelessWidget { this.fs = 11, this.semanticsLabel, this.bold = true, + this.textScaleFactor, }); @override @@ -71,6 +73,9 @@ class PBadge extends StatelessWidget { ), child: Text( text ?? "", + textScaler: textScaleFactor != null + ? TextScaler.linear(textScaleFactor!) + : null, style: TextStyle( height: 1, fontSize: fs ?? fontSize, diff --git a/lib/pages/member/new/widget/edit_profile_page.dart b/lib/pages/member/new/widget/edit_profile_page.dart index 272e8aa09..7b65886d1 100644 --- a/lib/pages/member/new/widget/edit_profile_page.dart +++ b/lib/pages/member/new/widget/edit_profile_page.dart @@ -55,7 +55,8 @@ class _EditProfilePageState extends State { _getInfo() async { Map data = { 'access_key': GStorage.localCache - .get(LocalCacheKey.accessKey, defaultValue: {})['value'], + .get(LocalCacheKey.accessKey, defaultValue: {})['value'] ?? + '', 'appkey': Constants.appKey, 'build': '1462100', 'c_locale': 'zh_CN', @@ -329,7 +330,8 @@ class _EditProfilePageState extends State { }) async { Map data = { 'access_key': GStorage.localCache - .get(LocalCacheKey.accessKey, defaultValue: {})['value'], + .get(LocalCacheKey.accessKey, defaultValue: {})['value'] ?? + '', 'appkey': Constants.appKey, 'build': '1462100', 'c_locale': 'zh_CN', diff --git a/lib/pages/setting/sponsor_block_page.dart b/lib/pages/setting/sponsor_block_page.dart index cc797b2c3..8779b1727 100644 --- a/lib/pages/setting/sponsor_block_page.dart +++ b/lib/pages/setting/sponsor_block_page.dart @@ -403,24 +403,18 @@ class _SponsorBlockPageState extends State { WidgetSpan( alignment: PlaceholderAlignment.middle, child: Container( - height: - MediaQuery.textScalerOf(context).scale(13), - width: MediaQuery.textScalerOf(context).scale(13), - alignment: Alignment.center, - child: Container( - height: 10, - width: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _blockColor[index], - ), + height: 10, + width: 10, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _blockColor[index], ), ), - style: TextStyle(fontSize: 13), + style: TextStyle(fontSize: 13, height: 1), ), TextSpan( text: ' ${_blockSettings[index].first.title}', - style: TextStyle(fontSize: 13), + style: TextStyle(fontSize: 13, height: 1), ), ], ), @@ -451,23 +445,18 @@ class _SponsorBlockPageState extends State { WidgetSpan( alignment: PlaceholderAlignment.middle, child: Container( - height: MediaQuery.textScalerOf(context).scale(15), + height: 10, width: 10, - alignment: Alignment.center, - child: Container( - height: 10, - width: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _blockColor[index], - ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _blockColor[index], ), ), - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), TextSpan( text: ' ${_blockSettings[index].first.title}', - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), ], ), diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 06c971ddf..cd1ab1045 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -425,24 +425,18 @@ class VideoDetailController extends GetxController WidgetSpan( alignment: PlaceholderAlignment.middle, child: Container( - height: - MediaQuery.textScalerOf(context).scale(14), + height: 10, width: 10, - alignment: Alignment.center, - child: Container( - height: 10, - width: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _getColor(item), - ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _getColor(item), ), ), - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), TextSpan( text: ' ${item.title}', - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), ], ), @@ -528,24 +522,18 @@ class VideoDetailController extends GetxController WidgetSpan( alignment: PlaceholderAlignment.middle, child: Container( - height: - MediaQuery.textScalerOf(context).scale(14), + height: 10, width: 10, - alignment: Alignment.center, - child: Container( - height: 10, - width: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _getColor(item.segmentType), - ), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _getColor(item.segmentType), ), ), - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), TextSpan( text: ' ${item.segmentType.title}', - style: TextStyle(fontSize: 14), + style: TextStyle(fontSize: 14, height: 1), ), ], ), diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 5ccf56c5e..9215f788f 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -360,6 +360,7 @@ class ReplyItem extends StatelessWidget { type: 'line', fs: 9, semanticsLabel: '置顶', + textScaleFactor: 1, ), ), const TextSpan(text: ' '), @@ -556,6 +557,7 @@ class ReplyItem extends StatelessWidget { size: 'small', stack: 'normal', fs: 9, + textScaleFactor: 1, ), ), const TextSpan(text: ' '), diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 6f30e704e..bc51504b0 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -375,6 +375,7 @@ class ReplyItemGrpc extends StatelessWidget { type: 'line', fs: 9, semanticsLabel: '置顶', + textScaleFactor: 1, ), ), const TextSpan(text: ' '), @@ -590,6 +591,7 @@ class ReplyItemGrpc extends StatelessWidget { size: 'small', stack: 'normal', fs: 9, + textScaleFactor: 1, ), ), const TextSpan(text: ' '), diff --git a/lib/pages/video/detail/widgets/send_danmaku_panel.dart b/lib/pages/video/detail/widgets/send_danmaku_panel.dart index 21ab33ab8..b366a4007 100644 --- a/lib/pages/video/detail/widgets/send_danmaku_panel.dart +++ b/lib/pages/video/detail/widgets/send_danmaku_panel.dart @@ -397,33 +397,7 @@ class _SendDanmakuPanelState extends CommonPublishPageState { builder: (context) => AlertDialog( clipBehavior: Clip.hardEdge, contentPadding: const EdgeInsets.symmetric(vertical: 16), - title: Text.rich( - TextSpan( - children: [ - TextSpan( - text: 'Color Picker ', - style: TextStyle(fontSize: 15), - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: Container( - height: MediaQuery.textScalerOf(context).scale(13), - width: MediaQuery.textScalerOf(context).scale(13), - alignment: Alignment.center, - child: Container( - height: 10, - width: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _color.value, - ), - ), - ), - style: TextStyle(fontSize: 13), - ), - ], - ), - ), + title: Text('Color Picker'), content: SlideColorPicker( showResetBtn: false, color: _color.value,