fix: 修复 flow-anim.dart Obx 使用不当导致的页面卡死
- 将 Obx 移到 AnimatedBuilder 内部,确保只监听主题色变化 - 避免 Obx 包裹整个 AnimatedBuilder 导致的不必要重建
This commit is contained in:
@@ -108,14 +108,14 @@ class _FlowingBorderContainerState extends State<FlowingBorderContainer>
|
||||
|
||||
@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<FlowingBorderContainer>
|
||||
),
|
||||
child: widget.child,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user