FL01: Pagination & Infinite Scroll
Initial load, page appending, retry on failure, and duplicate trigger prevention
Naive Flutter pagination implementations typically listen to ScrollController and invoke an async fetch without locking or token validation. When the user scrolls quickly, multiple concurrent requests fire for the same page cursor. Furthermore, if the user pulls to refresh while a previous page fetch is still in flight, the delayed response returns late and appends stale rows to the freshly cleared list, corrupting feed order and duplicating IDs.
The solution introduces a deterministic PaginationController with three strict guards: (1) `_isRequestInFlight` lock rejecting duplicate concurrent triggers; (2) `_activeRequestId` generation token that increments on every query or reset, immediately invalidating late asynchronous responses; and (3) a unique item ID Set ensuring zero row duplication even if the backend returns overlapping items.