🚀A Flutter plugin to scanning. Ready for PDA

Overview

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.9

Supported

  • SEUIC(小码哥)-PDA
  • IData(盈达聚力)-PDA
  • UROVO(优博讯)-PDA
  • HONEYWELL(霍尼韦尔)-PDA
  • PL(攀凌)-PDA

Usage

/// 导入依赖
import 'package:pda_scanner/pda_source.dart';
import 'package:pda_scanner/pda_listener_mixin.dart';
import 'package:pda_scanner/pda_lifecycle_mixin.dart';

/// 自动管理pda生命周期 (自动初始化和自动释放),使用PdaLifecycleMixin混入app根组件状态。
/// 如果遇到多混入的情况请手动进行生命周期的初始化 `super.initPdaLifecycle()` 和 释放 `super.disposePdaLifecycle()` 
class RootWidgetState extends State<RootWidget> with PdaLifecycleMixin<RootWidget> {
  @override
  Widget build(BuildContext context) {
    // TODO
  }
}

/// 混入 PdaListenerMixin 监听扫码事件
/// 如果遇到多混入的情况请手动进行生命周期的初始化 `super.registerPdaListener()` 和 释放 `super.unRegisterPdaListener()` 
class PageAlphaState extends State<PageAlpha> with PdaListenerMixin<PageAlpha> {
  var _code;

  @override
  Widget build(BuildContext context) {
    return null;
  }

  @override
  void onEvent(Object event) {
      // TODO: implement onEvent
  }
  
    @override
  void onError(Object error) {
      // TODO: implement onError
  }
}

Contribute

We would ❤️ to see your contribution!

License

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

About

Created by Shusheng.

