v0.2.1barras
안드로이드 및 iOS용 간단하고 사용자 정의 가능한 바코드 스캔 패키지입니다. iOS에서는 AVCaptureSession을, 안드로이드에서는 ZXing을 사용합니다.
안드로이드 및 iOS용 간단하고 사용자 정의 가능한 바코드 스캔 플러터 패키지입니다. iOS에서는 AVCaptureSession을, 안드로이드에서는 ZXing을 사용합니다.
{"sdk":"flutter"}^1.0.2^2.0.1^1.0.0{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
This document is also available in: English | Português
Barras is a simple and customizable barcode scanning Flutter package for Android and iOS. It uses AVCaptureSession in iOS and ZXing in Android.
Please bear in mind that Barras is experimental, in early development stage.
Barras requires camera usage permission, on both iOS and Android. This must be implemented by you, considering any alternatives that you may be already using for user permission requests.
If you are not handling permissions yet, there are good plugins to do it, like permission_handler.
Besides that, Barras depends on the following:
Add Barras dependency to the pubspec.yaml file:
dependencies:
barras: ^0.2.1
Import it in your code:
import 'package:barras/barras.dart';
Simply call the scan method, and we are good to go:
// Open the barcode reading page. Returned data will be null if
// Cancel button is pressed, or if user navigates back
final data = await Barras.scan(context);
Default barcode capture page
You can also customize the appearance of the barcode capture page:
// Open the barcode reading page. Customize the appearance, changing the
// viewfinder color, size and blinking speed. Returned data will be null
// if Cancel button is pressed, or if user navigates back
final data = await Barras.scan(
context,
viewfinderHeight: 120,
viewfinderWidth: 300,
scrimColor: Color.fromRGBO(128, 0, 0, 0.5),
borderColor: Colors.red,
borderRadius: 24,
borderStrokeWidth: 2,
buttonColor: Colors.yellow,
borderFlashDuration: 250,
cancelButtonText: "取消",
successBeep: false,
);
Customized barcode capture page
You can check a working example app in the example folder.