Remove unused DetailDropDown and TenderDetailCard components to streamline codebase and improve maintainability. These components were previously disabled and retained for potential future use.

This commit is contained in:
AmirReza Jamali
2026-06-06 12:25:49 +03:30
parent 86ed7bc665
commit aa9c9444fa
3 changed files with 16 additions and 188 deletions
@@ -35,7 +35,12 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
@override
void initState() {
super.initState();
_scrollController.addListener(_onScroll);
// The scroll controller is only attached to the desktop ListView, so only
// register the prefetch listener there. Mobile prefetching is driven by
// PageView's onPageChanged instead.
if (widget.isDesktop) {
_scrollController.addListener(_onScroll);
}
}
void _onScroll() {
@@ -140,6 +145,10 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
controller: pageController,
itemCount: widget.tenders.length,
onPageChanged: (index) {
// currentPage is still the previous page here; a forward swipe means
// the new (1-indexed) page is greater than the old one.
final bool isForwardSwipe = index + 1 > currentPage;
setState(() {
currentPage = index + 1;
});
@@ -150,9 +159,12 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
viewModel.getTenderFeedback(id);
}
// Infinite scroll: once we pass the halfway point of the loaded
// tenders, prefetch the next page in the background.
if (index >= (widget.tenders.length * _prefetchFraction).floor()) {
// Infinite scroll: once we swipe forward past the halfway point of the
// loaded tenders, prefetch the next page in the background. Skip
// back-swipes so we don't refetch while the user reviews earlier
// tenders.
if (isForwardSwipe &&
index >= (widget.tenders.length * _prefetchFraction).floor()) {
_maybeLoadMore();
}
},