Keep pager controls clear of floating bars

This commit is contained in:
2026-11-01 02:05:06 +00:00
parent f422d26e32
commit 821d1a8836
4 changed files with 134 additions and 45 deletions
@@ -85,6 +85,35 @@ void main() {
expect(next.bottom, greaterThan(844 - 80));
});
for (final host in ['Material', 'Cupertino']) {
for (final size in [
const Size(390, 844),
const Size(880, 1000),
const Size(1100, 800),
]) {
testWidgets('$host pager clears an inherited stacked bar at $size', (
tester,
) async {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final child = ChangesViewer(steps: twoVisitRun());
final hosted = host == 'Material'
? materialHost(child)
: cupertinoHost(child);
await tester.pumpWidget(
MediaQuery(
data: const MediaQueryData(padding: EdgeInsets.only(bottom: 120)),
child: hosted,
),
);
await tester.pump();
final pager = tester.getRect(find.byKey(ChangesVisitPager.nextKey));
expect(pager.bottom, lessThanOrEqualTo(size.height - 120));
});
}
}
testWidgets('paging stops at both ends instead of wrapping', (tester) async {
await tester.pumpWidget(materialHost(ChangesViewer(steps: twoVisitRun())));