import 'package:flutter/material.dart'; import '../../core/theme/design_tokens.dart'; class LinkButton extends StatelessWidget { const LinkButton({ super.key, required this.text, required this.onTap, this.enabled = true, this.textAlign = TextAlign.center, this.foregroundColor, }); final String text; final VoidCallback? onTap; final bool enabled; final TextAlign textAlign; final Color? foregroundColor; @override Widget build(BuildContext context) { final colorScheme = Theme.of(context).colorScheme; final color = enabled ? (foregroundColor ?? colorScheme.primary) : colorScheme.outline; return TextButton( onPressed: enabled ? onTap : null, style: TextButton.styleFrom( minimumSize: const Size(0, 40), tapTargetSize: MaterialTapTargetSize.shrinkWrap, foregroundColor: color, padding: const EdgeInsets.symmetric( horizontal: AppSpacing.md, vertical: AppSpacing.sm, ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppRadius.full), ), ), child: Text( text, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, color: color, ), textAlign: textAlign, ), ); } }