v0.0.5barcode_finder
Barcode Finder는 Android에서는 Zxing을 사용하여 PDF 파일과 이미지에서 바코드와 QR 코드를 읽고, iOS에서는 Zxing과 Zbar를 사용하는 플러그인입니다.
PopcodeMobile/barcode-finder open-source repository details.
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A flutter plugin for barcode scanner that works on both iOS and Android. Provides functionality for scanning several formats of 1D and 2D barcodes.
It uses ML-kit on Android and iOS to detect codes from PDF and Image files.
Example using appAdd this to your package's pubspec.yaml file:
dependencies:
barcode_finder: latest version
API 21 is the minimum supported for Android.
Lets take a look at how to use BarcodeFinder to scan any PDF or image File using File Picker as a auxiliar plugin.
Future<String?> scanFile() async {
// Used to pick a file from device storage
final pickedFile = await FilePicker.platform.pickFiles();
if (pickedFile != null) {
final filePath = pickedFile.files.single.path;
if (filePath != null) {
return await BarcodeFinder.scanFile(path: path);
}
}
}
Make sure you are passing a valid and permissioned path to BarcodeFinder.scanFile, in the exemple above, the package FilePicker provides it for us.