flutter_honeywell_captuvo_plugin_nullsafe

Last updated:

0 purchases

flutter_honeywell_captuvo_plugin_nullsafe Image
flutter_honeywell_captuvo_plugin_nullsafe Images
Add to Cart

Description:

flutter honeywell captuvo plugin nullsafe

Important: This package is based on the flutter_honeywell_captuvo_plugin that can be found at https://github.com/entegyopensource/flutter_honeywell_captuvo_plugin written by @entegyopensource.
The goal of this repository is to update the documentation for the project and to allow usage in flutter applications.
Flutter Honeywell Captuvo Plugin #
Flutter wrapper for the Honeywell Captuvo SL22/42 iOS API with null safety.
Usage #
Make sure you have the following added into the ios/Info.plist:
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.honeywell.scansled.protocol.decoder</string>
</array>
copied to clipboard
There is only one main import that you should add into your dart files:
import 'package:flutter_honeywell_captuvo_plugin/flutter_honeywell_captuvo_plugin.dart';
To use the SL22 or SL42 device we have to make sure we start it by calling:
FlutterHoneywellCaptuvoPlugin.startDecoderHardware();
To get notified when the connection occurs we can use decoderConnectionStream here is a full example:
class _MyAppState extends State<MyApp> {
StreamSubscription decoderConnectionStreamSubscription;

@override
void initState() {
super.initState();
FlutterHoneywellCaptuvoPlugin.startDecoderHardware();
decoderConnectionStreamSubscription = FlutterHoneywellCaptuvoPlugin
.decoderConnectionStream
.listen((isConnected) {
if (isConnected) {
FlutterHoneywellCaptuvoPlugin.startDecoderHardware();
}
});
}

@override
void dispose() {
decoderConnectionStreamSubscription?.cancel();
super.dispose();
}
}
copied to clipboard
The last step is to get notified of barcode scanning changes:
class _MyAppState extends State<MyApp> {
StreamSubscription decoderConnectionStreamSubscription;
StreamSubscription decoderScanDataStreamSubscription;

@override
void initState() {
super.initState();
FlutterHoneywellCaptuvoPlugin.startDecoderHardware();
decoderConnectionStreamSubscription = FlutterHoneywellCaptuvoPlugin
.decoderConnectionStream
.listen((isConnected) {
if (isConnected) {
FlutterHoneywellCaptuvoPlugin.startDecoderHardware();
}
});

decoderScanDataStreamSubscription = FlutterHoneywellCaptuvoPlugin
.decoderScanDataStream
.listen((barcode) {
print(barcode);
});
}

@override
void dispose() {
decoderConnectionStreamSubscription?.cancel();
decoderScanDataStreamSubscription?.cancel();
super.dispose();
}
}
copied to clipboard
See the provided example app for more.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.