flutter_datalogic

pub package pub points flutter_datalogic

A Flutter package communicate with Datalogic scanners.

Platform Support

Android iOS

Installation

First, add flutter_datalogic as a dependency in your pubspec.yaml file.

Android

Create file name proguard-rules.pro in same directory with your android/app/build.gradle

-keep class com.datalogic.cradle.** { *; }
-keep class com.datalogic.decode.** { *; }
-keep class com.datalogic.device.** { *; }
-keep class com.datalogic.extension.** { *; }
-keep class com.datalogic.softspot.** { *; }

Configure the buildTypes release in your android/app/build.gradle file.

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

Add config in your android/app/src/main/AndroidManifest.xml file.

<application>
    <uses-library
        android:name="com.datalogic.device"
        android:required="false" />
</application>

Usage

Initialize the FlutterDatalogic Object and attach a listener to the onScanResult Stream.

Example:

import 'package:flutter_datalogic/flutter_datalogic.dart';

FlutterDatalogic dl = FlutterDatalogic();
StreamSubscription onScanSubscription = dl.onScannerInfo.listen((result) {
  print(result.status);
  print(result.data);
});

Learn more

Libraries

flutter_datalogic