Added constraint parameter

This commit is contained in:
2026-04-19 15:56:11 +02:00
parent 2ad3698067
commit ad2e4bc398
2 changed files with 9 additions and 8 deletions

View File

@@ -7,22 +7,23 @@ class AnimatedDialogButton extends StatefulWidget {
/// - [onPressed]: Callback function that is triggered when the button is pressed.
/// - [buttonText]: The text to be displayed on the button.
/// - [buttonType]: The type of the button, which determines its styling.
/// - [buttonConstraints]: Optional constraints to control the button's size.
const AnimatedDialogButton({
super.key,
required this.onPressed,
required this.buttonText,
this.constraints,
required this.onPressed,
this.buttonConstraints,
this.buttonType = ButtonType.primary,
});
final BoxConstraints? constraints;
final ButtonType buttonType;
final String buttonText;
final VoidCallback onPressed;
final BoxConstraints? buttonConstraints;
final ButtonType buttonType;
@override
State<AnimatedDialogButton> createState() => _AnimatedDialogButtonState();
}
@@ -68,7 +69,7 @@ class _AnimatedDialogButtonState extends State<AnimatedDialogButton> {
duration: const Duration(milliseconds: 100),
child: Center(
child: Container(
constraints: widget.constraints,
constraints: widget.buttonConstraints,
decoration: buttonDecoration,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
margin: const EdgeInsets.symmetric(vertical: 8),