Update `QuillDialogTheme` with dialog constraints

pull/1185/head
bambinoua 2 years ago
parent c81eb9448c
commit 45d51a334b
  1. 22
      lib/src/models/themes/quill_dialog_theme.dart

@ -9,6 +9,8 @@ class QuillDialogTheme with Diagnosticable {
this.dialogBackgroundColor, this.dialogBackgroundColor,
this.shape, this.shape,
this.buttonStyle, this.buttonStyle,
this.linkDialogConstraints,
this.imageDialogConstraints,
}); });
///The text style to use for the label shown in the link-input dialog ///The text style to use for the label shown in the link-input dialog
@ -27,6 +29,12 @@ class QuillDialogTheme with Diagnosticable {
/// The default shape is a [RoundedRectangleBorder] with a radius of 4.0 /// The default shape is a [RoundedRectangleBorder] with a radius of 4.0
final ShapeBorder? shape; final ShapeBorder? shape;
/// Constrains for [LinkStyleDialog].
final BoxConstraints? linkDialogConstraints;
/// Constrains for [EmbedImageDialog].
final BoxConstraints? imageDialogConstraints;
/// Customizes this button's appearance. /// Customizes this button's appearance.
final ButtonStyle? buttonStyle; final ButtonStyle? buttonStyle;
@ -36,6 +44,8 @@ class QuillDialogTheme with Diagnosticable {
Color? dialogBackgroundColor, Color? dialogBackgroundColor,
ShapeBorder? shape, ShapeBorder? shape,
ButtonStyle? buttonStyle, ButtonStyle? buttonStyle,
BoxConstraints? linkDialogConstraints,
BoxConstraints? imageDialogConstraints,
}) { }) {
return QuillDialogTheme( return QuillDialogTheme(
labelTextStyle: labelTextStyle ?? this.labelTextStyle, labelTextStyle: labelTextStyle ?? this.labelTextStyle,
@ -43,7 +53,11 @@ class QuillDialogTheme with Diagnosticable {
dialogBackgroundColor: dialogBackgroundColor:
dialogBackgroundColor ?? this.dialogBackgroundColor, dialogBackgroundColor ?? this.dialogBackgroundColor,
shape: shape ?? this.shape, shape: shape ?? this.shape,
buttonStyle: buttonStyle ?? buttonStyle, buttonStyle: buttonStyle ?? this.buttonStyle,
linkDialogConstraints:
linkDialogConstraints ?? this.linkDialogConstraints,
imageDialogConstraints:
imageDialogConstraints ?? this.imageDialogConstraints,
); );
} }
@ -57,7 +71,9 @@ class QuillDialogTheme with Diagnosticable {
other.inputTextStyle == inputTextStyle && other.inputTextStyle == inputTextStyle &&
other.dialogBackgroundColor == dialogBackgroundColor && other.dialogBackgroundColor == dialogBackgroundColor &&
other.shape == shape && other.shape == shape &&
other.buttonStyle == buttonStyle; other.buttonStyle == buttonStyle &&
other.linkDialogConstraints == linkDialogConstraints &&
other.imageDialogConstraints == imageDialogConstraints;
} }
@override @override
@ -67,5 +83,7 @@ class QuillDialogTheme with Diagnosticable {
dialogBackgroundColor, dialogBackgroundColor,
shape, shape,
buttonStyle, buttonStyle,
linkDialogConstraints,
imageDialogConstraints,
); );
} }

Loading…
Cancel
Save