Files
alan edc503b228 Remove Cupertino changes branches
Keep the Material-only changes feature while preserving public Cupertino parameters for callers. Remove Cupertino-only widgets, imports, hosts, and tests because the app never reaches that path.
2026-11-11 16:22:09 +00:00

45 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import '../../../ui/navigation/chevron_pager.dart';
/// The Changes page's Previous/Next pager over the run's recorded stage visits.
///
/// It only moves between the captures the viewer already holds and never wraps:
/// the first recorded visit has no previous page and the last none after it.
/// The shown visit's own heading (its stage and visit number) stays with the
/// capture section below, so paging never loses which visit is on screen.
class ChangesVisitPager extends StatelessWidget {
const ChangesVisitPager({
super.key,
required this.index,
required this.count,
required this.onPrevious,
required this.onNext,
});
static const previousKey = ValueKey<String>('changes-previous-visit');
static const nextKey = ValueKey<String>('changes-next-visit');
/// The shown visit's zero-based position in the run's recorded visits.
final int index;
final int count;
final VoidCallback onPrevious;
final VoidCallback onNext;
@override
Widget build(BuildContext context) {
if (count <= 1) return const SizedBox.shrink();
return ChevronPager(
index: index,
count: count,
previousLabel: 'Previous visit',
nextLabel: 'Next visit',
previousKey: previousKey,
nextKey: nextKey,
positionKey: const ValueKey<String>('changes-visit-position'),
onPrevious: index > 0 ? onPrevious : null,
onNext: index < count - 1 ? onNext : null,
);
}
}