Neues Popup Design #152

Merged
flixcoo merged 15 commits from feature/129-neues-popup-design into development 2026-01-13 22:01:05 +00:00
2 changed files with 5 additions and 15 deletions
Showing only changes of commit db51990695 - Show all commits

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,
), ),