Skip to content

Instantly share code, notes, and snippets.

@haashem
Created October 14, 2022 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haashem/82f45e5ab5ac05aa730d8e5c6b3b7b8a to your computer and use it in GitHub Desktop.
Save haashem/82f45e5ab5ac05aa730d8e5c6b3b7b8a to your computer and use it in GitHub Desktop.
dropping tiles
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