Closed evanblasband closed 3 years ago
hello, which version are you using ?
I am using version 1.10.18
okay this really seems to be a bug. i will fix it
fixed in 1.10.20
Hi,
Unfortunately the bug was not fixed with 1.10.20
. After looking into it, it seems that the following does not actually check if the variable is not initialized:
if (_flushbarRoute == null) {
return false;
}
As a temporary fix I wrapped it in a try catch as follows:
try {
if (_flushbarRoute == null) {
return false;
}
} catch (e) {
print(e);
return false;
}
and the following error was still printed flutter: LateInitializationError: Field '_flushbarRoute@17117910' has not been initialized.
It seems _flushbarRoute
is only initialized when .show()
is called? I am not exactly sure where the best place to initialize it and solve the root of the problem but the try-catch is a band-aide solution.
great observation . maybe i need to change _flushbarRoute from late to optional . will make tests. late cant be checked if its initialized or not.
Has this issue been fixed?
fixed in another_flushbar: ^1.10.22
I was previously using
flushbar
in my app and have now migrated however I am getting the following error:_flushbarRoute@17117910' has not been initialized
My scenario is as follows:
When I was using
flushbar
the_flushbarRoute
was null until it was shown however usinganother_flushbar
it isnot initialized
which is whyisShowing()
creates the error. I am not really sure where to go from here. Any help would be appreciated.Note: I have the check because multiple BLE devices can connect simultaneously (or close to it) and therefore I do not want to bombard the user with flushbars if this happens.