From bfece1c4a77c42505883cdb0e765f0374aed24d0 Mon Sep 17 00:00:00 2001 From: bambinoua <130981115+MacDeveloper1@users.noreply.github.com> Date: Thu, 20 Apr 2023 13:41:54 +0200 Subject: [PATCH] Implement `constrains` and `buttonStyle` --- lib/src/widgets/toolbar/link_style_button2.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/widgets/toolbar/link_style_button2.dart b/lib/src/widgets/toolbar/link_style_button2.dart index 03188427..724e5566 100644 --- a/lib/src/widgets/toolbar/link_style_button2.dart +++ b/lib/src/widgets/toolbar/link_style_button2.dart @@ -241,6 +241,7 @@ class _LinkStyleDialogState extends State { @override Widget build(BuildContext context) { final constraints = widget.constraints ?? + widget.dialogTheme?.linkDialogConstraints ?? () { final mediaQuery = MediaQuery.of(context); final maxWidth = @@ -248,14 +249,13 @@ class _LinkStyleDialogState extends State { return BoxConstraints(maxWidth: maxWidth, maxHeight: 80); }(); - var buttonStyle = widget.dialogTheme?.buttonStyle; - if (buttonStyle == null) { - if (widget.buttonSize != null) { - buttonStyle = Theme.of(context).elevatedButtonTheme.style?.copyWith( - fixedSize: MaterialStatePropertyAll(widget.buttonSize), - ); - } - } + final buttonStyle = widget.buttonSize != null + ? Theme.of(context) + .elevatedButtonTheme + .style + ?.copyWith(fixedSize: MaterialStatePropertyAll(widget.buttonSize)) + : widget.dialogTheme?.buttonStyle; + ; return Dialog( backgroundColor: widget.dialogTheme?.dialogBackgroundColor,