Files
MatchLiveTv/mobile/lib/shared/widgets/primary_cta.dart
Emiliano Frascaro bba6df52c0 Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 17:45:37 +02:00

67 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import '../../app/theme.dart';
/// CTA primaria rossa full-width (AVANTI, INIZIA).
class PrimaryCta extends StatelessWidget {
const PrimaryCta({
super.key,
required this.label,
required this.onPressed,
this.loading = false,
this.icon,
});
final String label;
final VoidCallback? onPressed;
final bool loading;
final IconData? icon;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return SizedBox(
width: double.infinity,
height: 52,
child: ElevatedButton(
onPressed: loading ? null : onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: AppTheme.primaryRed,
foregroundColor: Colors.white,
disabledBackgroundColor: AppTheme.primaryRed.withValues(alpha: 0.5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
elevation: 0,
),
child: loading
? const SizedBox(
width: 22,
height: 22,
child: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.white,
),
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
label,
style: theme.textTheme.titleMedium?.copyWith(
color: Colors.white,
fontWeight: FontWeight.w800,
letterSpacing: 1,
),
),
if (icon != null) ...[
const SizedBox(width: 8),
Icon(icon, size: 20),
],
],
),
),
);
}
}