From e52591b55e40e22cc76a6a9d0cb186a89f8b0175 Mon Sep 17 00:00:00 2001 From: Developer Date: Fri, 3 Apr 2026 00:40:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20flow-anim.dart=20Ob?= =?UTF-8?q?x=20=E4=BD=BF=E7=94=A8=E4=B8=8D=E5=BD=93=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 Obx 移到 AnimatedBuilder 内部,确保只监听主题色变化 - 避免 Obx 包裹整个 AnimatedBuilder 导致的不必要重建 --- lib/views/profile/level/flow-anim.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/views/profile/level/flow-anim.dart b/lib/views/profile/level/flow-anim.dart index 9f51051..bd6b293 100644 --- a/lib/views/profile/level/flow-anim.dart +++ b/lib/views/profile/level/flow-anim.dart @@ -108,14 +108,14 @@ class _FlowingBorderContainerState extends State @override Widget build(BuildContext context) { - return Obx(() { - final color = - widget.color ?? - ThemeColors.getThemeColor(_themeController.themeColorIndexRx.value); + return AnimatedBuilder( + animation: _animation, + builder: (context, child) { + return Obx(() { + final color = + widget.color ?? + ThemeColors.getThemeColor(_themeController.themeColorIndexRx.value); - return AnimatedBuilder( - animation: _animation, - builder: (context, child) { return Container( padding: EdgeInsets.all(widget.width), decoration: FlowingBorderDecoration( @@ -125,8 +125,8 @@ class _FlowingBorderContainerState extends State ), child: widget.child, ); - }, - ); - }); + }); + }, + ); } }