Skip to content

Commit d0487b3

Browse files
committed
version updated
1 parent 59c40ca commit d0487b3

File tree

6 files changed

+47
-40
lines changed

6 files changed

+47
-40
lines changed

.flutter-plugins

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This is a generated file; do not edit or check into version control.
2-
mobile_scanner=/Users/arvindsangwan/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/
2+
mobile_scanner=/Users/arvindsangwan/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/flutter/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]}],"date_created":"2022-07-28 00:12:39.639262","version":"3.0.5"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]}],"date_created":"2022-11-04 22:11:02.331075","version":"3.3.7"}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.2
2+
- Dependency updates
3+
- mobile_scanner: ^3.0.0-beta.1
4+
15
## 0.0.1+1
26

37
* Documentation updated

example/pubspec.lock

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.0.1"
10+
version: "0.0.2"
1111
async:
1212
dependency: transitive
1313
description:
1414
name: async
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.8.2"
17+
version: "2.9.0"
1818
boolean_selector:
1919
dependency: transitive
2020
description:
@@ -28,21 +28,14 @@ packages:
2828
name: characters
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0"
32-
charcode:
33-
dependency: transitive
34-
description:
35-
name: charcode
36-
url: "https://pub.dartlang.org"
37-
source: hosted
38-
version: "1.3.1"
31+
version: "1.2.1"
3932
clock:
4033
dependency: transitive
4134
description:
4235
name: clock
4336
url: "https://pub.dartlang.org"
4437
source: hosted
45-
version: "1.1.0"
38+
version: "1.1.1"
4639
collection:
4740
dependency: transitive
4841
description:
@@ -63,7 +56,7 @@ packages:
6356
name: fake_async
6457
url: "https://pub.dartlang.org"
6558
source: hosted
66-
version: "1.3.0"
59+
version: "1.3.1"
6760
flutter:
6861
dependency: "direct main"
6962
description: flutter
@@ -106,35 +99,37 @@ packages:
10699
name: matcher
107100
url: "https://pub.dartlang.org"
108101
source: hosted
109-
version: "0.12.11"
102+
version: "0.12.12"
110103
material_color_utilities:
111104
dependency: transitive
112105
description:
113106
name: material_color_utilities
114107
url: "https://pub.dartlang.org"
115108
source: hosted
116-
version: "0.1.4"
109+
version: "0.1.5"
117110
meta:
118111
dependency: transitive
119112
description:
120113
name: meta
121114
url: "https://pub.dartlang.org"
122115
source: hosted
123-
version: "1.7.0"
116+
version: "1.8.0"
124117
mobile_scanner:
125118
dependency: transitive
126119
description:
127-
name: mobile_scanner
128-
url: "https://pub.dartlang.org"
129-
source: hosted
130-
version: "2.0.0"
120+
path: "."
121+
ref: HEAD
122+
resolved-ref: "99232c9687acea1e9b8436aa0df022f93ce25300"
123+
url: "[email protected]:juliansteenbakker/mobile_scanner.git"
124+
source: git
125+
version: "3.0.0-beta.1"
131126
path:
132127
dependency: transitive
133128
description:
134129
name: path
135130
url: "https://pub.dartlang.org"
136131
source: hosted
137-
version: "1.8.1"
132+
version: "1.8.2"
138133
sky_engine:
139134
dependency: transitive
140135
description: flutter
@@ -146,7 +141,7 @@ packages:
146141
name: source_span
147142
url: "https://pub.dartlang.org"
148143
source: hosted
149-
version: "1.8.2"
144+
version: "1.9.0"
150145
stack_trace:
151146
dependency: transitive
152147
description:
@@ -167,21 +162,21 @@ packages:
167162
name: string_scanner
168163
url: "https://pub.dartlang.org"
169164
source: hosted
170-
version: "1.1.0"
165+
version: "1.1.1"
171166
term_glyph:
172167
dependency: transitive
173168
description:
174169
name: term_glyph
175170
url: "https://pub.dartlang.org"
176171
source: hosted
177-
version: "1.2.0"
172+
version: "1.2.1"
178173
test_api:
179174
dependency: transitive
180175
description:
181176
name: test_api
182177
url: "https://pub.dartlang.org"
183178
source: hosted
184-
version: "0.4.9"
179+
version: "0.4.12"
185180
vector_math:
186181
dependency: transitive
187182
description:

