Skip to content

Commit 91f7b69

Browse files
committed
msglist [nfc]: Force anchor to 1.0
We'll rely on this assumption to simplify some upcoming customizations.
1 parent a51ad1c commit 91f7b69

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/widgets/message_list.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
645645

646646
controller: scrollController,
647647
semanticChildCount: length + 2,
648-
anchor: 1.0,
649648
center: centerSliverKey,
650649
paintOrder: SliverPaintOrder.firstIsTop,
651650

lib/widgets/scrolling.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ class MessageListScrollView extends CustomPaintOrderScrollView {
300300
super.scrollBehavior,
301301
// super.shrinkWrap, // omitted, always false
302302
super.center,
303-
super.anchor,
304303
super.cacheExtent,
305304
super.slivers,
306305
super.semanticChildCount,
@@ -321,7 +320,6 @@ class MessageListScrollView extends CustomPaintOrderScrollView {
321320
slivers: slivers,
322321
cacheExtent: cacheExtent,
323322
center: center,
324-
anchor: anchor,
325323
clipBehavior: clipBehavior,
326324
paintOrder_: paintOrder_,
327325
);
@@ -334,7 +332,6 @@ class MessageListViewport extends CustomPaintOrderViewport {
334332
super.key,
335333
super.axisDirection,
336334
super.crossAxisDirection,
337-
super.anchor,
338335
required super.offset,
339336
super.center,
340337
super.cacheExtent,
@@ -350,7 +347,6 @@ class MessageListViewport extends CustomPaintOrderViewport {
350347
axisDirection: axisDirection,
351348
crossAxisDirection: crossAxisDirection
352349
?? Viewport.getDefaultCrossAxisDirection(context, axisDirection),
353-
anchor: anchor,
354350
offset: offset,
355351
cacheExtent: cacheExtent,
356352
cacheExtentStyle: cacheExtentStyle,
@@ -369,7 +365,6 @@ class RenderMessageListViewport extends RenderCustomPaintOrderViewport {
369365
super.axisDirection,
370366
required super.crossAxisDirection,
371367
required super.offset,
372-
super.anchor,
373368
super.children,
374369
super.center,
375370
super.cacheExtent,
@@ -378,6 +373,9 @@ class RenderMessageListViewport extends RenderCustomPaintOrderViewport {
378373
required super.paintOrder_,
379374
});
380375

376+
@override
377+
double get anchor => 1.0;
378+
381379
double? _calculatedCacheExtent;
382380

383381
@override
@@ -499,6 +497,7 @@ class RenderMessageListViewport extends RenderCustomPaintOrderViewport {
499497
// centerOffset is the offset from the leading edge of the RenderViewport
500498
// to the zero scroll offset (the line between the forward slivers and the
501499
// reverse slivers).
500+
assert(anchor == 1.0);
502501
final double centerOffset = mainAxisExtent * anchor - correctedOffset;
503502
final double reverseDirectionRemainingPaintExtent = clampDouble(
504503
centerOffset,

0 commit comments

Comments
 (0)