famoco_scanner 1.0.1 copy "famoco_scanner: ^1.0.1" to clipboard
famoco_scanner: ^1.0.1 copied to clipboard

PlatformAndroid

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 #

  1. Make your MainActivity inherit FamocoScanPhysicalButtonHandlerActivity. 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.

  2. Simply use FamocoScanner.instance. e.g.

    FamocoScanner.instance.startScan();
    

    To intercept a barcode, you'll only need to use decodedComplete on a StatefulWidget:

     @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 to decodedComplete, same thing when calling cancel 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 Aleda.

0
likes
150
pub points
17%
popularity

Publisher

verified publisheremysramen.net

A flutter implementation of the Famoco scanner device.

Homepage

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on famoco_scanner