File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,6 @@ class AnimatedSwitcher extends StatefulWidget {
222222 /// This is an [AnimatedSwitcherTransitionBuilder] function.
223223 static Widget defaultTransitionBuilder (Widget child, Animation <double > animation) {
224224 return FadeTransition (
225- key: ValueKey <Key ?>(child.key),
226225 opacity: animation,
227226 child: child,
228227 );
@@ -395,6 +394,6 @@ class _AnimatedSwitcherState extends State<AnimatedSwitcher> with TickerProvider
395394 @override
396395 Widget build (BuildContext context) {
397396 _rebuildOutgoingWidgetsIfNeeded ();
398- return widget.layoutBuilder (_currentEntry? .transition, _outgoingWidgets! . where (( Widget outgoing) => outgoing.key != _currentEntry ? .transition.key). toSet (). toList () );
397+ return widget.layoutBuilder (_currentEntry? .transition, _outgoingWidgets! );
399398 }
400399}
Original file line number Diff line number Diff line change @@ -415,25 +415,6 @@ void main() {
415415 );
416416 }
417417 });
418-
419- testWidgets ('AnimatedSwitcher does not duplicate animations if the same child is entered twice.' , (WidgetTester tester) async {
420- Future <void > pumpChild (Widget child) async {
421- return tester.pumpWidget (
422- Directionality (
423- textDirection: TextDirection .ltr,
424- child: AnimatedSwitcher (
425- duration: const Duration (milliseconds: 1000 ),
426- child: child,
427- ),
428- ),
429- );
430- }
431- await pumpChild (const Text ('1' , key: Key ('1' )));
432- await pumpChild (const Text ('2' , key: Key ('2' )));
433- await pumpChild (const Text ('1' , key: Key ('1' )));
434- await tester.pump (const Duration (milliseconds: 1000 ));
435- expect (find.text ('1' ), findsOneWidget);
436- });
437418}
438419
439420class StatefulTest extends StatefulWidget {
You can’t perform that action at this time.
0 commit comments