GithubHelp home page GithubHelp logo

kristofb / flutter_scan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flutter-package/flutter_scan

0.0 0.0 0.0 188 KB

scanner qrcode in widget tree & decoder qrcode from image

License: MIT License

Ruby 2.81% Objective-C 0.82% Java 63.64% Dart 11.02% Swift 21.70%

flutter_scan's Introduction

scan

scan

scan qrcode & barcode in widget tree.

decode qrcode & barcode image from path.

if you want to generate qrcode image, you should use qr_flutter

Features

  • use ScanView in widget tree to show scan view.
  • custom identifiable area.
  • decode qrcode from image path by Scan.parse.

prepare

ios

info.list

<key>NSCameraUsageDescription</key>
<string>Your Description</string>

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
android
<uses-permission android:name="android.permission.CAMERA" />

<application>
  <meta-data
    android:name="flutterEmbedding"
    android:value="2" />
</application>
scan: ^newest
import 'package:scan/scan.dart';

Usage

  • show scan view in widget tree
ScanController controller = ScanController();
String qrcode = 'Unknown';

Container(
  width: 250, // custom wrap size
  height: 250,
  child: ScanView(
    controller: controller,
// custom scan area, if set to 1.0, will scan full area
    scanAreaScale: .7,
    scanLineColor: Colors.green.shade400,
    onCapture: (data) {
      // do something
    },
  ),
),
  • you can use controller.resume() and controller.pause() resume/pause camera
controller.resume();
controller.pause();
  • get qrcode string from image path
String result = await Scan.parse(imagePath);
  • toggle flash light
controller.toggleTorchMode();

proguard-rules

-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}

License

MIT License

flutter_scan's People

Contributors

chavesgu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.