Skip to content

Commit

Permalink
- Dependency updates
Browse files Browse the repository at this point in the history
- validateText and validateType deprecated removed
  • Loading branch information
rvndsngwn committed Jun 27, 2023
1 parent ddb2947 commit c7af6e2
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This is a generated file; do not edit or check into version control.
mobile_scanner=/Users/arvindsangwan/.pub-cache/hosted/pub.dev/mobile_scanner-3.2.0/
mobile_scanner=/Users/arvind/.pub-cache/hosted/pub.dev/mobile_scanner-3.3.0/
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -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/hosted/pub.dev/mobile_scanner-3.2.0/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dev/mobile_scanner-3.2.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dev/mobile_scanner-3.2.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"mobile_scanner","path":"/Users/arvindsangwan/.pub-cache/hosted/pub.dev/mobile_scanner-3.2.0/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]}],"date_created":"2023-04-17 18:08:30.734421","version":"3.7.11"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/arvind/.pub-cache/hosted/pub.dev/mobile_scanner-3.3.0/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/arvind/.pub-cache/hosted/pub.dev/mobile_scanner-3.3.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/arvind/.pub-cache/hosted/pub.dev/mobile_scanner-3.3.0/","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"mobile_scanner","path":"/Users/arvind/.pub-cache/hosted/pub.dev/mobile_scanner-3.3.0/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]}],"date_created":"2023-06-28 02:12:43.579902","version":"3.10.5"}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.7

- Dependency updates
- validateText and validateType deprecated removed

## 0.0.6

- Readme updated
Expand Down
40 changes: 20 additions & 20 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.6"
version: "0.0.7"
async:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -36,10 +36,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
clock:
dependency: transitive
description:
Expand All @@ -52,10 +52,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.1"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -163,10 +163,10 @@ packages:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.5"
version: "0.6.7"
lints:
dependency: transitive
description:
Expand All @@ -179,10 +179,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
Expand All @@ -195,26 +195,26 @@ packages:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
mobile_scanner:
dependency: transitive
description:
name: mobile_scanner
sha256: da55204e5439bc8dc058df56231a7a1d513c6ec9cbad84492f56d493382d296f
sha256: "54dd914e1bb5758b3db7aa02e56d65d80285ba0705e0e5fa5cfbb11e27344c4b"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.3.0"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.2"
version: "1.8.3"
plugin_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -272,10 +272,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev"
source: hosted
version: "0.4.16"
version: "0.5.1"
typed_data:
dependency: transitive
description:
Expand All @@ -293,5 +293,5 @@ packages:
source: hosted
version: "2.1.4"
sdks:
dart: ">=2.18.0 <3.0.0"
dart: ">=3.0.0-0 <4.0.0"
flutter: ">=3.0.0"
1 change: 0 additions & 1 deletion lib/ai_barcode_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ library ai_barcode_scanner;

export 'src/ai_barcode_scanner.dart';
export 'package:mobile_scanner/mobile_scanner.dart';
export 'src/enums/validate_type.dart';
export 'src/overlay.dart';
32 changes: 4 additions & 28 deletions lib/src/ai_barcode_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mobile_scanner/mobile_scanner.dart';

import 'enums/validate_type.dart';
import 'overlay.dart';

/// Barcode scanner widget
Expand All @@ -19,18 +18,6 @@ class AiBarcodeScanner extends StatefulWidget {
/// [args] Information about the state of the MobileScanner widget
final void Function(BarcodeCapture)? onDetect;

/// Validate barcode text with [ValidateType]
/// [validateText] and [validateType] must be set together.
/// [validateText] now deprecated, use [validator] instead.
@Deprecated('Use [validator] instead. This will be removed in next version.')
final String? validateText;

/// Validate type [ValidateType]
/// Validator working with single string value only.
/// [validateText] and [validateType] now deprecated, use [validator] instead.
@Deprecated('Use [validator] instead. This will be removed in next version.')
final ValidateType? validateType;

/// Validate barcode text with a function
final bool Function(String value)? validator;

Expand Down Expand Up @@ -184,13 +171,7 @@ class AiBarcodeScanner extends StatefulWidget {
this.scanWindow,
this.startDelay,
this.hintWidget,
@Deprecated('Use [validator] instead. This will be removed in next version.')
this.validateText,
@Deprecated('Use [validator] instead. This will be removed in next version.')
this.validateType,
}) : assert(validateText == null || validateType != null),
assert(validateText != null || validateType == null),
super(key: key);
}) : super(key: key);

@override
State<AiBarcodeScanner> createState() => _AiBarcodeScannerState();
Expand Down Expand Up @@ -234,14 +215,14 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {
fit: widget.fit,
errorBuilder: widget.errorBuilder ??
(context, error, child) {
return ColoredBox(
return const ColoredBox(
color: Colors.black,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: const [
children: [
Icon(
Icons.no_photography,
color: Colors.white,
Expand Down Expand Up @@ -272,12 +253,7 @@ class _AiBarcodeScannerState extends State<AiBarcodeScanner> {

final String code = barcode.barcodes.first.rawValue ?? "";

if ((widget.validator != null && !widget.validator!(code)) ||
(widget.validateText?.isNotEmpty == true &&
!widget.validateType!.toValidateTypeBool(
code,
widget.validateText!,
))) {
if ((widget.validator != null && !widget.validator!(code))) {
setState(() {
HapticFeedback.heavyImpact();
log('Invalid Barcode => $code');
Expand Down
30 changes: 0 additions & 30 deletions lib/src/enums/validate_type.dart

This file was deleted.

6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: ai_barcode_scanner
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.
version: 0.0.6
version: 0.0.7
homepage: https://mohesu.com
repository: https://github.com/mohesu/barcode_scanner.git

environment:
sdk: ">=2.17.6 <3.0.0"
sdk: ">=2.17.6 <4.0.0"
flutter: ">=1.17.0"

dependencies:
flutter:
sdk: flutter

mobile_scanner: ^3.2.0
mobile_scanner: ^3.3.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit c7af6e2

Please sign in to comment.