Julian Steenbakker

doc: update readme

Showing 1 changed file with 18 additions and 22 deletions
@@ -3,40 +3,42 @@ @@ -3,40 +3,42 @@
3 [![pub package](https://img.shields.io/pub/v/mobile_scanner.svg)](https://pub.dev/packages/mobile_scanner) 3 [![pub package](https://img.shields.io/pub/v/mobile_scanner.svg)](https://pub.dev/packages/mobile_scanner)
4 [![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint) 4 [![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)
5 [![mobile_scanner](https://github.com/juliansteenbakker/mobile_scanner/actions/workflows/flutter.yml/badge.svg)](https://github.com/juliansteenbakker/mobile_scanner/actions/workflows/flutter.yml) 5 [![mobile_scanner](https://github.com/juliansteenbakker/mobile_scanner/actions/workflows/flutter.yml/badge.svg)](https://github.com/juliansteenbakker/mobile_scanner/actions/workflows/flutter.yml)
6 -[![GitHub Sponsors](https://img.shields.io/github/sponsors/juliansteenbakker?label=sponsor%20me)](https://github.com/sponsors/juliansteenbakker) 6 +[![GitHub Sponsors](https://img.shields.io/github/sponsors/juliansteenbakker?label=like%20my%20work?%20sponsor%20me!)](https://github.com/sponsors/juliansteenbakker)
7 7
8 -A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. 8 +An universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS.
9 9
10 -## Platform Support 10 +## Features Supported
11 11
12 -| Android | iOS | MacOS | Web | Linux | Windows |  
13 -| :-----: | :-: | :---: | :-: | :---: | :-----: |  
14 -| ✔️ | ✔️ | ✔️ | ✔️ | | | 12 +See the example app for detailed implementation information.
15 13
16 -### Android  
17 -SDK 21 and newer. Reason: CameraX requires at least SDK 21.  
18 -Also, make sure you upgrade kotlin to the latest version in your project. 14 +| Features | Android | iOS | macOS | Web |
  15 +|------------------------|--------------------|--------------------|-------|-----|
  16 +| analyzeImage (Gallery) | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
  17 +| returnImage | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
  18 +| scanWindow | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
  19 +| barcodeOverlay | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
  20 +
  21 +## Platform Support
19 22
20 -This packages uses the **bundled version** of MLKit Barcode-scanning for Android. This version is more accurate and immediately available to devices. However, this version will increas the size of the app with approximately 3 to 10 MB. The alternative for this is to use the **unbundled version** of MLKit Barcode-scanning for Android. This version is older than the bundled version however this only increases the size by around 600KB. 23 +| Android | iOS | macOS | Web | Linux | Windows |
  24 +|---------|-----|-------|-----|-------|---------|
  25 +| ✔ | ✔ | ✔ | ✔ | :x: | :x: |
21 26
  27 +## Platform specific setup
  28 +### Android
  29 +This packages uses the **bundled version** of MLKit Barcode-scanning for Android. This version is more accurate and immediately available to devices. However, this version will increase the size of the app with approximately 3 to 10 MB. The alternative for this is to use the **unbundled version** of MLKit Barcode-scanning for Android. This version is older than the bundled version however this only increases the size by around 600KB.
22 To use this version you must alter the mobile_scanner gradle file to replace `com.google.mlkit:barcode-scanning:17.0.2` with `com.google.android.gms:play-services-mlkit-barcode-scanning:18.0.0`. Keep in mind that if you alter the gradle files directly in your project it can be overriden when you update your pubspec.yaml. I am still searching for a way to properly replace the module in gradle but have yet to find one. 30 To use this version you must alter the mobile_scanner gradle file to replace `com.google.mlkit:barcode-scanning:17.0.2` with `com.google.android.gms:play-services-mlkit-barcode-scanning:18.0.0`. Keep in mind that if you alter the gradle files directly in your project it can be overriden when you update your pubspec.yaml. I am still searching for a way to properly replace the module in gradle but have yet to find one.
23 31
24 [You can read more about the difference between the two versions here.](https://developers.google.com/ml-kit/vision/barcode-scanning/android) 32 [You can read more about the difference between the two versions here.](https://developers.google.com/ml-kit/vision/barcode-scanning/android)
25 33
26 ### iOS 34 ### iOS
27 -iOS 11 and newer. Reason: MLKit for iOS requires at least iOS 10 and a [64bit device](https://developers.google.com/ml-kit/migration/ios).  
28 -  
29 **Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:** 35 **Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:**
30 -  
31 NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor. 36 NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.
32 37
33 **If you want to use the local gallery feature from [image_picker](https://pub.dev/packages/image_picker)** 38 **If you want to use the local gallery feature from [image_picker](https://pub.dev/packages/image_picker)**
34 -  
35 NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor. 39 NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
36 40
37 ### macOS 41 ### macOS
38 -macOS 10.13 or newer. Reason: Apple Vision library.  
39 -  
40 Ensure that you granted camera permission in XCode -> Signing & Capabilities: 42 Ensure that you granted camera permission in XCode -> Signing & Capabilities:
41 43
42 <img width="696" alt="Screenshot of XCode where Camera is checked" src="https://user-images.githubusercontent.com/24459435/193464115-d76f81d0-6355-4cb2-8bee-538e413a3ad0.png"> 44 <img width="696" alt="Screenshot of XCode where Camera is checked" src="https://user-images.githubusercontent.com/24459435/193464115-d76f81d0-6355-4cb2-8bee-538e413a3ad0.png">
@@ -48,12 +50,6 @@ Add this to `web/index.html`: @@ -48,12 +50,6 @@ Add this to `web/index.html`:
48 <script type="text/javascript" src="https://unpkg.com/@zxing/library@0.19.1"></script> 50 <script type="text/javascript" src="https://unpkg.com/@zxing/library@0.19.1"></script>
49 ``` 51 ```
50 52
51 -## Features Supported  
52 -  
53 -| Features | Android | iOS | macOS | Web |  
54 -|------------------------|--------------------|--------------------|-------|-----|  
55 -| analyzeImage (Gallery) | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |  
56 -  
57 ## Usage 53 ## Usage
58 54
59 Import `package:mobile_scanner/mobile_scanner.dart`, and use the widget with or without the controller. 55 Import `package:mobile_scanner/mobile_scanner.dart`, and use the widget with or without the controller.