famoco_scanner 1.0.1 famoco_scanner: ^1.0.1 copied to clipboard
A flutter implementation of the Famoco scanner device.
README #
A flutter implementation of the Famoco scanner device.
Requirements #
- Minimum version is for Android 10 (API 28).
Compatible devices #
Those mentioned in the SDK.
Compatible with :
- FX 325 (
FX325,1
) - FX 335 (
FX335,1
)
Tested on :
- FX 335 (
FX335,1
)
Usage #
-
Make your
MainActivity
inheritFamocoScanPhysicalButtonHandlerActivity
. If you found a better way to handle the physical button, you can ignore this step.Ignoring this step also means
FamocoScanner.instance.scanPhysicalButton
will not be called. -
Simply use
FamocoScanner.instance
. e.g.FamocoScanner.instance.startScan();
To intercept a barcode, you'll only need to use
decodedComplete
on aStatefulWidget
:@override void initState() { super.initState(); _onDecodedSubscription = FamocoScanner.instance.decodedComplete.listen( (data) { setState(() { _lastBarcodeScanned = data.barcode; }); }); } @override void dispose() { super.dispose(); _onDecodedSubscription.cancel(); }
The method
FamocoScanner.instance.enableScanner();
is automatically called on subsribing todecodedComplete
, same thing when callingcancel
on the subscription,disableScanner
is called.
ℹ️ The instance of the implementation is automatically chosen based on the device's brand.
Example #
See the example app.
This is a replica of the app found in the SDK documentation : Demo app (v1.3, source code).
Used by #
Made and used by Aleda .