Git Product home page Git Product logo

qr_code_tools's Introduction

QR Code Tools

Build Status pub package

The Flutter plugin for iOS and Android to decoding QR codes.

Installation

First, add qr_code_tools as a dependency in your pubspec.yaml file.

iOS

Add one rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Photo Library Usage Description and a usage description.

Or in text format add the key:

<key>NSPhotoLibraryUsageDescription</key>
<string>Can I use the photo library please?</string>

Android

Nothing to do

Example

import 'package:qr_code_tools/qr_code_tools.dart';

String _data;

/// decode from local file
Future decode(String file) async {
  String data = await QrCodeToolsPlugin.decodeFrom(file);
  setState(() {
    _data = data;
  });
}

For a more elaborate usage example see here.

qr_code_tools's People

Contributors

aifeii avatar rxdljm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

qr_code_tools's Issues

Android error

I found a problem in version 0.1.0
截圖 2024-05-20 下午3 24 47

andoird gradle plugin version error

Crash happens when decode QR in a big size jpg image in Android.

If this image is jpg type, and size is around 20MB, will crash in Android. There is no issue with a 25MB png file.

For iOS, like iPadOS 14.5, works well.

Env:
Plugin version: 0.0.7

Android: tablet, Android 9.0.

20MB JPG Image Sample


30MB JPG Image Sample

....
E/AndroidRuntime(15350): java.lang.OutOfMemoryError: Failed to allocate a 840500016 byte allocation with 12582912 free bytes and 190MB until OOM, max allowed footprint 14148688, growth limit 201326592
E/AndroidRuntime(15350):        at com.aifeii.qrcode.tools.QrCodeToolsPlugin.onMethodCall(QrCodeToolsPlugin.kt:44)
E/AndroidRuntime(15350):        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime(15350):        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime(15350):        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/AndroidRuntime(15350):        at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime(15350):        at android.os.MessageQueue.next(MessageQueue.java:326)
E/AndroidRuntime(15350):        at android.os.Looper.loop(Looper.java:160)
E/AndroidRuntime(15350):        at android.app.ActivityThread.main(ActivityThread.java:6758)
E/AndroidRuntime(15350):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(15350):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(15350):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/Process (15350): Sending signal. PID: 15350 SIG: 9
Lost connection to device.

SWIFT VERSION ISSUE(migrate the code to Swift 4.)

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift.
Supported values are: 4.0, 4.2, 5.0. This setting can be set in the build settings editor.

And I am getting this suggestions in Xcode

The target “qr_code_tools” contains source code developed with Swift 3.x. This version of Xcode does not support building or migrating Swift 3.x targets.

Use Xcode 10.1 to migrate the code to Swift 4.

Can you please migrate it to Swift 4

unable to scan qr

tried this:
no feedback from
scanQRDataByImage(String path, ImagePickerQRScanCallback callback) async{
print(path);
async QrCodeToolsPlugin.decodeFrom(path).then((data){
print("SCANNED DATA");
print(data);
});
}

'Specify Swift version' ?

hi there,

If i try to build on iOS, i get this:

qr_code_tools does not specify a Swift version and none of the targets (Runner) integrating it have the
SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of
the targets that integrate this pod.

i'am using Flutter stable, v1.9.1+hotfix.6
on Mac OS X 10.13.6 / Xcode 10.1

do you have any idea have to make it work ?

any help appreciated :)
thanks,
matthias

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.