void _handleGatherIntel(BuildContext context, WidgetRef ref, City city) async { final cost = 5000.0; final current = ref.read(gameProvider).value; if (current == null) return; if (current.player.money < cost) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Need \$5K for intel')), ); return; } final message = await ref.read(gameProvider.notifier).gatherIntel(); if (context.mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(message)), ); } } void _handleBuildInfluence(BuildContext context, WidgetRef ref, City city) async { final cost = 10000.0; final current = ref.read(gameProvider).value; if (current == null) return; if (current.player.money < cost) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Need \$10K to build influence')), ); return; } final message = await ref.read(gameProvider.notifier).buildInfluence(); if (context.mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(message)), ); } void _handleChallengeBoss(BuildContext context, WidgetRef ref, City city) { final current = ref.read(gameProvider).value; if (current == null) return; // Check if player is in this city if (current.player.currentCityId != city.id) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('Travel to ${city.name} first to challenge the boss')), ); return; } // Check heat level if (current.player.heat > 85) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('🔥 Too hot! Lay low before fighting (heat > 85%)')), ); return; } // Show confirmation dialog showDialog( context: context, builder: (ctx) => AlertDialog( backgroundColor: AppTheme.surface, title: Text('⚔️ Challenge ${city.name} Boss?', style: TextStyle(color: AppTheme.danger)), content: const Text( 'This will trigger a boss fight.\n\n' 'If you win: You control the city!\n' 'If you lose: You lose everything in your stash.\n\n' 'Make sure you have weapons and armor equipped!', style: TextStyle(color: AppTheme.textPrimary), ), actions: [ TextButton( onPressed: () => Navigator.pop(ctx), child: const Text('NOT YET'), ), ElevatedButton( onPressed: () async { Navigator.pop(ctx); // Show loading feedback ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('⚔️ Initiating combat...')), ); // Trigger combat ref.read(gameProvider.notifier).initiateCombat(); // The CombatScreen will auto-show from HomeScreen's listener }, style: ElevatedButton.styleFrom(backgroundColor: AppTheme.danger), child: const Text('FIGHT!'), ), ], ), ); }