Skip to content

Commit 99798ae

Browse files
authored
Merge pull request #19 from doo/barcode_v3
add barcode v3 support
2 parents f43c776 + 0d8c552 commit 99798ae

File tree

10 files changed

+265
-110
lines changed

10 files changed

+265
-110
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
.pub-cache/
3030
.pub/
3131
/build/
32+
ios/Flutter/Flutter.podspec
3233

3334
# Android related
3435
**/android/**/gradle-wrapper.jar

Libraries.txt

+240-88
Large diffs are not rendered by default.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example app shows how to integrate the [Scanbot SDK Flutter Plugin](https://pub.dev/packages/scanbot_sdk) on Android and iOS.
44

5-
For more details about the Plugin please see this [documentation](https://scanbotsdk.github.io/documentation/flutter/).
5+
For more details about the Plugin please see this [documentation](https://docs.scanbot.io/document-scanner-sdk/flutter/introduction/).
66

77

88
## What is Scanbot SDK?

ios/Podfile.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ PODS:
88
- Flutter
99
- scanbot_sdk (1.0.0):
1010
- Flutter
11-
- ScanbotSDK/MRZ (= 1.14.0)
12-
- ScanbotSDK/MRZ (1.14.0)
11+
- ScanbotSDK/MRZ (= 1.19.3)
12+
- ScanbotSDK/MRZ (1.19.3)
1313
- shared_preferences (0.0.1):
1414
- Flutter
1515

@@ -44,8 +44,8 @@ SPEC CHECKSUMS:
4444
image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a
4545
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
4646
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
47-
scanbot_sdk: f32434ab65e967725d125ed584a0fceec064086d
48-
ScanbotSDK: fe7f42d3ff2b554d72e0c4c5e4c65958596d8f94
47+
scanbot_sdk: 9a8f8da7004463202e40301449de72990e4a87a7
48+
ScanbotSDK: 1570cd86b33f07b0f0321a6024bb39d414813500
4949
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
5050

5151
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d

ios/Runner.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,19 @@
256256
);
257257
inputPaths = (
258258
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
259-
"${PODS_ROOT}/ScanbotSDK/ScanbotSDK.framework",
260259
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
261260
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
262261
"${BUILT_PRODUCTS_DIR}/scanbot_sdk/scanbot_sdk.framework",
263262
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
263+
"${PODS_XCFRAMEWORKS_BUILD_DIR}/ScanbotSDK/ScanbotSDK.framework/ScanbotSDK",
264264
);
265265
name = "[CP] Embed Pods Frameworks";
266266
outputPaths = (
267-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ScanbotSDK.framework",
268267
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework",
269268
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
270269
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/scanbot_sdk.framework",
271270
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
271+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ScanbotSDK.framework",
272272
);
273273
runOnlyForDeploymentPostprocessing = 0;
274274
shellPath = /bin/sh;

ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.dart

+10-9
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
149149
children: <Widget>[
150150
TitleItemWidget('Document Scanner'),
151151
MenuItemWidget(
152-
'Scan Document',
152+
'Scan Documents',
153153
onTap: () {
154154
_startDocumentScanning();
155155
},
@@ -181,13 +181,13 @@ class _MainPageWidgetState extends State<MainPageWidget> {
181181
},
182182
),
183183
MenuItemWidget(
184-
'Scan Multiple Barcodes ',
184+
'Scan Multiple Barcodes (batch mode)',
185185
onTap: () {
186186
_startBatchBarcodeScanner();
187187
},
188188
),
189189
MenuItemWidget(
190-
'Detect Barcode image',
190+
'Detect Barcodes from Still Image',
191191
onTap: () {
192192
_detectBarcodeOnImage();
193193
},
@@ -205,7 +205,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
205205
},
206206
),
207207
MenuItemWidget(
208-
'Scan License plate',
208+
'Scan License Plate',
209209
onTap: () {
210210
startLicensePlateScanner();
211211
},
@@ -226,12 +226,12 @@ class _MainPageWidgetState extends State<MainPageWidget> {
226226
},
227227
),
228228
MenuItemWidget(
229-
'Licenses info',
229+
'3rd-party Libs & Licenses',
230230
startIcon: Icons.developer_mode,
231231
onTap: () {
232232
showLicensePage(
233233
context: context,
234-
applicationName: 'Scanbot SDK example',
234+
applicationName: 'Scanbot SDK Flutter Example',
235235
);
236236
},
237237
),
@@ -334,6 +334,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
334334
try {
335335
var config = BarcodeScannerConfiguration(
336336
topBarBackgroundColor: Colors.blue,
337+
barcodeFormats: PredefinedBarcodes.allBarcodeTypes(),
337338
finderTextHint:
338339
'Please align any supported barcode in the frame to scan it.',
339340
/* additionalParameters: BarcodeAdditionalParameters(
@@ -342,6 +343,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
342343
maximumTextLength: 11,
343344
minimum1DBarcodesQuietZone: 10,
344345
)*/
346+
//cameraZoomFactor: 0.5,
345347
// ...
346348
);
347349
var result = await ScanbotSdkUi.startBarcodeScanner(config);
@@ -356,7 +358,6 @@ class _MainPageWidgetState extends State<MainPageWidget> {
356358
return;
357359
}
358360
try {
359-
//var config = BarcodeScannerConfiguration(); // testing default configs
360361
var config = BatchBarcodeScannerConfiguration(
361362
barcodeFormatter: (item) async {
362363
final random = Random();
@@ -393,6 +394,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
393394
orientationLockMode: CameraOrientationMode.PORTRAIT,
394395
barcodeFormats: PredefinedBarcodes.allBarcodeTypes(),
395396
cancelButtonHidden: false,
397+
//cameraZoomFactor: 0.5
396398
/*additionalParameters: BarcodeAdditionalParameters(
397399
enableGS1Decoding: false,
398400
minimumTextLength: 10,
@@ -429,8 +431,7 @@ class _MainPageWidgetState extends State<MainPageWidget> {
429431
//ios
430432
var result = await ScanbotSdk.detectBarcodeFromImageFile(
431433
Uri.file(image?.path ?? ''),
432-
PredefinedBarcodes.allBarcodeTypes(),
433-
true);
434+
PredefinedBarcodes.allBarcodeTypes());
434435
if (result.operationResult == OperationResult.SUCCESS) {
435436
await Navigator.of(context).push(
436437
MaterialPageRoute(

lib/ui/barcode_preview.dart

+1
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,6 @@ const barcodeFormatEnumMap = {
127127
BarcodeFormat.RSS_EXPANDED: 'RSS_EXPANDED',
128128
BarcodeFormat.UPC_A: 'UPC_A',
129129
BarcodeFormat.UPC_E: 'UPC_E',
130+
BarcodeFormat.MSI_PLESSEY: 'MSI_PLESSEY',
130131
BarcodeFormat.UNKNOWN: 'UNKNOWN',
131132
};

pubspec.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0"
10+
version: "2.6.1"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -246,7 +246,7 @@ packages:
246246
name: scanbot_sdk
247247
url: "https://pub.dartlang.org"
248248
source: hosted
249-
version: "2.5.0"
249+
version: "2.6.0"
250250
shared_preferences:
251251
dependency: "direct main"
252252
description:
@@ -300,7 +300,7 @@ packages:
300300
name: source_span
301301
url: "https://pub.dartlang.org"
302302
source: hosted
303-
version: "1.8.0"
303+
version: "1.8.1"
304304
stack_trace:
305305
dependency: transitive
306306
description:
@@ -335,7 +335,7 @@ packages:
335335
name: test_api
336336
url: "https://pub.dartlang.org"
337337
source: hosted
338-
version: "0.2.19"
338+
version: "0.3.0"
339339
typed_data:
340340
dependency: transitive
341341
description:

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
flutter:
2323
sdk: flutter
2424

25-
scanbot_sdk: 2.5.0
25+
scanbot_sdk: 2.6.0
2626
cupertino_icons: ^1.0.2
2727

2828
permission_handler: ^6.0.1

0 commit comments

Comments
 (0)