pda_scanner 0.1.5

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

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.

[0.0.1] - 2019/04/12

  • 支持【小码哥】型号PDA

[0.0.2] - 2019/04/12

[0.0.3] - 2019/04/12

[0.1.0] - 2019/04/12

[0.1.1] - 2019/04/12

[0.1.2] - 2019/04/13

[0.1.3] - 2019/04/15

[0.1.4] - 2019/04/29

[0.1.5] - 2019/06/26

  • 支持【IDATA】型号PDA
  • 支持【优博讯】型号PDA

example/README.md

pda_scanner_example #

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  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);
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Scanning result: $_code\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  pda_scanner: ^0.1.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8

Admin