Aoi-hosizora / flutter_ahlib

A personal flutter library, contains some useful widgets and utils.
MIT License
3 stars 0 forks source link

Improve AppendIndicator and ScrollDataView onAppend #8

Closed Aoi-hosizora closed 3 years ago

Aoi-hosizora commented 3 years ago

Need to add a threshold for AppendIndicator to check if it needs to append when the list is short.

And fix the scroll invoked when the onAppend invoked but it has been scrolled up.

Aoi-hosizora commented 3 years ago

Update: return false for NotificationListener.

Aoi-hosizora commented 3 years ago

Fix for 1:

void _onPointerMove(PointerMoveEvent e) {
  if (e.down && _pointerDownPosition != null) {
    bool short = _extent == 0;
    if (short && _pointerDownPosition - (e.position?.dy ?? 0) > _kPointerMovingThreshold) {
      _show(); // 2
    }
  }
}
Aoi-hosizora commented 3 years ago

Fix for 2: (only for PaginationListView, wait for v1.2)

widget.data.addAll(list);
if (notShortAndBottom) {
  widget.controller?.scrollDown(); // <<<
}