doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
18 stars 20 forks source link

[Bug] PlutoLazyPagination doesn't check if the ScrollView has any Clients #34

Closed Sokcevic closed 4 months ago

Sokcevic commented 4 months ago

I am working with PlutoGridPlus 8.3.0 and I have noticed that if I redraw a Parent Widget of a PlutoGrid with LazyPagination, that the LazyPagination class tries to access Widgets which don't exist anymore.

Steps to reproduce the bug

  1. Have a PlutoGrid which uses LazyPagination
  2. trigger a LazyPagination request
  3. Make sure that a Parent Widget of the Pluto Grid is redrawn before the LazyPagination request completes
  4. Error is thrown

Expected results

No Error is thrown

Actual results

image

Execution Environment

Flutter version Flutter version is 3.19.0

PlutoGrid version PlutoGrid version is 8.3.0

OS Ubuntu 22.04.4 LTS

Sokcevic commented 4 months ago

I've looked at the code and I have found the reason why this is happening. In pluto_lazy_pagination.dart in line 182 the Data is fetch and loaded into the table. While doing this there are no Checks if stateManager.scroll.bodyRowsVertical!.hasClients is true. So a simple check would fix the Problem