diff --git a/lib/src/models/config/toolbar/simple_toolbar_button_options.dart b/lib/src/models/config/toolbar/simple_toolbar_button_options.dart index f72cf178..3e787f12 100644 --- a/lib/src/models/config/toolbar/simple_toolbar_button_options.dart +++ b/lib/src/models/config/toolbar/simple_toolbar_button_options.dart @@ -75,7 +75,6 @@ class QuillSimpleToolbarButtonOptions extends Equatable { this.linkStyle = const QuillToolbarLinkStyleButtonOptions(), this.linkStyle2 = const QuillToolbarLinkStyleButton2Options(), this.customButtons = const QuillToolbarCustomButtonOptions(), - this.clipboardCut = const QuillToolbarToggleStyleButtonOptions(), this.clipboardCopy = const QuillToolbarToggleStyleButtonOptions(), this.clipboardPaste = const QuillToolbarToggleStyleButtonOptions(), diff --git a/lib/src/models/config/toolbar/simple_toolbar_configurations.dart b/lib/src/models/config/toolbar/simple_toolbar_configurations.dart index d4a97fa5..89175980 100644 --- a/lib/src/models/config/toolbar/simple_toolbar_configurations.dart +++ b/lib/src/models/config/toolbar/simple_toolbar_configurations.dart @@ -107,11 +107,9 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties { this.showSearchButton = true, this.showSubscript = true, this.showSuperscript = true, - this.showClipboardCut = true, this.showClipboardCopy = true, this.showClipboardPaste = true, - this.linkStyleType = LinkStyleType.original, this.headerStyleType = HeaderStyleType.original, diff --git a/lib/src/models/documents/nodes/line.dart b/lib/src/models/documents/nodes/line.dart index 935babda..be3eb7b0 100644 --- a/lib/src/models/documents/nodes/line.dart +++ b/lib/src/models/documents/nodes/line.dart @@ -43,7 +43,9 @@ base class Line extends QuillContainer { if (parent!.isLast) { return null; } - return parent!.next is Block ? (parent!.next as Block).first as Line? : parent!.next as Line?; + return parent!.next is Block + ? (parent!.next as Block).first as Line? + : parent!.next as Line?; } @override @@ -51,7 +53,9 @@ base class Line extends QuillContainer { @override Delta toDelta() { - final delta = children.map((child) => child.toDelta()).fold(Delta(), (dynamic a, b) => a.concat(b)); + final delta = children + .map((child) => child.toDelta()) + .fold(Delta(), (dynamic a, b) => a.concat(b)); var attributes = style; if (parent is Block) { final block = parent as Block; @@ -130,11 +134,17 @@ base class Line extends QuillContainer { final isLineFormat = (index + local == thisLength) && local == 1; if (isLineFormat) { - assert(style.values.every((attr) => attr.scope == AttributeScope.block || attr.scope == AttributeScope.ignore), 'It is not allowed to apply inline attributes to line itself.'); + assert( + style.values.every((attr) => + attr.scope == AttributeScope.block || + attr.scope == AttributeScope.ignore), + 'It is not allowed to apply inline attributes to line itself.'); _format(style); } else { // Otherwise forward to children as it's an inline format update. - assert(style.values.every((attr) => attr.scope == AttributeScope.inline || attr.scope == AttributeScope.ignore)); + assert(style.values.every((attr) => + attr.scope == AttributeScope.inline || + attr.scope == AttributeScope.ignore)); assert(index + local != thisLength); super.retain(index, local, style); } @@ -205,15 +215,21 @@ base class Line extends QuillContainer { // Ensure that we're only unwrapping the block only if we unset a single // block format in the `parentStyle` and there are no more block formats // left to unset. - if (blockStyle.value == null && parentStyle.containsKey(blockStyle.key) && parentStyle.length == 1) { + if (blockStyle.value == null && + parentStyle.containsKey(blockStyle.key) && + parentStyle.length == 1) { _unwrap(); - } else if (!const MapEquality().equals(newStyle.getBlocksExceptHeader(), parentStyle)) { + } else if (!const MapEquality() + .equals(newStyle.getBlocksExceptHeader(), parentStyle)) { _unwrap(); // Block style now can contain multiple attributes - if (newStyle.attributes.keys.any(Attribute.exclusiveBlockKeys.contains)) { - parentStyle.removeWhere((key, attr) => Attribute.exclusiveBlockKeys.contains(key)); + if (newStyle.attributes.keys + .any(Attribute.exclusiveBlockKeys.contains)) { + parentStyle.removeWhere( + (key, attr) => Attribute.exclusiveBlockKeys.contains(key)); } - parentStyle.removeWhere((key, attr) => newStyle?.attributes.keys.contains(key) ?? false); + parentStyle.removeWhere( + (key, attr) => newStyle?.attributes.keys.contains(key) ?? false); final parentStyleToMerge = Style.attr(parentStyle); newStyle = newStyle.mergeAll(parentStyleToMerge); _applyBlockStyles(newStyle); @@ -345,7 +361,8 @@ base class Line extends QuillContainer { void handle(Style style) { for (final attr in result.values) { - if (!style.containsKey(attr.key) || (style.attributes[attr.key]?.value != attr.value)) { + if (!style.containsKey(attr.key) || + (style.attributes[attr.key]?.value != attr.value)) { excluded.add(attr); } } @@ -382,7 +399,8 @@ base class Line extends QuillContainer { /// Returns each node segment's offset in selection /// with its corresponding style or embed as a list - List collectAllIndividualStylesAndEmbed(int offset, int len, {int beg = 0}) { + List collectAllIndividualStylesAndEmbed(int offset, int len, + {int beg = 0}) { final local = math.min(length - offset, len); final result = []; @@ -414,7 +432,8 @@ base class Line extends QuillContainer { final remaining = len - local; if (remaining > 0 && nextLine != null) { - final rest = nextLine!.collectAllIndividualStylesAndEmbed(0, remaining, beg: local + beg); + final rest = nextLine! + .collectAllIndividualStylesAndEmbed(0, remaining, beg: local + beg); result.addAll(rest); } @@ -484,7 +503,8 @@ base class Line extends QuillContainer { final remaining = len - local; if (remaining > 0 && nextLine != null) { - final rest = nextLine!.collectAllStylesWithOffsets(0, remaining, beg: local); + final rest = + nextLine!.collectAllStylesWithOffsets(0, remaining, beg: local); result.addAll(rest); } diff --git a/lib/src/widgets/quill/quill_controller.dart b/lib/src/widgets/quill/quill_controller.dart index 23ba3bda..fcb6db69 100644 --- a/lib/src/widgets/quill/quill_controller.dart +++ b/lib/src/widgets/quill/quill_controller.dart @@ -108,7 +108,9 @@ class QuillController extends ChangeNotifier { /// Only attributes applied to all characters within this range are /// included in the result. Style getSelectionStyle() { - return document.collectStyle(selection.start, selection.end - selection.start).mergeAll(toggledStyle); + return document + .collectStyle(selection.start, selection.end - selection.start) + .mergeAll(toggledStyle); } // Increases or decreases the indent of the current selection by 1. @@ -177,19 +179,23 @@ class QuillController extends ChangeNotifier { /// Returns all styles and Embed for each node within selection List getAllIndividualSelectionStylesAndEmbed() { - final stylesAndEmbed = document.collectAllIndividualStyleAndEmbed(selection.start, selection.end - selection.start); + final stylesAndEmbed = document.collectAllIndividualStyleAndEmbed( + selection.start, selection.end - selection.start); return stylesAndEmbed; } /// Returns plain text for each node within selection String getPlainText() { - final text = document.getPlainText(selection.start, selection.end - selection.start); + final text = + document.getPlainText(selection.start, selection.end - selection.start); return text; } /// Returns all styles for any character within the specified text range. List