From 7b2d7ef0d6d8239f05ea24cb63b4eec90bf04dca Mon Sep 17 00:00:00 2001 From: guozhigq Date: Tue, 26 Dec 2023 07:35:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81tab=E5=8F=96=E6=B6=88s?= =?UTF-8?q?plashColor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/dynamics/view.dart | 103 +++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index facb89c9..575c8767 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -127,55 +127,64 @@ class _DynamicsPageState extends State () => _dynamicsController.userLogin.value ? Visibility( visible: _dynamicsController.mid.value == -1, - child: CustomSlidingSegmentedControl( - initialValue: - _dynamicsController.initialValue.value, - children: { - 0: Text( - '全部', - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize), + child: Theme( + data: ThemeData( + splashColor: + Colors.transparent, // 点击时的水波纹颜色设置为透明 + highlightColor: + Colors.transparent, // 点击时的背景高亮颜色设置为透明 + ), + child: CustomSlidingSegmentedControl( + initialValue: + _dynamicsController.initialValue.value, + children: { + 0: Text( + '全部', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize), + ), + 1: Text('投稿', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize)), + 2: Text('番剧', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize)), + 3: Text('专栏', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize)), + }, + padding: 13.0, + decoration: BoxDecoration( + color: Theme.of(context) + .colorScheme + .surfaceVariant + .withOpacity(0.7), + borderRadius: BorderRadius.circular(20), ), - 1: Text('投稿', - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize)), - 2: Text('番剧', - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize)), - 3: Text('专栏', - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize)), - }, - padding: 13.0, - decoration: BoxDecoration( - color: Theme.of(context) - .colorScheme - .surfaceVariant - .withOpacity(0.7), - borderRadius: BorderRadius.circular(20), + thumbDecoration: BoxDecoration( + color: + Theme.of(context).colorScheme.background, + borderRadius: BorderRadius.circular(20), + ), + duration: const Duration(milliseconds: 300), + curve: Curves.easeInOut, + onValueChanged: (v) { + feedBack(); + _dynamicsController.onSelectType(v); + }, ), - thumbDecoration: BoxDecoration( - color: Theme.of(context).colorScheme.background, - borderRadius: BorderRadius.circular(20), - ), - duration: const Duration(milliseconds: 300), - curve: Curves.easeInOut, - onValueChanged: (v) { - feedBack(); - _dynamicsController.onSelectType(v); - }, ), ) : Text('动态',