pda_scanner 0.1.1 copy "pda_scanner: ^0.1.1" to clipboard
pda_scanner: ^0.1.1 copied to clipboard

outdated

这是一个PDA扫码枪(东集小码哥)扫码监听插件。

PDA Scanner #

License Pub

A Flutter plugin 🛠 to scanning. Ready for PDA 🚀

GitHub stars

pda_scanner.gif

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
 pda_scanner: ^0.0.1

Usage example #

static const scannerPlugin = const EventChannel('com.shinow.pda_scanner/plugin');
StreamSubscription _subscription;
var _code;

@override
void initState() {
super.initState();
/// 开启监听
if (_subscription == null) {
  _subscription = scannerPlugin
      .receiveBroadcastStream()
      .listen(_onEvent, onError: _onError);
}
}

@override
void dispose() {
    super.dispose();
    /// 取消监听
    if (_subscription != null) {
      _subscription.cancel();
  }
}

void _onEvent(Object event) {
    setState(() {
      _code = event;
      print("ChannelPage: $event");
    });
}

void _onError(Object error) {
    setState(() {
      _code = "扫描异常";
      print(error);
    });
}

Contribute #

We would ❤️ to see your contribution!

License #

Distributed under the MIT license. See LICENSE for more information.

About #

Created by Shusheng.

9
likes
0
pub points
57%
popularity

Publisher

unverified uploader

这是一个PDA扫码枪(东集小码哥)扫码监听插件。

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pda_scanner