Skip to content

Commit

Permalink
refactor: accesing gravity object widget directly instead of using child
Browse files Browse the repository at this point in the history
  • Loading branch information
kishkihihi committed Nov 20, 2024
1 parent aaf832d commit 727acda
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/gravity_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ class _GravityBoxState extends State<GravityBox>
for (final ValueNotifier<GravityObject> gravityObjectNotifier in _gravityObjectNotifiers)
ValueListenableBuilder(
valueListenable: gravityObjectNotifier,
builder: (_, GravityObject info, Widget? child) {
builder: (_, GravityObject info, __) {
final Widget object = Transform.rotate(
angle: info.angle * (pi / 180),
child: child,
child: info.widget,
);

return Positioned(
Expand All @@ -123,7 +123,6 @@ class _GravityBoxState extends State<GravityBox>
: object,
);
},
child: gravityObjectNotifier.value.widget,
),
],
);
Expand Down

0 comments on commit 727acda

Please sign in to comment.