Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1d2fa285
Unverified
Commit
1d2fa285
authored
Jul 08, 2022
by
Youssef Attia
Committed by
GitHub
Jul 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fixed AnimatedSwitcher chain produced duplicates (#106962)" (#107318)
This reverts commit
0d3cc92d
.
parent
750516a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
21 deletions
+1
-21
animated_switcher.dart
packages/flutter/lib/src/widgets/animated_switcher.dart
+1
-2
animated_switcher_test.dart
packages/flutter/test/widgets/animated_switcher_test.dart
+0
-19
No files found.
packages/flutter/lib/src/widgets/animated_switcher.dart
View file @
1d2fa285
...
...
@@ -222,7 +222,6 @@ class AnimatedSwitcher extends StatefulWidget {
/// This is an [AnimatedSwitcherTransitionBuilder] function.
static
Widget
defaultTransitionBuilder
(
Widget
child
,
Animation
<
double
>
animation
)
{
return
FadeTransition
(
key:
ValueKey
<
Key
?>(
child
.
key
),
opacity:
animation
,
child:
child
,
);
...
...
@@ -395,6 +394,6 @@ class _AnimatedSwitcherState extends State<AnimatedSwitcher> with TickerProvider
@override
Widget
build
(
BuildContext
context
)
{
_rebuildOutgoingWidgetsIfNeeded
();
return
widget
.
layoutBuilder
(
_currentEntry
?.
transition
,
_outgoingWidgets
!
.
where
((
Widget
outgoing
)
=>
outgoing
.
key
!=
_currentEntry
?.
transition
.
key
).
toSet
().
toList
()
);
return
widget
.
layoutBuilder
(
_currentEntry
?.
transition
,
_outgoingWidgets
!);
}
}
packages/flutter/test/widgets/animated_switcher_test.dart
View file @
1d2fa285
...
...
@@ -415,25 +415,6 @@ void main() {
);
}
});
testWidgets
(
'AnimatedSwitcher does not duplicate animations if the same child is entered twice.'
,
(
WidgetTester
tester
)
async
{
Future
<
void
>
pumpChild
(
Widget
child
)
async
{
return
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
AnimatedSwitcher
(
duration:
const
Duration
(
milliseconds:
1000
),
child:
child
,
),
),
);
}
await
pumpChild
(
const
Text
(
'1'
,
key:
Key
(
'1'
)));
await
pumpChild
(
const
Text
(
'2'
,
key:
Key
(
'2'
)));
await
pumpChild
(
const
Text
(
'1'
,
key:
Key
(
'1'
)));
await
tester
.
pump
(
const
Duration
(
milliseconds:
1000
));
expect
(
find
.
text
(
'1'
),
findsOneWidget
);
});
}
class
StatefulTest
extends
StatefulWidget
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment