How to open barcode scanner in a custom widget?
280
Use Stack
widget to achieve this (to overlap one widget on another).
I used qr_code_scanner plugin in my case.
Stack(
children:[
/* replace this widget with your own */
QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
),
Column(
children:[
/* button control here */
]
),
]
);
See https://api.flutter.dev/flutter/widgets/Stack-class.html for more info about stack.
Author by
Alperen ARICI
Updated on November 28, 2022Comments
-
Alperen ARICI over 1 year
I want to open barcode scanner in a container - Custom Widget (Not just barcode scanner QR). For example, while scanning the barcode at the top of the screen, I want to put a button at the bottom to add the barcode I scanned to the shopping cart. Can you suggest a library or method to do this?
I am putting an example picture below.
-
Alperen ARICI about 3 yearsThis answer seems correct. When I started the project, I did not see this library and used another one. I will probably move the scan to this library. Thank you so much.