Skip to content

Commit 1f992ec

Browse files
committed
version updated
1 parent da3f0ac commit 1f992ec

File tree

8 files changed

+40
-45
lines changed

8 files changed

+40
-45
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/.pub-cache/git/mobile_scanner-99232c9687acea1e9b8436aa0df022f93ce25300/
2+
mobile_scanner=/Users/arvindsangwan/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/

.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/.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"}
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/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dartlang.org/mobile_scanner-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]}],"date_created":"2022-11-15 19:46:34.516555","version":"3.3.8"}

example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion flutter.compileSdkVersion
29+
compileSdkVersion 33
3030
ndkVersion flutter.ndkVersion
3131

3232
compileOptions {
@@ -47,8 +47,8 @@ android {
4747
applicationId "com.mohesu.barcodescanner"
4848
// You can update the following values to match your application needs.
4949
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50-
minSdkVersion flutter.minSdkVersion
51-
targetSdkVersion flutter.targetSdkVersion
50+
minSdkVersion 21
51+
targetSdkVersion 31
5252
versionCode flutterVersionCode.toInteger()
5353
versionName flutterVersionName
5454
}

example/lib/main.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ class _MyHomePageState extends State<MyHomePage> {
4242
await Navigator.of(context).push(
4343
MaterialPageRoute(
4444
builder: (context) => AiBarcodeScanner(
45-
validateText: 'https://', // link to be validated
46-
validateType: ValidateType.startsWith,
45+
// validateText: 'https://', // link to be validated
46+
// validateType: ValidateType.startsWith,
4747
onScan: (String value) {
48-
debugPrint(value);
49-
setState(() {
50-
barcode = value;
51-
});
48+
// debugPrint(value);
49+
// setState(() {
50+
// barcode = value;
51+
// });
52+
},
53+
canPop: false,
54+
onDetect: ( barcode, args) {
55+
debugPrint(barcode.barcodes.first.rawValue!);
5256
},
5357
),
5458
),

example/pubspec.lock

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.0.2"
10+
version: "0.0.2+1"
1111
async:
1212
dependency: transitive
1313
description:
@@ -117,12 +117,10 @@ packages:
117117
mobile_scanner:
118118
dependency: transitive
119119
description:
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"
120+
name: mobile_scanner
121+
url: "https://pub.dartlang.org"
122+
source: hosted
123+
version: "2.0.0"
126124
path:
127125
dependency: transitive
128126
description:

lib/src/ai_barcode_scanner.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
176176
MobileScanner(
177177
controller: controller,
178178
fit: widget.fit,
179-
autoResume: widget.autoResume,
180-
onPermissionSet: widget.onPermissionSet,
179+
allowDuplicates: widget.allowDuplicates,
180+
key: widget.key,
181181
onDetect: (barcode, args) {
182182
widget.onDetect?.call(barcode, args);
183183
if (barcode.barcodes.isEmpty) {

lib/src/overlay.dart

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore_for_file: no_leading_underscores_for_local_identifiers, duplicate_ignore
2-
31
import 'dart:math';
42

53
import 'package:flutter/material.dart';
@@ -64,14 +62,14 @@ class OverlayShape extends ShapeBorder {
6462

6563
@override
6664
Path getOuterPath(Rect rect, {TextDirection? textDirection}) {
67-
Path _getLeftTopPath(Rect rect) {
65+
Path getLeftTopPath(Rect rect) {
6866
return Path()
6967
..moveTo(rect.left, rect.bottom)
7068
..lineTo(rect.left, rect.top)
7169
..lineTo(rect.right, rect.top);
7270
}
7371

74-
return _getLeftTopPath(rect)
72+
return getLeftTopPath(rect)
7573
..lineTo(
7674
rect.right,
7775
rect.bottom,
@@ -87,20 +85,17 @@ class OverlayShape extends ShapeBorder {
8785
}
8886

8987
@override
90-
// ignore: duplicate_ignore
9188
void paint(Canvas canvas, Rect rect, {TextDirection? textDirection}) {
9289
final width = rect.width;
9390
final borderWidthSize = width / 2;
9491
final height = rect.height;
9592
final borderOffset = borderWidth / 2;
96-
// ignore: no_leading_underscores_for_local_identifiers
97-
final _borderLength =
93+
final bLength =
9894
borderLength > min(cutOutHeight, cutOutHeight) / 2 + borderWidth * 2
9995
? borderWidthSize / 2
10096
: borderLength;
101-
final _cutOutWidth =
102-
cutOutWidth < width ? cutOutWidth : width - borderOffset;
103-
final _cutOutHeight =
97+
final cutWidth = cutOutWidth < width ? cutOutWidth : width - borderOffset;
98+
final cutHeight =
10499
cutOutHeight < height ? cutOutHeight : height - borderOffset;
105100

106101
final backgroundPaint = Paint()
@@ -118,14 +113,14 @@ class OverlayShape extends ShapeBorder {
118113
..blendMode = BlendMode.dstOut;
119114

120115
final cutOutRect = Rect.fromLTWH(
121-
rect.left + width / 2 - _cutOutWidth / 2 + borderOffset,
116+
rect.left + width / 2 - cutWidth / 2 + borderOffset,
122117
-cutOutBottomOffset +
123118
rect.top +
124119
height / 2 -
125-
_cutOutHeight / 2 +
120+
cutHeight / 2 +
126121
borderOffset,
127-
_cutOutWidth - borderOffset * 2,
128-
_cutOutHeight - borderOffset * 2,
122+
cutWidth - borderOffset * 2,
123+
cutHeight - borderOffset * 2,
129124
);
130125

131126
canvas
@@ -141,10 +136,10 @@ class OverlayShape extends ShapeBorder {
141136
/// Draw top right corner
142137
..drawRRect(
143138
RRect.fromLTRBAndCorners(
144-
cutOutRect.right - _borderLength,
139+
cutOutRect.right - bLength,
145140
cutOutRect.top,
146141
cutOutRect.right,
147-
cutOutRect.top + _borderLength,
142+
cutOutRect.top + bLength,
148143
topRight: Radius.circular(borderRadius),
149144
),
150145
borderPaint,
@@ -155,8 +150,8 @@ class OverlayShape extends ShapeBorder {
155150
RRect.fromLTRBAndCorners(
156151
cutOutRect.left,
157152
cutOutRect.top,
158-
cutOutRect.left + _borderLength,
159-
cutOutRect.top + _borderLength,
153+
cutOutRect.left + bLength,
154+
cutOutRect.top + bLength,
160155
topLeft: Radius.circular(borderRadius),
161156
),
162157
borderPaint,
@@ -165,8 +160,8 @@ class OverlayShape extends ShapeBorder {
165160
/// Draw bottom right corner
166161
..drawRRect(
167162
RRect.fromLTRBAndCorners(
168-
cutOutRect.right - _borderLength,
169-
cutOutRect.bottom - _borderLength,
163+
cutOutRect.right - bLength,
164+
cutOutRect.bottom - bLength,
170165
cutOutRect.right,
171166
cutOutRect.bottom,
172167
bottomRight: Radius.circular(borderRadius),
@@ -178,8 +173,8 @@ class OverlayShape extends ShapeBorder {
178173
..drawRRect(
179174
RRect.fromLTRBAndCorners(
180175
cutOutRect.left,
181-
cutOutRect.bottom - _borderLength,
182-
cutOutRect.left + _borderLength,
176+
cutOutRect.bottom - bLength,
177+
cutOutRect.left + bLength,
183178
cutOutRect.bottom,
184179
bottomLeft: Radius.circular(borderRadius),
185180
),

pubspec.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414

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

1917
dev_dependencies:
2018
flutter_test:

0 commit comments

Comments
 (0)