pda_scanner 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new57

PDA Scanner #

License Pub

A Flutter plugin 🛠 to scanning. Ready for PDA 🚀

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.

[0.0.1] - 2019/04/12

[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

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

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

Version Uploaded Documentation Archive
0.1.3 Apr 15, 2019 Go to the documentation of pda_scanner 0.1.3 Download pda_scanner 0.1.3 archive
0.1.2 Apr 13, 2019 Go to the documentation of pda_scanner 0.1.2 Download pda_scanner 0.1.2 archive
0.1.1 Apr 12, 2019 Go to the documentation of pda_scanner 0.1.1 Download pda_scanner 0.1.1 archive
0.1.0 Apr 12, 2019 Go to the documentation of pda_scanner 0.1.0 Download pda_scanner 0.1.0 archive
0.0.3 Apr 12, 2019 Go to the documentation of pda_scanner 0.0.3 Download pda_scanner 0.0.3 archive
0.0.2 Apr 12, 2019 Go to the documentation of pda_scanner 0.0.2 Download pda_scanner 0.0.2 archive
0.0.1 Apr 12, 2019 Go to the documentation of pda_scanner 0.0.1 Download pda_scanner 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
14
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]
57
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

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