flutter_barcode_scanner 0.0.1 copy "flutter_barcode_scanner: ^0.0.1" to clipboard
flutter_barcode_scanner: ^0.0.1 copied to clipboard

outdated

A plugin supports barcode scanning on both Android and iOS.

flutter_barcode_scanner #

A flutter plugin supports barcode scanning on both Android and iOS.

alt text

Try example #

Just clone the repository, open the project in Android Studio/ VS Code, open pubspec.yaml and click on Packages get. Connect device and hit run. To run on iPhone you need to run from Xcode first time and just make pod install in example/ios.

Getting Started #

Android #

To use on android, you need to add some permissions and a BarcodeCaptureActivity to AndroidManifest.

  1. Add the camera permission to your AndroidManifest.xml

  2. Add the BarcodeScanner activity to your AndroidManifest.xml. Do NOT modify the name.

iOS #

To use on iOS,open the Xcode and add camera usage description in Info.plist

<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>

How to use ? #

After making the changes in Android ans iOS add flutter_barcode_scanner to pubspec.yaml

dependencies:
  ...
  flutter_barcode_scanner: ^0.0.1
  1. You need to import the package first.

    import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';

  2. Then use the scanBarcode method to access barcode scanning.

    String barcodeScanRes = await FlutterBarcodeScanner.scanBarcode(COLOR_CODE);

Here you can pass color which is the line color in barcode overlay.

Special thanks to @Harshal Jadhav for help in iOS

About me .. #

My email id, [email protected]

Amol Gangadhare

1282
likes
0
pub points
99%
popularity

Publisher

unverified uploader

A plugin supports barcode scanning on both Android and iOS.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_barcode_scanner