Created
October 14, 2022 14:07
-
-
Save haashem/82f45e5ab5ac05aa730d8e5c6b3b7b8a to your computer and use it in GitHub Desktop.
dropping tiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column( | |
mainAxisSize: MainAxisSize.min, | |
children: sections.entries.mapIndexed( | |
(index, e) { | |
// 3 | |
final itemAnimation = CurvedAnimation( | |
parent: animationController, | |
curve: Interval( | |
10 / timelineFrames + | |
(5 - index) * 1 / 5 * 10 / timelineFrames, | |
1, | |
curve: Curves.easeOutCubic), | |
); | |
return SlideTransition( | |
position: Tween( | |
begin: Offset(0, -(6 - index) * 3 / 2), | |
end: const Offset(0, 0)) | |
.animate( | |
itemAnimation, | |
), | |
child: FadeTransition( | |
opacity: CurvedAnimation( | |
parent: animationController, | |
curve: Interval( | |
((sections.length - (index + 1)) / 6), 1, | |
curve: Curves.easeInQuad), | |
), | |
child: Column( | |
children: [ | |
ListTile( | |
contentPadding: EdgeInsets.zero, | |
title: Text(e.value), | |
onTap: () { | |
animationController.reverse(); | |
widget.onItemTapped(index); | |
}, | |
), | |
if (index != sections.length - 1) | |
const Divider( | |
height: 1, | |
), | |
], | |
), | |
), | |
); | |
}, | |
).toList()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment