Skip to content

Commit a3711fd

Browse files
BirjuVachhaniSaadArdati
authored andcommitted
♻️ remove unnecessary PostFrame from Pointer transition.
1 parent 579a2a8 commit a3711fd

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lib/src/pointer_transition.dart

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/widgets.dart';
22

33
import 'apple_curves.dart';
44
import 'effect_query.dart';
5-
import 'post_frame_widget.dart';
65

76
/// Represents the pointer event for [PointerTransition].
87
class PointerTransitionEvent {
@@ -57,8 +56,10 @@ extension PointerTransitionExt on Widget {
5756
bool resetOnExitBounds = true,
5857
Curve curve = appleEaseInOut,
5958
Duration duration = const Duration(milliseconds: 125),
59+
Key? key,
6060
}) {
6161
return PointerTransition(
62+
key: key,
6263
builder: builder,
6364
origin: origin,
6465
useGlobalPointer: useGlobalPointer,
@@ -393,21 +394,19 @@ class _PointerTransitionState extends State<PointerTransition>
393394
);
394395
}
395396

396-
return PostFrame(
397-
child: AnimatedBuilder(
398-
animation: _animation,
399-
builder: (context, child) => EffectQuery(
400-
curvedValue: currentValue,
401-
linearValue: currentValue,
402-
isTransition: true,
403-
lerpValues: false,
404-
child: KeyedSubtree(
405-
key: _key,
406-
child: child!,
407-
),
397+
return AnimatedBuilder(
398+
animation: _animation,
399+
builder: (context, child) => EffectQuery(
400+
curvedValue: currentValue,
401+
linearValue: currentValue,
402+
isTransition: true,
403+
lerpValues: false,
404+
child: KeyedSubtree(
405+
key: _key,
406+
child: child!,
408407
),
409-
child: child,
410408
),
409+
child: child,
411410
);
412411
}
413412
}

0 commit comments

Comments
 (0)