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
27 stars 28 forks source link

[Help] LateInitializationError #76

Closed VittorioParagallo closed 2 months ago

VittorioParagallo commented 2 months ago

Only during development, in case of doing a hot-reload, the stateManager becomes invalid: LateError (LateInitializationError: Field 'plutoGridStateManager' has not been initialized.) How did you manage to solve it?

doonfrs commented 2 months ago

I don't have the issues with hot reload, my code: at class level: PlutoGridStateManager? _stateManager; then in the widget creation:

onLoaded: (PlutoGridOnLoadedEvent event) {
          _stateManager = event.stateManager;

also I put the grid widget inside statefullbuidler to separate the grid state from the main widget state.