Files
game-tracker/lib/presentation/widgets/buttons/quick_create_button.dart
Felix Kirchner aef12bd65a
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m3s
Pull Request Pipeline / lint (pull_request) Successful in 2m9s
Refactored several theme settings into custom theme
2026-01-07 14:54:53 +01:00

43 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
/// 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.
class QuickCreateButton extends StatefulWidget {
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,
shape: RoundedRectangleBorder(
borderRadius: CustomTheme.standardBorderRadiusAll,
),
),
child: Text(
widget.text,
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
);
}
}