Last active
June 21, 2022 09:08
-
-
Save rutvik110/6f2872f503ecca2d82a4aa9e2a0e1c26 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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