Welcome to

Shenzhen RakindaTechnology Co., Ltd.

Official website!

Company news

Home > News > Company news
Barcode Scanner in Flutter
Source:Powered | Author:admin | Time:2019-07-30 | Views:87
Flutter is an open-source mobile application development framework created by Google. It is used to develop applications for Android and iOS, as well as being the primary method of creating applications for Google Fuchsia.

A flutter plugin for scanning 2D barcodes and QR codes. If you connect a small barcode scanner hardware with your handheld mobile computer, we can also use the flutter source code to send commands that trigger the scan function of barcode scanner and get the application running.



This provides a simple wrapper for two commonly used iOS and Android libraries.

Getting Started
Android
For Android, you must do the following before you can use the plugin:

Add the camera permission to your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />
Add the BarcodeScanner activity to your AndroidManifest.xml. Do NOT modify the name.
<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>
This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See installing the Kotlin plugin.
Edit your project-level build. Gradle file to look like this:
buildscript {
    ext.kotlin_version = '1.3.21'
    ...
    dependencies {
        ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
...
Edit your app-level build.gradle file to look like this:
apply plugin: 'kotlin-android'
...
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    ...
}
Now you can depend on the barcode_scan plugin in your pubspec.yaml file:

dependencies:
  ...
  barcode_scan: any
Click "Packages get" in Android Studio or run flutter packages get in your project folder.

iOS
To use on iOS, you must add the the camera usage description to your Info.plist
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>

Barcode scanner for Android is widely used in warehouse, logistics, manufacturing, etc. It will not any problem to work all day long with the high battery capacity.
 
Ms Wang
Ms Jane
Ms Linda
Hot Line
86-13480605108