You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.
I figure out that when you trigger a Hot reload, _RichTextWrapper will invoke updateRenderObject and it will call RenderParagraph's text setter to set a new TextSpan which call TextSpan.compareTo to determine whether to accept the new TextSpan or drop it.
Since our ImageSpan is inherited from TextSpan, and we should override the compareTo method to aware the changes of these properties in ImageSpan class.
I figure out that when you trigger a Hot reload,
_RichTextWrapper
will invokeupdateRenderObject
and it will callRenderParagraph
'stext
setter to set a newTextSpan
which callTextSpan.compareTo
to determine whether to accept the newTextSpan
or drop it.Since our
ImageSpan
is inherited fromTextSpan
, and we should override thecompareTo
method to aware the changes of these properties inImageSpan
class.Here is my patch code, and it works.
The text was updated successfully, but these errors were encountered: