update slot machine style

This commit is contained in:
Deep Koluguri 2025-11-09 20:23:21 -05:00
parent 61895cd88a
commit 62d81a4ee4
1 changed files with 10 additions and 8 deletions

View File

@ -532,13 +532,15 @@ class _SlotMachineDrawAnimationState extends State<SlotMachineDrawAnimation>
setState(() { setState(() {
_isAnimating = false; _isAnimating = false;
_isComplete = true; _isComplete = true;
// Show winner in center position (index 2) with padding names // Show winner in center position (index 3) with padding names for 7 slots
_displayNames = [ _displayNames = [
_displayNames.isNotEmpty ? _displayNames[0] : '', _displayNames.isNotEmpty ? _displayNames[0] : '',
_displayNames.length > 1 ? _displayNames[1] : '', _displayNames.length > 1 ? _displayNames[1] : '',
winnerName, // Center - the winner! _displayNames.length > 2 ? _displayNames[2] : '',
_displayNames.length > 3 ? _displayNames[3] : '', winnerName, // Center (index 3) - the winner!
_displayNames.length > 4 ? _displayNames[4] : '', _displayNames.length > 4 ? _displayNames[4] : '',
_displayNames.length > 5 ? _displayNames[5] : '',
_displayNames.length > 6 ? _displayNames[6] : '',
]; ];
}); });
@ -569,7 +571,7 @@ class _SlotMachineDrawAnimationState extends State<SlotMachineDrawAnimation>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: 300.w, width: 300.w,
height: 400.h, height: 520.h,
child: Column( child: Column(
children: [ children: [
// Title // Title
@ -648,11 +650,11 @@ class _SlotMachineDrawAnimationState extends State<SlotMachineDrawAnimation>
animation: _slotAnimation, animation: _slotAnimation,
builder: (context, child) { builder: (context, child) {
return Column( return Column(
children: List.generate(5, (index) { children: List.generate(7, (index) {
final displayIndex = index < _displayNames.length ? index : 0; final displayIndex = index < _displayNames.length ? index : 0;
final name = _displayNames[displayIndex]; final name = _displayNames[displayIndex];
final isWinner = _isComplete && index == 2; // Center position final isWinner = _isComplete && index == 3; // Center position (middle of 7)
final isCenterHighlight = _isAnimating && index == 2; // Always highlight center final isCenterHighlight = _isAnimating && index == 3; // Always highlight center
return Expanded( return Expanded(
child: AnimatedBuilder( child: AnimatedBuilder(
@ -722,7 +724,7 @@ class _SlotMachineDrawAnimationState extends State<SlotMachineDrawAnimation>
child: Text( child: Text(
name.length > 15 ? '${name.substring(0, 15)}...' : name, name.length > 15 ? '${name.substring(0, 15)}...' : name,
style: TextStyle( style: TextStyle(
fontSize: isWinner || isCenterHighlight ? 18.sp : 15.sp, fontSize: isWinner || isCenterHighlight ? 16.sp : 13.sp,
fontWeight: isWinner || isCenterHighlight fontWeight: isWinner || isCenterHighlight
? FontWeight.w900 ? FontWeight.w900
: FontWeight.w600, : FontWeight.w600,