juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
999 stars 759 forks source link

[FEATURE] Add "onLoading() function" or "onLoading widget" for the camera #582

Open abelherl opened 2 years ago

abelherl commented 2 years ago

Is your feature request related to a problem? Please describe. It might not be much but it would be beneficial to have this feature because every time we start the QR view camera we don't have the authority to do something when the camera is not loaded yet. This causes the view to always have a black background before the camera is properly loaded.

Describe the solution you'd like The solution is to have an "onLoading() function" or an "onLoading widget" in the QRView.

Additional context

kamranbekirovyz commented 2 years ago

Nice enhancement suggestion. Below is a workaround I am using for now:

Stack(
    children: [
        const CircularProgressIndicator(),
        QRView(...),
    ],
)
abelherl commented 1 year ago

@kamranbekirovyz I can simply use that sure but the problem is that there is a blank black screen in the first split seconds when the widget is shown, which is why a built-in onLoading() would be really helpful.

kamranbekirovyz commented 1 year ago

The loading will be a replacement for the blank black screen that you are seeing for a while even if it is implemented not by my workaround but by the plugin itself, meaning that the blank black screen will always be there since it is black because the scanner is not ready yet.

abelherl commented 1 year ago

Yes, that's exactly my point because I use other camera dependencies in my app(Not QR), and they do have an onLoading and onLoaded state.