Skip to content

Commit 6a50072

Browse files
committedMar 25, 2025
msglist [nfc]: Use SliverPaintOrder.firstIsTop
This changes the paint order of these slivers. Right now that has no observable effect, because the second sliver has zero height and paints nothing. In the future when we put the messages in back-to-back slivers, this is the paint order we'll need so that the top sliver can have a sticky header overflow properly over the bottom sliver.
1 parent 3ce1c2a commit 6a50072

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎lib/widgets/message_list.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'dart:math';
22

33
import 'package:collection/collection.dart';
4-
import 'package:flutter/material.dart';
4+
// ignore: undefined_hidden_name // anticipates https://github.com/flutter/flutter/pull/164818
5+
import 'package:flutter/material.dart' hide SliverPaintOrder;
56
import 'package:flutter_color_models/flutter_color_models.dart';
67
import 'package:intl/intl.dart' hide TextDirection;
78

@@ -21,6 +22,7 @@ import 'emoji_reaction.dart';
2122
import 'icons.dart';
2223
import 'page.dart';
2324
import 'profile.dart';
25+
import 'scrolling.dart';
2426
import 'sticky_header.dart';
2527
import 'store.dart';
2628
import 'text.dart';
@@ -629,7 +631,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
629631
sliver = SliverSafeArea(sliver: sliver);
630632
}
631633

632-
return CustomScrollView(
634+
return CustomPaintOrderScrollView(
633635
// TODO: Offer `ScrollViewKeyboardDismissBehavior.interactive` (or
634636
// similar) if that is ever offered:
635637
// https://github.com/flutter/flutter/issues/57609#issuecomment-1355340849
@@ -645,6 +647,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
645647
semanticChildCount: length + 2,
646648
anchor: 1.0,
647649
center: centerSliverKey,
650+
paintOrder: SliverPaintOrder.firstIsTop,
648651

649652
slivers: [
650653
sliver,

0 commit comments

Comments
 (0)