Comments
  • The onEvent function is not triggered

    The onEvent function is not triggered

    Hi, I have imported the pda_listener.dar & pda_source.dart files, but when I run mi application in debug mode and use print() sentences in order to track the execution order, the onEvent event is not triggered.

    After to finish the execution, the next message appears: I/PdaScannerPlugin(17438): PdaScannerPlugin:onCancel

    Also I have test with the example posted in git with the same results.

    I'm working with a Honeywell - EDA50 - SO Android 7.1.1 device.

    Do I need to configure something particular in the device or do you think that I missing something?

    question 
    opened by rogs-lv 11
  • Upgrade plugin to support Android V2 Embedding 升级支持 Android V2 Embedding

    Upgrade plugin to support Android V2 Embedding 升级支持 Android V2 Embedding

    遇到以下的问题。可能必须升级?

    The plugin `flutter_pda_scanner` uses a deprecated version of the Android embedding.
    To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
    If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: [https://flutter.dev/go/android-plugin-migration]().
    

    image

    opened by michaelchiew08 2
  • java.lang.RuntimeException: Error receiving broadcast Intent { act=com.android.server.scannerservice.broadcast flg=0x10 (has extras) } in com.shinow.pda_scanner.PdaScannerPlugin$1@3aeda31f Process: com.example.ys_pda, PID: 21418

    java.lang.RuntimeException: Error receiving broadcast Intent { act=com.android.server.scannerservice.broadcast flg=0x10 (has extras) } in com.shinow.pda_scanner.PdaScannerPlugin$1@3aeda31f Process: com.example.ys_pda, PID: 21418

    Flutter:2.2.2
    Dart 2.13.3 pda_scanner: ^0.2.9

    Steps to Reproduce

    RHwCdJ.png

    Logs

    Launching lib\main.dart on PDT 90P in debug mode... lib\main.dart:1 √ Built build\app\outputs\flutter-apk\app-debug.apk. Connecting to VM Service at ws://127.0.0.1:51123/JgsC93lg0fE=/ws D/AndroidRuntime(21619): Shutting down VM E/AndroidRuntime(21619): FATAL EXCEPTION: main E/AndroidRuntime(21619): Process: com.example.ys_pda, PID: 21619 E/AndroidRuntime(21619): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.android.server.scannerservice.broadcast flg=0x10 (has extras) } in com.shinow.pda_scanner.PdaScannerPlugin$1@3aeda31f E/AndroidRuntime(21619): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:876) E/AndroidRuntime(21619): at android.os.Handler.handleCallback(Handler.java:739) E/AndroidRuntime(21619): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime(21619): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(21619): at android.app.ActivityThread.main(ActivityThread.java:5254) E/AndroidRuntime(21619): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(21619): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(21619): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) E/AndroidRuntime(21619): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697) E/AndroidRuntime(21619): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference E/AndroidRuntime(21619): at com.shinow.pda_scanner.PdaScannerPlugin$1.onReceive(PdaScannerPlugin.java:30) E/AndroidRuntime(21619): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:866) E/AndroidRuntime(21619): ... 8 more I/Process (21619): Sending signal. PID: 21619 SIG: 9 Lost connection to device. Exited (sigterm)

    opened by Joseph0717 4
  • 第一次在释放生命周期的时候会提示 PdaScannerPlugin:onCancel;

    第一次在释放生命周期的时候会提示 PdaScannerPlugin:onCancel;

    Steps to Reproduce

    1.当我首次初始化pda_scanner的时候,用扫码枪扫描是可以得到条码的信息的,但是当我离开页面的时候再次进入 扫描就没有反应了 import 'package:flutter/material.dart'; import 'package:pda_scanner/pda_source.dart'; import 'package:pda_scanner/pda_listener_mixin.dart';

    class PdaScan extends StatefulWidget { @override _PdaScanState createState() => _PdaScanState(); }

    class _PdaScanState extends State with PdaListenerMixin { var _code; var _error; @override void initState() { print('init'); PdaSource.init(); super.initState(); } @override void dispose() { print('dispose'); PdaSource.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( body: Container( child: Center( child: Text('$_code'), ) ), ); } @override void onEvent(Object code) { // TODO: implement onEvent setState(() { _code=code; }); } @override void onError(Object error) { // TODO: implement onError print(error); setState(() { _error=error; }); } }

    Logs

    第一次在释放生命周期的时候会提示 PdaScannerPlugin:onCancel; I/PdaScannerPlugin( 4629): PdaScannerPlugin:onCancel

    opened by fanqienoodle 2
  • 在世麦C5000L上不管用,onEvent与onError无法被触发

    在世麦C5000L上不管用,onEvent与onError无法被触发

    class _MainPageState extends State with PdaListenerMixin { var _code; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: Container( child: TextField( focusNode: new FocusNode(), onEditingComplete: () { print("回车"); }, onSubmitted: (value) { print("值:" + value); }, ), ), ); }

    @override void onEvent(Object event) { print(event); }

    @override void onError(Object error) { print(error); } }

    opened by Chen-Yong-Jie 1
Owner
Sword
Abandon the ship or abandon hope, don't repeat yourself.
Sword
Position calculation and beacons scanning, using Dart language with Flutter Framework.

BeaconLocation A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Dimitris Motsios 0 Dec 29, 2021
This is a flutter based project. It authorize the user by scanning fingerprint using ios and android native fingerprint scanners.

flutter_fingerprint_auth Fingerprint Authentication in Flutter Introduction In this article we are talking about fingerprint authentication. As far as

Vnnovate Solutions Pvt Ltd 1 Aug 22, 2022
A full screen mobile scanner for scanning QR Code and Bar Code.

Flutter QR Bar Scanner A Full Screen Scanner for Scanning QR code and Barcode using Google's Mobile Vision API Reading & Scanning QR/Bar codes using F

Lutfor Rahman 31 Oct 5, 2022
A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity

Flutter Ready to Go A Flutter repo with a ready-to-go architecture containing flavors, bloc, device settings, json serialization and connectivity. Why

null 139 Nov 11, 2022
Flutter drawer (dynamic ready side menu)

Flutter side menu (Drawer) Getting Started Use KFDrawer widget as Scaffold's body with items property (List<KFDrawerItem>) you should define onPressed

null 213 Dec 5, 2022
Croco: Stylized widgets ready to plug into your Flutter Web project

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Diego Romero-Lovo 1 Jul 7, 2022
An instantly ready, full-featured alerts for development on any platform with flutter

An instantly ready, full-featured alerts for development on any platform with flutter. Enabling you to complete projects and deploy quickly. With QuickAlert, you can display animated alert dialogs such as success, error, warning, confirm, loading or even a custom dialog.

Belovance 16 Dec 18, 2022
A Blazingly Fast way to configure your Bleeding Edge flutter project to be production ready.

Package Rename A Blazingly Fast way to configure your Bleeding Edge flutter project to be production ready. Package Rename handles changing 30 fields

OutdatedGuy 3 Aug 24, 2022
null 1 Jan 8, 2022
A feature-rich cross-platform webview using webview_flutter for mobile and iframe for web. JS interop-ready.

A feature-rich cross-platform webview using webview_flutter for mobile and iframe for web. JS interop-ready. Getting started Gallery Basic usage Featu

null 2 Mar 17, 2022
Kullanmaya hazir widget cozumleri -Ready to use widget solutions

Ready to use widgets ( ???? ) Projelerimde yararlı widget çözümleri kullanıyorum ve çoğu zaman orada kalıyor. Bunları hem ben hemde sizden gelenler il

Veli Bacik 117 Dec 27, 2022
A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

A package that gives us a modern way to show animated border as a placeholder while loading our widget with easy customization and ready to use.

Mohit Chauhan 8 Oct 3, 2022
A ready-made structure that holds HTTP requests.

A ready-made structure that holds HTTP requests. Usage import 'package:flutter/material.dart'; import 'package:uigitdev_request_holder/src/http_reques

Uigitdev 2 Oct 21, 2022
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform spe

Gillian 33 Dec 18, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022