zebra_datawedge 0.1.3 zebra_datawedge: ^0.1.3 copied to clipboard
Support hardware scanner for Zebra devices (ET5X) to receive intent and parse it into readable data.
zebra_datawedge #
NOTICE: This package is forked from here to support for null-safety
Only for Android.
Based on this example: https://github.com/darryncampbell/DataWedge-Intent-Example-1
This package was created to support hardware scanner for Zebra devices (ET5X) with older DataWedge Version (^5.0). Providing a simple stream which contains events fired by DataWedge (5.0).
For sure this is a minimal solution as it focus only to support DataWedge version 5.0. With never DataWedge versions there are more possibilities and also prettier solutions. Like creating incode the necessary profile.
Profile Configuration #
As described in the previous written link, you have to set up your profile configuration properly to be able listen for the DataWedge Intent.
- go to the DataWedge application and create a new
profile
for our application or modify theProfile0
. - Enable the profile
- Enable
Barcode input
- Enable
Intent output
- Configure the
Intent output
as follows:Intent action
=io.mway.flutter_zebra_datawedge.ACTION
- leave
Intent category
empty Intent delivery
=Broadcast
Example #
String _data = "waiting...";
String _labelType = "waiting...";
String _source = "waiting...";
// create a listener for data wedge package
Future<void> initDataWedgeListener() async {
DataWedgeIntent.listenForDataWedgeEvent((response) {
if (response != null && response is String)
setState(() {
Map<String, dynamic> jsonResponse;
try {
jsonResponse = json.decode(response);
} catch (e) {
//TODO handling
}
if (jsonResponse != null) {
_data = jsonResponse["decodedData"];
_labelType = jsonResponse["decodedLabelType"];
_source = jsonResponse["decodedSource"];
} else {
_source = "An error occured";
}
});
});
}
Info #
This package is only tested on Zebra ET5X with Android version 5.1.1 and DataWedge version 5.0.17.