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

Prevent Exceptions from async events in pluto_lazy_pagination.dart #35

Closed Sokcevic closed 4 months ago

Sokcevic commented 4 months ago

Solves issue #34

Macacoazul01 commented 4 months ago

@Sokcevic any chances of this breaking? stateManager.scroll.bodyRowsVertical!

Sokcevic commented 4 months ago

I've changed it to if(!mounted). It works as well and is easier to understand.

@Macacoazul01 I think that it solves some problems but there are still some. I will try to find out what causes the error and then give an update.

Sokcevic commented 4 months ago

I have tested it again and I can now say that if(!mounted) works perfectly. stateManager.scroll.bodyRowsVertical! would have caused an Exception because setState is called.

Now the LazyPagination checks if the Widget is still mounted after fetching Data.

If you want I can provide a Code Example for yourself to test it