Revert "add background color option to AnimatedDialogButton"
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m5s
Pull Request Pipeline / lint (pull_request) Successful in 2m19s

This reverts commit 4019ed083f.
This commit is contained in:
2026-01-13 22:17:38 +01:00
parent 4019ed083f
commit db51990695
2 changed files with 5 additions and 15 deletions

View File

@@ -111,8 +111,7 @@ class _SettingsViewState extends State<SettingsView> {
), ),
AnimatedDialogButton( AnimatedDialogButton(
onPressed: () => Navigator.of(context).pop(true), onPressed: () => Navigator.of(context).pop(true),
child: Text(loc.delete, style: TextStyle(color: CustomTheme.textColor)), child: Text(loc.delete, style: TextStyle(color: CustomTheme.secondaryColor)),
backgroundColor: CustomTheme.secondaryColor,
), ),
], ],
), ),

View File

@@ -8,18 +8,13 @@ import 'package:game_tracker/core/custom_theme.dart';
/// Parameters: /// Parameters:
/// - [onPressed]: Callback function that is triggered when the button is pressed. /// - [onPressed]: Callback function that is triggered when the button is pressed.
/// - [child]: The child widget to be displayed inside the button, typically a text or icon. /// - [child]: The child widget to be displayed inside the button, typically a text or icon.
/// - [backgroundColor]: Optional background color for the button container. If null, uses the standard box color from CustomTheme.
class AnimatedDialogButton extends StatefulWidget { class AnimatedDialogButton extends StatefulWidget {
const AnimatedDialogButton({ const AnimatedDialogButton({super.key, required this.onPressed, required this.child});
super.key,
required this.onPressed,
required this.child,
this.backgroundColor,
});
/// Callback function that is triggered when the button is pressed.
final VoidCallback onPressed; final VoidCallback onPressed;
/// The child widget to be displayed inside the button, typically a text or icon.
final Widget child; final Widget child;
final Color? backgroundColor;
@override @override
State<AnimatedDialogButton> createState() => _AnimatedDialogButtonState(); State<AnimatedDialogButton> createState() => _AnimatedDialogButtonState();
@@ -42,11 +37,7 @@ class _AnimatedDialogButtonState extends State<AnimatedDialogButton> {
opacity: _isPressed ? 0.6 : 1.0, opacity: _isPressed ? 0.6 : 1.0,
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
child: Container( child: Container(
decoration: widget.backgroundColor != null decoration: CustomTheme.standardBoxDecoration,
? CustomTheme.standardBoxDecoration.copyWith(
color: widget.backgroundColor,
)
: CustomTheme.standardBoxDecoration,
padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 6), padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 6),
child: widget.child, child: widget.child,
), ),