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 15 additions and 5 deletions
Showing only changes of commit 4019ed083f - Show all commits

View File

@@ -111,7 +111,8 @@ 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.secondaryColor)), child: Text(loc.delete, style: TextStyle(color: CustomTheme.textColor)),
backgroundColor: CustomTheme.secondaryColor,
), ),
], ],
), ),

View File

@@ -8,13 +8,18 @@ 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 {
flixcoo marked this conversation as resolved Outdated

Docstring über den Konstruktor, nicht über die Klasse (siehe #167)

Docstring über den Konstruktor, nicht über die Klasse (siehe #167)
const AnimatedDialogButton({super.key, required this.onPressed, required this.child}); const AnimatedDialogButton({
super.key,
required this.onPressed,
required this.child,
flixcoo marked this conversation as resolved Outdated

newline hinter onPressed

newline hinter `onPressed`
this.backgroundColor,
sneeex marked this conversation as resolved Outdated

Konstrukturo über den Variablen

Konstrukturo über den Variablen
});
/// 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();
@@ -37,7 +42,11 @@ 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: CustomTheme.standardBoxDecoration, decoration: widget.backgroundColor != null
? 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,
), ),