Files
game-tracker/lib/presentation/widgets/buttons/quick_create_button.dart
Felix Kirchner 6060afc543
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 1m58s
Pull Request Pipeline / lint (pull_request) Successful in 2m18s
Renamed package & bundle identifier
2026-01-22 22:13:12 +01:00

47 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:tallee/core/custom_theme.dart';
class QuickCreateButton extends StatefulWidget {
/// A button widget designed for quick creating matches in the [HomeView]
/// - [text]: The text to display on the button.
/// - [onPressed]: The callback to be invoked when the button is pressed.
const QuickCreateButton({
super.key,
required this.text,
required this.onPressed,
});
/// The text to display on the button.
final String text;
/// The callback to be invoked when the button is pressed.
final VoidCallback? onPressed;
@override
State<QuickCreateButton> createState() => _QuickCreateButtonState();
}
class _QuickCreateButtonState extends State<QuickCreateButton> {
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: widget.onPressed,
style: ElevatedButton.styleFrom(
minimumSize: const Size(140, 45),
backgroundColor: CustomTheme.primaryColor.withAlpha(200).withBlue(40),
shape: RoundedRectangleBorder(
borderRadius: CustomTheme.standardBorderRadiusAll,
),
),
child: Text(
widget.text,
style: const TextStyle(
color: CustomTheme.textColor,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
);
}
}