2 Star 5 Fork 1

Fniu / idata_pda

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

idata_pda

IData手持pda设备红外扫描监听 #仅限Android

如何使用

1. 红外扫描 (目前支持: IData PDA安装过IScan Pro的型号)

​ 第一种方式Mixin混入

// 第一步:混入Mixin
class _MyAppState extends State<MyApp> with PdaScanMixin<MyApp> {
  // 获取pda扫描后结果
  @override
  Future<void> pdaResultHandler(String code) async {}
}

​ 第二种方式

// 在任何地方监听扫描数据
PdaScanUtil.instance.listen((String code) {});

​ 销毁请使用

// 不需要的时候记得关闭它
PdaScanUtil.instance.cancel();

2. 获取android版本

String? version = await IdataPda.platformVersio;

3. PDA设置附加按键

// 说明:将指定按键键值附加到扫描结果后。
// 输入参数:flag,参数值,附加值类型。支持的值如下:
// 不传入默认为 0
// 0:不附加内容
// 1:附加回车键
// 2:附加 TAB 键
// 3:附加换行符(\n)
// 返回值:空

await IdataPda.enableAddKeyValue(flag: 0);

参考文献

​ 1. PDA红外扫描(flutter插件开发,监听原生广播返回数据 - 简书 (jianshu.com)

Copyright 2021, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

flutter 解决IDATA广播事件,内置部分功能 PDA型号:idata(内置已安装scan_pro) PUB地址:https://pub.dev/packages/idata_pda 展开 收起
Dart 等 4 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Dart
1
https://gitee.com/Fniu/idata_pda.git
git@gitee.com:Fniu/idata_pda.git
Fniu
idata_pda
idata_pda
master

搜索帮助