Skip to content

Commit

Permalink
fix BurstMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
toly1994328 committed Mar 11, 2022
1 parent 1e858ac commit dc4002f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/components/permanent/burst_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CustomMultiChildLayoutDemo extends StatelessWidget {
}
}

// 50 颜射盒
// 50 颜色盒
class Box50 extends StatelessWidget {
final Color color;
Box50(this.color);
Expand Down

0 comments on commit dc4002f

Please sign in to comment.