diff --git a/analysis_options.yaml b/analysis_options.yaml index 57f3028e..33b1634a 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -8,3 +8,4 @@ analyzer: linter: rules: - avoid_print + - avoid_redundant_argument_values diff --git a/example/lib/pages/home_page.dart b/example/lib/pages/home_page.dart index 2e044fd7..9e91cde4 100644 --- a/example/lib/pages/home_page.dart +++ b/example/lib/pages/home_page.dart @@ -110,7 +110,6 @@ class _HomePageState extends State { autoFocus: false, readOnly: false, placeholder: 'Add content', - enableInteractiveSelection: true, expands: false, padding: EdgeInsets.zero, customStyles: DefaultStyles( diff --git a/example/lib/pages/read_only_page.dart b/example/lib/pages/read_only_page.dart index 8f03d45c..6e2ec0e0 100644 --- a/example/lib/pages/read_only_page.dart +++ b/example/lib/pages/read_only_page.dart @@ -42,7 +42,6 @@ class _ReadOnlyPageState extends State { focusNode: _focusNode, autoFocus: true, readOnly: !_edit, - enableInteractiveSelection: true, expands: false, padding: EdgeInsets.zero, ), diff --git a/lib/models/documents/document.dart b/lib/models/documents/document.dart index d52e89a4..126ff32b 100644 --- a/lib/models/documents/document.dart +++ b/lib/models/documents/document.dart @@ -183,7 +183,7 @@ class Document { bool nextOpIsImage = i + 1 < ops.length && ops[i + 1].isInsert && ops[i + 1].data is! String; if (nextOpIsImage && !(op.data as String).endsWith('\n')) { - res.push(Operation.insert('\n', null)); + res.push(Operation.insert('\n')); } // Currently embed is equivalent to image and hence `is! String` bool opInsertImage = op.isInsert && op.data is! String; @@ -193,7 +193,7 @@ class Document { (ops[i + 1].data as String).startsWith('\n'); if (opInsertImage && (i + 1 == ops.length - 1 || !nextOpIsLineBreak)) { // automatically append '\n' for image - res.push(Operation.insert('\n', null)); + res.push(Operation.insert('\n')); } } @@ -213,7 +213,7 @@ class Document { _history.clear(); } - String toPlainText() => _root.children.map((e) => e.toPlainText()).join(''); + String toPlainText() => _root.children.map((e) => e.toPlainText()).join(); void _loadDocument(Delta doc) { assert((doc.last.data as String).endsWith('\n')); diff --git a/lib/models/quill_delta.dart b/lib/models/quill_delta.dart index bced9b88..a1fe1f0f 100644 --- a/lib/models/quill_delta.dart +++ b/lib/models/quill_delta.dart @@ -520,7 +520,7 @@ class Delta { if (op.isInsert) { inverted.delete(op.length!); } else if (op.isRetain && op.isPlain) { - inverted.retain(op.length!, null); + inverted.retain(op.length!); baseIndex += op.length!; } else if (op.isDelete || (op.isRetain && op.isNotPlain)) { final length = op.length!; diff --git a/lib/widgets/controller.dart b/lib/widgets/controller.dart index 29206059..f613af69 100644 --- a/lib/widgets/controller.dart +++ b/lib/widgets/controller.dart @@ -31,7 +31,6 @@ class QuillController extends ChangeNotifier { TextEditingValue get plainTextEditingValue => TextEditingValue( text: document.toPlainText(), selection: selection, - composing: TextRange.empty, ); Style getSelectionStyle() { diff --git a/lib/widgets/editor.dart b/lib/widgets/editor.dart index 305a58c8..f3d3bd1a 100644 --- a/lib/widgets/editor.dart +++ b/lib/widgets/editor.dart @@ -200,7 +200,6 @@ class QuillEditor extends StatefulWidget { focusNode: FocusNode(), autoFocus: true, readOnly: readOnly, - enableInteractiveSelection: true, expands: false, padding: EdgeInsets.zero); } @@ -726,8 +725,7 @@ class RenderEditor extends RenderEditableContainerBox ); if (position.offset - word.start <= 1) { _handleSelectionChange( - TextSelection.collapsed( - offset: word.start, affinity: TextAffinity.downstream), + TextSelection.collapsed(offset: word.start), cause, ); } else { diff --git a/lib/widgets/raw_editor.dart b/lib/widgets/raw_editor.dart index 04b4aaf8..11c9c568 100644 --- a/lib/widgets/raw_editor.dart +++ b/lib/widgets/raw_editor.dart @@ -382,8 +382,6 @@ class RawEditorState extends EditorState TextInputConfiguration( inputType: TextInputType.multiline, readOnly: widget.readOnly, - obscureText: false, - autocorrect: true, inputAction: TextInputAction.newline, keyboardAppearance: widget.keyboardAppearance, textCapitalization: widget.textCapitalization, diff --git a/lib/widgets/text_block.dart b/lib/widgets/text_block.dart index 4d2a5cc3..1b085957 100644 --- a/lib/widgets/text_block.dart +++ b/lib/widgets/text_block.dart @@ -623,7 +623,7 @@ class _NumberPoint extends StatelessWidget { n = (n / 26).floor(); } - return result.toString().split('').reversed.join(''); + return result.toString().split('').reversed.join(); } String _intToRoman(int input) { diff --git a/lib/widgets/toolbar.dart b/lib/widgets/toolbar.dart index cb23a19e..0859cad3 100644 --- a/lib/widgets/toolbar.dart +++ b/lib/widgets/toolbar.dart @@ -525,7 +525,6 @@ class _ImageButtonState extends State { Future _pickImageWeb() async { _paths = (await FilePicker.platform.pickFiles( type: _pickingType, - allowMultiple: false, allowedExtensions: (_extension?.isNotEmpty ?? false) ? _extension?.replaceAll(' ', '').split(',') : null, @@ -1163,7 +1162,6 @@ class QuillIconButton extends StatelessWidget { child: RawMaterialButton( visualDensity: VisualDensity.compact, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)), - padding: EdgeInsets.zero, fillColor: fillColor, elevation: 0, hoverElevation: hoverElevation, @@ -1209,7 +1207,6 @@ class _QuillDropdownButtonState extends State> { child: RawMaterialButton( visualDensity: VisualDensity.compact, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)), - padding: EdgeInsets.zero, fillColor: widget.fillColor, elevation: 0, hoverElevation: widget.hoverElevation,