lib/src/ai_barcode_scanner.dart

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class AiBarcodeScanner extends StatefulWidget {
1414
///
1515
/// [barcode] The barcode object with all information about the scanned code.
1616
/// [args] Information about the state of the MobileScanner widget
17-
final Function(Barcode barcode, MobileScannerArguments? args)? onDetect;
17+
final Function(BarcodeCapture barcode, MobileScannerArguments? args)?
18+
onDetect;
1819

1920
/// Validate barcode text with [ValidateType]
2021
/// [validateText] and [validateType] must be set together.
@@ -102,6 +103,10 @@ class AiBarcodeScanner extends StatefulWidget {
102103
/// Can auto back to previous page when barcode is successfully scanned (default: true)
103104
final bool canPop;
104105

106+
final bool autoResume;
107+
108+
final dynamic Function(bool)? onPermissionSet;
109+
105110
const AiBarcodeScanner({
106111
Key? key,
107112
required this.onScan,
@@ -124,9 +129,7 @@ class AiBarcodeScanner extends StatefulWidget {
124129
this.hintText = 'Scan QR Code',
125130
this.hintMargin = const EdgeInsets.all(16),
126131
this.hintBackgroundColor,
127-
this.hintTextStyle = const TextStyle(
128-
fontWeight: FontWeight.bold,
129-
),
132+
this.hintTextStyle = const TextStyle(fontWeight: FontWeight.bold),
130133
this.hintPadding = const EdgeInsets.all(0),
131134
this.showOverlay = true,
132135
this.showError = true,
@@ -136,6 +139,8 @@ class AiBarcodeScanner extends StatefulWidget {
136139
this.successColor = Colors.green,
137140
this.successText = 'BarCode Found',
138141
this.canPop = true,
142+
this.autoResume = true,
143+
this.onPermissionSet,
139144
}) : assert(validateText == null || validateType != null),
140145
assert(validateText != null || validateType == null),
141146
super(key: key);
@@ -171,20 +176,21 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
171176
MobileScanner(
172177
controller: controller,
173178
fit: widget.fit,
174-
allowDuplicates: widget.allowDuplicates,
179+
autoResume: widget.autoResume,
180+
onPermissionSet: widget.onPermissionSet,
175181
onDetect: (barcode, args) {
176182
widget.onDetect?.call(barcode, args);
177-
if (barcode.rawValue?.isEmpty ?? true) {
183+
if (barcode.barcodes.isEmpty) {
178184
debugPrint('Failed to scan Barcode');
179185
return;
180186
}
181187
if (widget.validateText?.isNotEmpty ?? false) {
182188
if (!widget.validateType!.toValidateTypeBool(
183-
barcode.rawValue!, widget.validateText!)) {
189+
barcode.barcodes.first.rawValue!, widget.validateText!)) {
184190
if (!widget.allowDuplicates) {
185191
HapticFeedback.vibrate();
186192
}
187-
final String code = barcode.rawValue!;
193+
final String code = barcode.barcodes.first.rawValue!;
188194
debugPrint('Invalid Barcode => $code');
189195
_isSuccess = false;
190196
setState(() {});
@@ -195,11 +201,11 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
195201
if (!widget.allowDuplicates) {
196202
HapticFeedback.mediumImpact();
197203
}
198-
final String code = barcode.rawValue!;
204+
final String code = barcode.barcodes.first.rawValue!;
199205
debugPrint('Barcode found => $code');
200206
widget.onScan(code);
201207
setState(() {});
202-
if (widget.canPop) {
208+
if (widget.canPop && mounted) {
203209
Navigator.pop(context);
204210
}
205211
},
@@ -259,7 +265,7 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
259265
),
260266
trailing: IconButton(
261267
tooltip: "Torch",
262-
onPressed: controller.hasTorch
268+
onPressed: controller.torchEnabled
263269
? () => controller.toggleTorch()
264270
: null,
265271
icon: ValueListenableBuilder<TorchState>(

pubspec.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ai_barcode_scanner
22
description: A universal AI barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS.
3-
version: 0.0.1+1
3+
version: 0.0.2+1
44
homepage: https://mohesu.com
55
repository: https://github.com/mohesu/barcode_scanner.git
66

@@ -12,12 +12,14 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414

15-
mobile_scanner: ^2.0.0
15+
mobile_scanner:
16+
git:
17+
url: [email protected]:juliansteenbakker/mobile_scanner.git
1618

1719
dev_dependencies:
1820
flutter_test:
1921
sdk: flutter
20-
flutter_lints: ^2.0.0
22+
flutter_lints: ^2.0.1
2123

2224
# For information on the generic Dart part of this file, see the
2325
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)