diff --git a/analysis_options.yaml b/analysis_options.yaml index 2fc4fec6..06d7ee1c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -17,6 +17,7 @@ linter: - avoid_void_async - cascade_invocations - directives_ordering + - lines_longer_than_80_chars - omit_local_variable_types - prefer_const_constructors - prefer_const_constructors_in_immutables diff --git a/example/lib/pages/home_page.dart b/example/lib/pages/home_page.dart index d40b4be2..e0f436f8 100644 --- a/example/lib/pages/home_page.dart +++ b/example/lib/pages/home_page.dart @@ -170,7 +170,8 @@ class _HomePageState extends State { } // Renders the image picked by imagePicker from local file storage - // You can also upload the picked image to any server (eg : AWS s3 or Firebase) and then return the uploaded image URL + // You can also upload the picked image to any server (eg : AWS s3 + // or Firebase) and then return the uploaded image URL. Future _onImagePickCallback(File file) async { // Copies the picked file from temporary cache to applications directory final appDocDir = await getApplicationDocumentsDirectory(); diff --git a/example/lib/universal_ui/universal_ui.dart b/example/lib/universal_ui/universal_ui.dart index d1bdc3f5..567aa6b4 100644 --- a/example/lib/universal_ui/universal_ui.dart +++ b/example/lib/universal_ui/universal_ui.dart @@ -50,8 +50,9 @@ Widget defaultEmbedBuilderWeb(BuildContext context, Embed node) { default: throw UnimplementedError( - 'Embeddable type "${node.value.type}" is not supported by default embed ' - 'builder of QuillEditor. You must pass your own builder function to ' - 'embedBuilder property of QuillEditor or QuillField widgets.'); + 'Embeddable type "${node.value.type}" is not supported by default ' + 'embed builder of QuillEditor. You must pass your own builder function ' + 'to embedBuilder property of QuillEditor or QuillField widgets.', + ); } } diff --git a/lib/src/models/documents/document.dart b/lib/src/models/documents/document.dart index a26d885a..346da93b 100644 --- a/lib/src/models/documents/document.dart +++ b/lib/src/models/documents/document.dart @@ -250,7 +250,7 @@ class Document { for (final op in doc.toList()) { if (!op.isInsert) { throw ArgumentError.value(doc, - 'Document Delta can only contain insert operations but ${op.key} found.'); + 'Document can only contain insert operations but ${op.key} found.'); } final style = op.attributes != null ? Style.fromJson(op.attributes) : null; diff --git a/lib/src/models/documents/nodes/container.dart b/lib/src/models/documents/nodes/container.dart index dbdd12d1..13f6aa2f 100644 --- a/lib/src/models/documents/nodes/container.dart +++ b/lib/src/models/documents/nodes/container.dart @@ -79,7 +79,7 @@ abstract class Container extends Node { if (last != null) last.adjust(); } - /// Queries the child [Node] at specified character [offset] in this container. + /// Queries the child [Node] at [offset] in this container. /// /// The result may contain the found node or `null` if no node is found /// at specified offset. diff --git a/lib/src/models/quill_delta.dart b/lib/src/models/quill_delta.dart index a0e608be..548e2afa 100644 --- a/lib/src/models/quill_delta.dart +++ b/lib/src/models/quill_delta.dart @@ -1,5 +1,6 @@ -// Copyright (c) 2018, Anatoly Pulyaevskiy. All rights reserved. Use of this source code -// is governed by a BSD-style license that can be found in the LICENSE file. +// Copyright (c) 2018, Anatoly Pulyaevskiy. All rights reserved. Use of this +// source code is governed by a BSD-style license that can be found in the +// LICENSE file. /// Implementation of Quill Delta format in Dart. library quill_delta; diff --git a/lib/src/models/rules/insert.dart b/lib/src/models/rules/insert.dart index 5801a10e..9c10d422 100644 --- a/lib/src/models/rules/insert.dart +++ b/lib/src/models/rules/insert.dart @@ -167,7 +167,8 @@ class AutoExitBlockRule extends InsertRule { // First check if `cur` length is greater than 1, this would indicate // that it contains multiple newline characters which share the same style. // This would mean we are not on the last line yet. - // `cur.value as String` is safe since we already called isEmptyLine and know it contains a newline + // `cur.value as String` is safe since we already called isEmptyLine and + // know it contains a newline if ((cur.value as String).length > 1) { // We are not on the last line of this block, ignore. return null; diff --git a/lib/src/utils/diff_delta.dart b/lib/src/utils/diff_delta.dart index 003bae47..0e09946c 100644 --- a/lib/src/utils/diff_delta.dart +++ b/lib/src/utils/diff_delta.dart @@ -79,7 +79,8 @@ int getPositionDelta(Delta user, Delta actual) { final userOperation = userItr.next(length as int); final actualOperation = actualItr.next(length); if (userOperation.length != actualOperation.length) { - throw 'userOp ${userOperation.length} does not match actualOp ${actualOperation.length}'; + throw 'userOp ${userOperation.length} does not match actualOp ' + '${actualOperation.length}'; } if (userOperation.key == actualOperation.key) { continue; diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index bd669171..9edf805b 100644 --- a/lib/src/widgets/controller.dart +++ b/lib/src/widgets/controller.dart @@ -69,7 +69,7 @@ class QuillController extends ChangeNotifier { // if (this.selection.extentOffset >= document.length) { // // cursor exceeds the length of document, position it in the end // updateSelection( - // TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL); + // TextSelection.collapsed(offset: document.length), ChangeSource.LOCAL); updateSelection( TextSelection.collapsed(offset: selection.baseOffset + len!), ChangeSource.LOCAL); diff --git a/lib/src/widgets/cursor.dart b/lib/src/widgets/cursor.dart index 44ba564f..7467c0a3 100644 --- a/lib/src/widgets/cursor.dart +++ b/lib/src/widgets/cursor.dart @@ -267,8 +267,9 @@ class CursorPainter { case TargetPlatform.fuchsia: case TargetPlatform.linux: case TargetPlatform.windows: - // Override the height to take the full height of the glyph at the TextPosition - // when not on iOS. iOS has special handling that creates a taller caret. + // Override the height to take the full height of the glyph at the + // TextPosition when not on iOS. iOS has special handling that + // creates a taller caret. caretRect = Rect.fromLTWH( caretRect.left, caretRect.top - 2.0, diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 662a018c..fb90db76 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -107,9 +107,10 @@ Widget _defaultEmbedBuilder(BuildContext context, leaf.Embed node) { : Image.file(io.File(imageUrl)); default: throw UnimplementedError( - 'Embeddable type "${node.value.type}" is not supported by default embed ' - 'builder of QuillEditor. You must pass your own builder function to ' - 'embedBuilder property of QuillEditor or QuillField widgets.'); + 'Embeddable type "${node.value.type}" is not supported by default ' + 'embed builder of QuillEditor. You must pass your own builder function ' + 'to embedBuilder property of QuillEditor or QuillField widgets.', + ); } } diff --git a/lib/src/widgets/keyboard_listener.dart b/lib/src/widgets/keyboard_listener.dart index 17c47aad..58df1725 100644 --- a/lib/src/widgets/keyboard_listener.dart +++ b/lib/src/widgets/keyboard_listener.dart @@ -64,7 +64,7 @@ class KeyboardListener { bool handleRawKeyEvent(RawKeyEvent event) { if (kIsWeb) { - // On web platform, we should ignore the key because it's processed already. + // On web platform, we ignore the key because it's already processed. return false; } diff --git a/lib/src/widgets/simple_viewer.dart b/lib/src/widgets/simple_viewer.dart index ee1a7732..559e5e1a 100644 --- a/lib/src/widgets/simple_viewer.dart +++ b/lib/src/widgets/simple_viewer.dart @@ -109,9 +109,11 @@ class _QuillSimpleViewerState extends State : Image.file(io.File(imageUrl)); default: throw UnimplementedError( - 'Embeddable type "${node.value.type}" is not supported by default embed ' - 'builder of QuillEditor. You must pass your own builder function to ' - 'embedBuilder property of QuillEditor or QuillField widgets.'); + 'Embeddable type "${node.value.type}" is not supported by default ' + 'embed builder of QuillEditor. You must pass your own builder ' + 'function to embedBuilder property of QuillEditor or QuillField ' + 'widgets.', + ); } } diff --git a/lib/src/widgets/text_block.dart b/lib/src/widgets/text_block.dart index f533a160..92c80f39 100644 --- a/lib/src/widgets/text_block.dart +++ b/lib/src/widgets/text_block.dart @@ -512,7 +512,8 @@ class RenderEditableTextBlock extends RenderEditableContainerBox offset.translate(decorationPadding.left, decorationPadding.top); _painter!.paint(context.canvas, decorationOffset, filledConfiguration); if (debugSaveCount != context.canvas.getSaveCount()) { - throw '${_decoration.runtimeType} painter had mismatching save and restore calls.'; + throw '${_decoration.runtimeType} painter had mismatching save and ' + 'restore calls.'; } if (decoration.isComplex) { context.setIsComplexHint();