Skip to content

UnsupportedError: Cannot add to a fixed-length list when selecting or rendering large text in QuillEditor #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
alhelali opened this issue Feb 24, 2025 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed moderate Issues that are important for improving functionality or user experience.

Comments

@alhelali
Copy link

Have you checked for an existing issue?

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]
@alhelali alhelali added the bug Something isn't working label Feb 24, 2025
@CatHood0
Copy link
Collaborator

This is strange, could you show me some pictures or videos of how you are reproducing this error?

@CatHood0 CatHood0 added awaiting response Pending additional information or feedback from the issue creator moderate Issues that are important for improving functionality or user experience. labels Feb 25, 2025
@alhelali
Copy link
Author

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
====================================================================================================

Image

Image

Image

@CatHood0 CatHood0 added help wanted Extra attention is needed and removed awaiting response Pending additional information or feedback from the issue creator labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed moderate Issues that are important for improving functionality or user experience.
Projects
None yet
Development

No branches or pull requests

2 participants