Skip to content

Instantly share code, notes, and snippets.

@diegoveloper
Created October 3, 2021 20:56
Show Gist options
  • Save diegoveloper/7ba92bc5ec93cd40da3d64b039c819ee to your computer and use it in GitHub Desktop.
Save diegoveloper/7ba92bc5ec93cd40da3d64b039c819ee to your computer and use it in GitHub Desktop.
ListView.builder(
itemCount: 20,
itemBuilder: (context, index) {
return TweenAnimationBuilder<double>(
duration: const Duration(milliseconds: 500),
tween: Tween(begin: 1.0, end: 0.0),
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Card(
elevation: 10,
child: Container(
height: 150,
color:
Colors.primaries[index % Colors.primaries.length],
),
),
),
builder: (context, value, child) {
return Transform.translate(
offset: Offset(50 * value, 0.0),
child: child,
);
});
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment