Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Fix ImageSpan not update on Hot reload #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/real_rich_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ class ImageSpan extends TextSpan {
double get width => imageWidth + (margin == null ? 0 : margin.horizontal);

double get height => imageHeight + (margin == null ? 0 : margin.vertical);

@override
RenderComparison compareTo(covariant ImageSpan other) {
RenderComparison comparison = super.compareTo(other);
if (other.imageProvider != imageProvider ||
other.imageWidth != imageWidth ||
other.imageHeight != imageHeight ||
other.margin != margin) {
comparison = RenderComparison.layout;
}
return comparison;
}
}

typedef ImageResolverListener = void Function(
Expand Down