Open guilhermedaldim opened 2 years ago
Can you please add which branch or version you are on?
I'm test in develop branch
Normally the preview should just continue, independent of hot reloads. Maybe if the widget tree is rebuilt...
Sorry man the problem occours with Hot Restart
This seems to be a more general issue with hot restart (related issue)
I've experienced this as well but never had this problem on the flutter_barcode_scanner
, so I would think it's something that can be fixed.
Any news on this? It's stil happening on develop
I can confirm that this is still an issue using ^2.0.0-dev.2.
If you happen to have the camera active - scanning for a barcode - an exception is thrown when your app is restarted via the debugger and you return to the view with the BarcodeCamera() widget. The following is displayed:
Error: PlatformException(ALREADY_INITIALIZED, Camera is already initialised, null, null)
If you navigate away from the view and back again, the camera reinitialises correctly and you can continue scanning.
Same problem here.
Another problem I noticed, is that in debug when calling Hot Reload with the camera open, I wait for the event end and when trying to open the camera again I get the following:
PlatformException (PlatformException(ALREADY_INITIALIZED, Camera is already initialized, null, null)).
I believe it is the
dispose()
call that is not being made in this case, because when to close and open the camera again, it works normally.