ObserveScrollDirection
Observes this LazyListState's scroll position and calls onScrollForward/onScrollBackward every time the scroll direction actually changes (not on every scroll delta) — the real mechanism behind LazyColumn/LazyRow's OnScrolled trigger (ScrollDirection.Bottom/End maps to onScrollForward, ScrollDirection.Top/Start to onScrollBackward).
Direction is derived by comparing the current firstVisibleItemIndex/firstVisibleItemScrollOffset pair against the previous one on every emission of snapshotFlow; a frame where neither changes calls neither callback.
Parameters
called when the list's first visible item moves later (scrolling toward the end of the list).
called when it moves earlier (scrolling toward the start).
Same as the LazyListState overload above, for a plain (non-lazy) ScrollState — the mechanism behind Column/Row's own OnScrolled trigger when scrollable = true. Direction is derived by comparing the current scroll offset (ScrollState.value) against the previous one.
Parameters
called when the scroll offset increases.
called when it decreases.