Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update to match landed API
  • Loading branch information
dnfield committed May 18, 2022
commit 88f2b70028c0b8b92f5545102300d151af801b9d
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,11 @@ class RenderVisibilityDetector extends RenderProxyBox
if (onVisibilityChanged != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like paint here and in RenderSliverVisibilityDetector have a lot in common, the inly difference is the second argument passed to _scheduleUpdate? Maybe move paint to the base and have this class and RenderSliverVisibilityDetector implement just a method that returns the value for that second argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, as mentioned elsehwere moved this to a Rect get bounds; on the mixin, which simplified things a bit.

_compositionCallbackCanceller?.call();
_compositionCallbackCanceller =
context.addCompositionCallback((ContainerLayer layer) {
context.addCompositionCallback((Layer layer) {
assert(!debugDisposed!);
_scheduleUpdate(layer, offset & semanticBounds.size);
final ContainerLayer? container =
layer is ContainerLayer ? layer : layer.parent;
_scheduleUpdate(container, offset & semanticBounds.size);
});
}
super.paint(context, offset);
Expand Down Expand Up @@ -279,7 +281,7 @@ class RenderSliverVisibilityDetector extends RenderProxySliver
if (onVisibilityChanged != null) {
_compositionCallbackCanceller?.call();
_compositionCallbackCanceller =
context.addCompositionCallback((ContainerLayer layer) {
context.addCompositionCallback((Layer layer) {
assert(!debugDisposed!);

Size widgetSize;
Expand Down Expand Up @@ -315,7 +317,9 @@ class RenderSliverVisibilityDetector extends RenderProxySliver
Size(geometry!.scrollExtent, constraints.crossAxisExtent);
break;
}
_scheduleUpdate(layer, offset + widgetOffset & widgetSize);
final ContainerLayer? container =
layer is ContainerLayer ? layer : layer.parent;
_scheduleUpdate(container, offset + widgetOffset & widgetSize);
});
}
super.paint(context, offset);
Expand Down