import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../../theme/app_theme.dart'; class ReactionPicker extends StatefulWidget { final Function(String) onReactionSelected; final VoidCallback? onClosed; const ReactionPicker({ super.key, required this.onReactionSelected, this.onClosed, }); @override State createState() => _ReactionPickerState(); } class _ReactionPickerState extends State { static const List _commonReactions = [ '❤️', '👍', '😂', '😮', '😢', '😡', '🎉', '🔥', '👏', '🙏', '💯', '🤔', '😍', '🤣', '😊', '👌', '🙌', '💪', '🎯', '⭐', '✨', '🌟', '💫', '☀️', ]; @override Widget build(BuildContext context) { return Dialog( backgroundColor: Colors.transparent, child: Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( color: AppTheme.cardSurface, borderRadius: BorderRadius.circular(20), border: Border.all( color: AppTheme.navyBlue.withValues(alpha: 0.2), width: 1, ), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.2), blurRadius: 20, offset: const Offset(0, 10), ), ], ), child: Column( mainAxisSize: MainAxisSize.min, children: [ // Header Row( children: [ Text( 'Add Reaction', style: GoogleFonts.inter( color: AppTheme.navyBlue, fontSize: 16, fontWeight: FontWeight.w600, ), ), const Spacer(), IconButton( onPressed: () { Navigator.of(context).pop(); widget.onClosed?.call(); }, icon: Icon( Icons.close, color: AppTheme.textSecondary, size: 20, ), ), ], ), const SizedBox(height: 16), // Emoji grid GridView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 6, crossAxisSpacing: 8, mainAxisSpacing: 8, childAspectRatio: 1, ), itemCount: _commonReactions.length, itemBuilder: (context, index) { final emoji = _commonReactions[index]; return Material( color: Colors.transparent, child: InkWell( onTap: () { Navigator.of(context).pop(); widget.onReactionSelected(emoji); }, borderRadius: BorderRadius.circular(12), child: Container( decoration: BoxDecoration( color: AppTheme.navyBlue.withValues(alpha: 0.05), borderRadius: BorderRadius.circular(12), border: Border.all( color: AppTheme.navyBlue.withValues(alpha: 0.1), width: 1, ), ), child: Center( child: Text( emoji, style: const TextStyle(fontSize: 24), ), ), ), ), ); }, ), const SizedBox(height: 16), ], ), ), ); } }