Skip to content

[Mobile] Resize image getting an error on Read-only mode #674

Answered by kairan77
rikai-trongpq asked this question in Mobile
Discussion options

You must be logged in to vote

This is due to a type cast bug in flutter_quill/src/widgets/embed/default_embed_builder.dart

line 27 declares image as var .
line 48 wraps image in Padding and assigned it to image, when scaling has been adjusted

in !readOnly mode, it is ok because line 128 returns image wrapped in a GestureDetector as its child,
in readOnly mode, it throws exception because in line 136, that image, which is actually a Padding by now, is passed to the function _menuOptionsForReadonlyImage and the function signature requires the image argument to be of Image class.

You can fix this problem by providing your own embed builder with QuillEditor, in your constructor call.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@xinyuezhang0402
Comment options

@rikai-trongpq
Comment options

Answer selected by rikai-trongpq
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Mobile
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #673 on February 18, 2022 04:26.