UnsupportedError: Cannot add to a fixed-length list when selecting or rendering large text in QuillEditor
Have you checked for an existing issue?
- [x] I have searched the existing issues
Flutter Quill Version
11.0.0
Steps to Reproduce
I am encountering an UnsupportedError: Cannot add to a fixed-length list when using QuillEditor to handle large text. The error occurs specifically when I try to select (highlight) a large portion of text or when the editor attempts to render the content. Interestingly, copying the text works fine, but the error is thrown during the paint operation.
Here is the full error message:
The following UnsupportedError was thrown during paint(): Unsupported operation: Cannot add to a fixed-length list
Expected results
The editor should be able to handle large text selections and rendering without throwing an UnsupportedError.
Actual results
The editor throws an UnsupportedError when attempting to add to a fixed-length list during the paint operation.
Additional Context
Screenshots / Video demonstration
[Attach media here]
Logs
[Paste logs here]
This is strange, could you show me some pictures or videos of how you are reproducing this error?
I selected (Select All) a fairly large text, but not too long,The following error message (complete error) appeared.
I think this only happens when the text is entirely in Arabic and also long because I tried selecting a large English text, and the error didn’t appear.
======== Exception caught by rendering library ===================================================== The following UnsupportedError was thrown during paint(): Unsupported operation: Cannot add to a fixed-length list The relevant error-causing widget was: QuillEditor QuillEditor:file:<line in my code where the error appeared. It was "QuillEditor("> When the exception was thrown, this was the stack: #0 FixedLengthListMixin.add (dart:_internal/list.dart:22:5) #1 RenderEditableTextLine.paint (package:flutter_quill/src/editor/widgets/text/text_line.dart:1413:27) #2 RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3371:7) #3 PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:175:11) #4 PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:120:5) #5 PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1251:31) #6 PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:1261:15) #7 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:618:23) #8 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1231:13) #9 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:482:5) #10 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1442:15) #11 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1355:9) #12 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1208:5) #13 _invoke (dart:ui/hooks.dart:316:13) #14 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:428:5) #15 _drawFrame (dart:ui/hooks.dart:288:31) The following RenderObject was being processed when the exception was fired: RenderEditableTextLine#50205 relayoutBoundary=up30 ... needs compositing ... parentData: offset=Offset(0.0, 168.0) (can use size) ... constraints: BoxConstraints(w=358.7, 0.0<=h<=Infinity) ... layer: OffsetLayer#21930 ... engine layer: OffsetEngineLayer#d850f ... handles: 2 ... offset: Offset(0.0, 7824.0) ... size: Size(358.7, 18.0) RenderObject: RenderEditableTextLine#50205 relayoutBoundary=up30 needs compositing parentData: offset=Offset(0.0, 168.0) (can use size) constraints: BoxConstraints(w=358.7, 0.0<=h<=Infinity) layer: OffsetLayer#21930 engine layer: OffsetEngineLayer#d850f handles: 2 offset: Offset(0.0, 7824.0) size: Size(358.7, 18.0) ... body: RenderParagraphProxy#3fd92 relayoutBoundary=up31 ... parentData: offset=Offset(0.0, 0.0) (can use size) ... constraints: BoxConstraints(w=358.7, 0.0<=h<=Infinity) ... size: Size(358.7, 18.0) ... child: RenderParagraph#32397 relayoutBoundary=up32 ... parentData:
(can use size) ... constraints: BoxConstraints(w=358.7, 0.0<=h<=Infinity) ... size: Size(358.7, 18.0) ... textAlign: start ... textDirection: rtl ... softWrap: wrapping at box width ... overflow: clip ... locale: de ... maxLines: unlimited ... text: TextSpan ... debugLabel: (((englishLike bodyMedium 2021).merge((blackMountainView bodyMedium).apply)).copyWith).copyWith ... inherit: false ... color: Color(alpha: 1.0000, red: 0.1137, green: 0.1059, blue: 0.1255, colorSpace: ColorSpace.sRGB) ... family: Roboto ... size: 16.0 ... weight: 400 ... letterSpacing: 0.3 ... baseline: alphabetic ... height: 1.1x ... leadingDistribution: even ... decoration: Color(alpha: 1.0000, red: 0.1137, green: 0.1059, blue: 0.1255, colorSpace: ColorSpace.sRGB) TextDecoration.none ====================================================================================================
@CatHood0 I have somewhat the same issue with one of my applications. Unfortunately I personally can not reproduce it. This error was caught by my Crash Reporting System. The Stacktrace itself is not the exact same as the one mentioned above.
Here's the stacktrace:
Error: Unsupported operation: Cannot add to a fixed-length list
Stacktrace:
StackTrace:
File "text_line.dart", line 1436, in RenderEditableTextLine.paint
File "text_block.dart", line 666, in RenderEditableTextBlock.paint
File "editor.dart", line 1162, in RenderEditor.paint
...
(34 additional frame(s) were not displayed)
I am using the following versions:
flutter_quill: ^11.4.2
flutter_quill_extensions: ^11.0.0