fix BurstMenu

This commit is contained in:
toly
2022-03-11 14:57:42 +08:00
parent 1e858ac113
commit dc4002fdb8
2 changed files with 7 additions and 3 deletions

View File

@@ -132,6 +132,7 @@ class BurstMenuState extends State<BurstMenu>
? 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 +

View File

@@ -36,7 +36,7 @@ class CustomMultiChildLayoutDemo extends StatelessWidget {
}
}
// 50 颜
// 50 颜
class Box50 extends StatelessWidget {
final Color color;
Box50(this.color);