onError property Null safety
read / write
A callback for error reporting if one of the listeners added with addListener throws.
This callback should not throw.
It exists for error reporting (mainly
should not be used otherwise.
If you need an error status, consider adding an error property on your custom state.
If no onError is specified, fallbacks to