Implement `constrains` and `buttonStyle`

pull/1185/head
bambinoua 2 years ago
parent d3fc816910
commit bfece1c4a7
  1. 16
      lib/src/widgets/toolbar/link_style_button2.dart

@ -241,6 +241,7 @@ class _LinkStyleDialogState extends State<LinkStyleDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final constraints = widget.constraints ?? final constraints = widget.constraints ??
widget.dialogTheme?.linkDialogConstraints ??
() { () {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final maxWidth = final maxWidth =
@ -248,14 +249,13 @@ class _LinkStyleDialogState extends State<LinkStyleDialog> {
return BoxConstraints(maxWidth: maxWidth, maxHeight: 80); return BoxConstraints(maxWidth: maxWidth, maxHeight: 80);
}(); }();
var buttonStyle = widget.dialogTheme?.buttonStyle; final buttonStyle = widget.buttonSize != null
if (buttonStyle == null) { ? Theme.of(context)
if (widget.buttonSize != null) { .elevatedButtonTheme
buttonStyle = Theme.of(context).elevatedButtonTheme.style?.copyWith( .style
fixedSize: MaterialStatePropertyAll(widget.buttonSize), ?.copyWith(fixedSize: MaterialStatePropertyAll(widget.buttonSize))
); : widget.dialogTheme?.buttonStyle;
} ;
}
return Dialog( return Dialog(
backgroundColor: widget.dialogTheme?.dialogBackgroundColor, backgroundColor: widget.dialogTheme?.dialogBackgroundColor,

Loading…
Cancel
Save