From 1393e02b1ad3e42550bb0b9e599e0e04f14adedf Mon Sep 17 00:00:00 2001 From: orz12 Date: Thu, 25 Jan 2024 11:52:37 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E5=BC=B9=E5=B9=95=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E9=87=87=E7=94=A8=E4=B8=8B=E5=87=B8=E5=87=BD=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E5=85=BC=E9=A1=BE=E5=BE=AE=E8=B0=83=E4=B8=8E?= =?UTF-8?q?=E6=9B=B4=E5=A4=A7=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/widgets/header_control.dart | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index 3af35efd..80643245 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -342,8 +342,7 @@ class _HeaderControlState extends State { }, dense: true, contentPadding: const EdgeInsets.only(), - title: - const Text("额外等待视频播放完毕", style: titleStyle), + title: const Text("额外等待视频播放完毕", style: titleStyle), trailing: Switch( // thumb color (round icon) activeColor: Theme.of(context).colorScheme.primary, @@ -891,7 +890,7 @@ class _HeaderControlState extends State { final DanmakuOption currentOption = danmakuController.option; final DanmakuOption updatedOption = - currentOption.copyWith(strokeWidth: val); + currentOption.copyWith(strokeWidth: val); danmakuController.updateOption(updatedOption); } catch (_) {} }, @@ -938,7 +937,7 @@ class _HeaderControlState extends State { ), ), ), - Text('弹幕时长 ${danmakuDurationVal.toString()} 秒'), + Text('弹幕时长 $danmakuDurationVal 秒'), Padding( padding: const EdgeInsets.only( top: 0, @@ -956,21 +955,21 @@ class _HeaderControlState extends State { enabledThumbRadius: 6.0), ), child: Slider( - min: 2, - max: 16, - value: danmakuDurationVal, - divisions: 28, + min: 1, + max: 6, + value: sqrt(danmakuDurationVal), + divisions: 50, label: danmakuDurationVal.toString(), onChanged: (double val) { - danmakuDurationVal = val; + danmakuDurationVal = (val * val).toPrecision(2); widget.controller!.danmakuDurationVal = danmakuDurationVal; setState(() {}); try { final DanmakuOption updatedOption = danmakuController.option.copyWith( - duration: - val / widget.controller!.playbackSpeed); + duration: danmakuDurationVal / + widget.controller!.playbackSpeed); danmakuController.updateOption(updatedOption); } catch (_) {} }, @@ -1004,7 +1003,7 @@ class _HeaderControlState extends State { margin: const EdgeInsets.all(12), child: Column( children: [ - SizedBox( + const SizedBox( height: 45, child: Center(child: Text('选择播放顺序', style: titleStyle))), Expanded(