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

outdated

This is a scanning plug-in for PDA to listen the scanned events and get scanning results.

PDA Scanner #

License Pub

A Flutter plugin 🛠 to scanning. Ready for PDA 🚀

github

pda_scanner.gif

Installation #

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

dependencies:
 pda_scanner: ^0.2.0

Supported #

  • 小码哥-PDA
  • IData-PDA
  • 优博讯-PDA

Features #

  • honeywell pda

Usage #

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    /// 程序启动时初始化 PdaSource.
    PdaSource.init();
  }

  @override
  void dispose() {
    super.dispose();
    /// 退出应用程序时释放 PdaSource 相关资源.
    PdaSource.uninstall();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: PageAlpha(),
    );
  }
}

class PageAlpha extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => PageAlphaState();
}

class PageAlphaState extends PdaListenerState<PageAlpha> {
  var _code;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('PageAlpha'),
      ),
      body: Column(
        children: <Widget>[
          Text('Scanning result: $_code\n'),
          RaisedButton(
            child: Text('Got to Beta'),
            onPressed: () => Navigator.of(context).push(MaterialPageRoute(builder: (context) => PageBeta())),
          ),
        ],
      ),
    );
  }

  /// 监听扫描事件
  @override
  void onEvent(Object event) {
    if (!ModalRoute.of(context).isCurrent) return;
    setState(() {
      _code = event;
      print("ChannelPage: $event");
    });
  }
}

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

This is a scanning plug-in for PDA to listen the scanned events and get scanning results.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on pda_scanner