import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../theme.dart'; class PrimaryButton extends StatelessWidget { final String label; final VoidCallback onTap; final bool enabled; final IconData? icon; const PrimaryButton({ super.key, required this.label, required this.onTap, this.enabled = true, this.icon, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: enabled ? onTap : null, child: AnimatedContainer( duration: const Duration(milliseconds: 200), height: 56, decoration: BoxDecoration( gradient: enabled ? const LinearGradient( colors: [SColors.primary, SColors.gradientBot], begin: Alignment.centerLeft, end: Alignment.centerRight, ) : null, color: enabled ? null : SColors.border, borderRadius: BorderRadius.circular(16), boxShadow: enabled ? [ BoxShadow( color: SColors.primary.withAlpha(60), blurRadius: 16, offset: const Offset(0, 6), ) ] : [], ), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( label, style: GoogleFonts.plusJakartaSans( fontSize: 16, fontWeight: FontWeight.w700, color: enabled ? Colors.white : SColors.textSecondary, ), ), if (icon != null) ...[ const SizedBox(width: 8), Icon(icon, color: enabled ? Colors.white : SColors.textSecondary, size: 18), ], ], ), ), ); } }