Skip to content

Instantly share code, notes, and snippets.

@rutvik110
Last active June 21, 2022 09:08
Show Gist options
  • Save rutvik110/6f2872f503ecca2d82a4aa9e2a0e1c26 to your computer and use it in GitHub Desktop.
Save rutvik110/6f2872f503ecca2d82a4aa9e2a0e1c26 to your computer and use it in GitHub Desktop.
Padding(
padding: EdgeInsets.all(verticlItemsPadding),
// 1.
child : Row(
mainAxisSize: MainAxisSize.min,
children: List.generate(items.length, (index) {
// 2.
return MouseRegion(
cursor: SystemMouseCursors.click,
onEnter: ((event) {
setState(() {
hoveredIndex = index;
});
}),
onExit: (event) {
setState(() {
hoveredIndex = null;
});
},
// 3.
child: AnimatedContainer(
duration: const Duration(
milliseconds: 300,
),
transform: Matrix4.identity()
..translate(
0.0,
baseTranslationY,
0.0,
),
height: baseItemHeight,
width: baseItemHeight,
alignment: AlignmentDirectional.bottomCenter,
margin: const EdgeInsets.symmetric(
horizontal: 10,
),
// 4.
child: FittedBox(
fit: BoxFit.contain,
// 5.
child: AnimatedDefaultTextStyle(
duration: const Duration(
milliseconds: 300,
),
style: TextStyle(
fontSize: baseItemHeight,
),
child: Text(
items[index],
),
),
),
),
);
},
).toList(),
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment