From dc4002fdb84173176c0bef1684a65133bc441489 Mon Sep 17 00:00:00 2001 From: toly <1981462002@qq.com> Date: Fri, 11 Mar 2022 14:57:42 +0800 Subject: [PATCH] fix BurstMenu --- lib/components/permanent/burst_menu.dart | 8 ++++++-- .../CustomMultiChildLayout/node1_base.dart | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/components/permanent/burst_menu.dart b/lib/components/permanent/burst_menu.dart index 9a2fcdf..ed0c37a 100644 --- a/lib/components/permanent/burst_menu.dart +++ b/lib/components/permanent/burst_menu.dart @@ -132,6 +132,7 @@ class BurstMenuState extends State ? widget.radius : widget.radius * 2, alignment: Alignment.center, + // color: Colors.orange.withOpacity(0.5), child: Flow( delegate: _CircleFlowDelegate(curveAnim, startAngle: widget.startAngle, @@ -249,13 +250,16 @@ class _CircleFlowDelegate extends FlowDelegate { if (animation.value > hideOpacity) { for (int i = 0; i < count; i++) { - final double cSizeX = context.getChildSize(i)?.width ?? 0 / 2; - final double cSizeY = context.getChildSize(i)?.height ?? 0 / 2; + Size? size = context.getChildSize(i); + if(size == null) continue; + final double cSizeX = context.getChildSize(i)!.width/ 2; + final double cSizeY = context.getChildSize(i)!.height/ 2; final double beforeRadius = (radius - cSizeX); final double now = beforeRadius + centerOffset.dy.abs(); final swapRadius = (radius - cSizeX) / beforeRadius * now; + final double offsetX = animation.value * swapRadius * cos(i * perRad + rotate) + radius + diff --git a/lib/widget_system/widgets/MultiChildRenderObjectWidget/CustomMultiChildLayout/node1_base.dart b/lib/widget_system/widgets/MultiChildRenderObjectWidget/CustomMultiChildLayout/node1_base.dart index 95d83f3..28e1d3a 100644 --- a/lib/widget_system/widgets/MultiChildRenderObjectWidget/CustomMultiChildLayout/node1_base.dart +++ b/lib/widget_system/widgets/MultiChildRenderObjectWidget/CustomMultiChildLayout/node1_base.dart @@ -36,7 +36,7 @@ class CustomMultiChildLayoutDemo extends StatelessWidget { } } -// 50 颜射盒 +// 50 颜色盒 class Box50 extends StatelessWidget { final Color color; Box50(this.color);