搜索插件、代码仓与 APP 分类

插件详情v3.2.0

flutter_datawedge

一个用于通过 DataWedge Intent API 与 Zebra DataWedge 扫描仪通信的 Flutter 包

Android
近 30 天下载
7670
喜欢数
41
Pub 分数
160

安装插件

flutter pub add flutter_datawedge

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,通过 DataWedge Intent API 实现与 Zebra DataWedge 扫描仪在 Android 设备上的通信。它允许开发者配置扫描仪设置、接收扫描数据,并直接在 Flutter 应用中管理输入源。该包专为与 Zebra 移动设备无缝集成而设计,非常适合库存、物流和零售环境,这些场景中条形码扫描至关重要。它通过平台通道利用原生 Android 功能,确保可靠性能并实现对扫描操作的底层控制。

适合场景

  • 库存管理
  • 零售结账系统
  • 物流追踪
  • 资产标记
  • 条形码数据收集

主要特点

  • 实时扫描数据接收
  • 可配置的扫描仪输入源
  • 仅限 Android 的原生集成
  • 基于意图的通信
  • 支持多种斑马设备型号

适合对象

  • 针对 Zebra Android 设备的开发者
  • 需要可靠条形码扫描的应用程序
  • 企业级库存应用
  • 现场服务和仓库软件

使用建议

  • 仅需 Android 平台
  • Zebra 设备依赖
  • 需要正确的 DataWedge 配置
  • 仅限安装了 DataWedge 的设备
  • 可能需要额外权限

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_datawedge

pub package

A Flutter package to communicate with Zebra DataWedge scanners.

Internally, this package uses the DataWedge APIs and therefore is only compatible with Android.

Getting Started

Example

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


    FlutterDataWedge dw = FlutterDataWedge();
    await dw.initialize();
    await createDefaultProfile(profileName: "Example Profile");
    StreamSubscription onScanSubscription = dw.onScanResult.listen((ScanResult result) {
        print(result.data);
    });
    
    [...]
    
    // Stop listening for new scans.
    onScanSubscription.cancel();

Also checkout the example application.

Profiles

Unlike previous versions, this version of the package won't create a profile and configure it while calling initialize. Instead a profile can be created using the createDefaultProfile method. To query all available profiles use requestProfiles, to query the active profile use requestActiveProfile. The functions waitForProfiles and waitForActiveProfile can be used to wait results after the requesting function has been called.

Further, see the official documentation to create, update or replace a DataWedge profiles.

async/await

Event though the public methods enableScanner(), activateScanner() and scannerControl() are asynchronous they return as soon as the command is executed. Each of these methods (as well as initialize()) will cause ActionResult objects to be emitted on the onScannerEvent Stream. Those can be used to determine the outcome of a command and properly wait for it. Here is a short example:

    FlutterDataWedge dw = FlutterDataWedge();
    await dw.initialize();
    
    // This would be a properly awaited version of enableScanner
    Future<ActionResult> enableScanner() {
        final completer = Completer<ActionResult>();
        final myIdentifier = "someIdentifier";
        
        StreamSubscription onScannerEventSubscription = dw.onScannerEvent.listen((ActionResult result) {
            if (result.commandIdentifier == myIdentifier) {
                completer.complete(result);
            }
        });
        
        
        dw.enablescanner(true,commandIdentifier: myIdentifier);
        
        return completer.future;
    }

Acknowledgements

The package was started by rafaeljustinox and and contains contributions by LenhartStephan. It is now maintained by Circus Kitchens.

所属分类

依赖

依赖清单 8 项

源码仓库

使用此插件的项目

暂无相关数据。