diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e042e6..e8a3235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -# 51.3.1 +# 51.4.0 Please find the complete and updated release notes at https://documentation.anyline.com/flutter-plugin-component/latest/release-notes.html. diff --git a/README.md b/README.md index 9e1e144..03ce9fa 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ## Documentation Resources - [Getting Started](https://documentation.anyline.com/flutter-plugin-component/latest/index.html) -- [Changelog](https://documentation.anyline.com/flutter-plugin-component/latest/changelog.html) +- [Release Notes](https://documentation.anyline.com/flutter-plugin-component/latest/release-notes.html) ## Get Help (Support) diff --git a/android/build.gradle b/android/build.gradle index 931f92e..453de94 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,7 +4,7 @@ version '1.0' buildscript { ext { - anyline_sdk_version = "51.3.1" + anyline_sdk_version = "51.4.0" kotlin_version = "1.8.0" } repositories { @@ -44,6 +44,7 @@ android { sourceCompatibility = 1.8 targetCompatibility = 1.8 } + dependencies { api "io.anyline:anylinesdk:$anyline_sdk_version" implementation 'com.google.android.material:material:1.4.0-rc01' diff --git a/android/src/main/java/io/anyline/flutter/AnylinePlugin.java b/android/src/main/java/io/anyline/flutter/AnylinePlugin.java index 8b756ad..34b554a 100644 --- a/android/src/main/java/io/anyline/flutter/AnylinePlugin.java +++ b/android/src/main/java/io/anyline/flutter/AnylinePlugin.java @@ -13,6 +13,8 @@ import io.anyline2.AnylineSdk; import io.anyline2.CacheConfig; +import io.anyline2.WrapperConfig; +import io.anyline2.WrapperInfo; import io.anyline2.core.LicenseException; import io.flutter.embedding.engine.plugins.FlutterPlugin; import io.flutter.embedding.engine.plugins.activity.ActivityAware; @@ -38,6 +40,7 @@ public class AnylinePlugin implements private MethodChannel channel; private String licenseKey; + private String pluginVersion = ""; private boolean enableOfflineCache = false; private String customModelsPath = "flutter_assets"; private String viewConfigsPath = "flutter_assets"; @@ -77,9 +80,10 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { viewConfigsPath = call.argument(Constants.EXTRA_VIEW_CONFIGS_PATH); } else if (call.method.equals(Constants.METHOD_SET_LICENSE_KEY)) { licenseKey = call.argument(Constants.EXTRA_LICENSE_KEY); + pluginVersion = call.argument(Constants.EXTRA_PLUGIN_VERSION); enableOfflineCache = Boolean.TRUE.equals(call.argument(Constants.EXTRA_ENABLE_OFFLINE_CACHE)); try { - initSdk(licenseKey, customModelsPath, enableOfflineCache); + initSdk(licenseKey, customModelsPath, pluginVersion, enableOfflineCache); result.success(true); } catch (LicenseException le) { @@ -95,13 +99,20 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { } } - private void initSdk(String sdkLicenseKey, String sdkAssetsFolder, boolean enableOfflineCache) + private void initSdk(String sdkLicenseKey, + String sdkAssetsFolder, + String pluginVersion, + boolean enableOfflineCache) throws LicenseException { + WrapperConfig wrapperConfig = new WrapperConfig.Wrapper( + new WrapperInfo(WrapperInfo.WrapperType.Flutter, pluginVersion)); + CacheConfig.Preset cacheConfig = CacheConfig.Preset.Default.INSTANCE; if (enableOfflineCache) { cacheConfig = CacheConfig.Preset.OfflineLicenseEventCachingEnabled.INSTANCE; } - AnylineSdk.init(sdkLicenseKey, activity, sdkAssetsFolder, cacheConfig); + + AnylineSdk.init(sdkLicenseKey, activity, sdkAssetsFolder, cacheConfig, wrapperConfig); } private void scanAnyline4() { diff --git a/android/src/main/java/io/anyline/flutter/Constants.java b/android/src/main/java/io/anyline/flutter/Constants.java index e945f2f..8d438ed 100644 --- a/android/src/main/java/io/anyline/flutter/Constants.java +++ b/android/src/main/java/io/anyline/flutter/Constants.java @@ -12,6 +12,7 @@ public class Constants { public static final String EXTRA_CONFIG_JSON = "EXTRA_CONFIG_JSON"; public static final String EXTRA_LICENSE_KEY = "EXTRA_LICENSE_KEY"; public static final String EXTRA_ENABLE_OFFLINE_CACHE = "EXTRA_ENABLE_OFFLINE_CACHE"; + public static final String EXTRA_PLUGIN_VERSION = "EXTRA_PLUGIN_VERSION"; public static final String EXTRA_CUSTOM_MODELS_PATH = "EXTRA_CUSTOM_MODELS_PATH"; public static final String EXTRA_VIEW_CONFIGS_PATH = "EXTRA_VIEW_CONFIGS_PATH"; diff --git a/example/.gitignore b/example/.gitignore index f3c2053..f03935f 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -42,3 +42,9 @@ app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + +# note: do not ignore pubspec.lock for the example app (on the same note, the Podfile.lock). + +ios/Runner.xcodeproj/xcshareddata/ + +.vscode \ No newline at end of file diff --git a/example/README.md b/example/README.md index 1d4ce71..22ca44e 100644 --- a/example/README.md +++ b/example/README.md @@ -6,4 +6,4 @@ If you want to just get the plugin working as quickly as possible, see the examp ## Getting Started -This project includes an Anyline Flutter Demo App with configurations for 22+ use cases. You can use the app code located in the [`main.dart`](https://github.com/Anyline/anyline-ocr-flutter-module/blob/main/example/lib/main.dart) file as orientation for your own implementation, but we strongly advise against using the same result processing approach as we did in our demo app. The reason why we only used `Map` and not custom model classes for storing results and therefore went without Dart typesafety is because for our purpose of only displaying results this was not really necessary. Creating classes for every single use would have been an overkill for this project, but we strongly encourage you to read our [Anyline Flutter Guide on documentation.anyline.com](https://documentation.anyline.com/toc/platforms/flutter/getting_started.html#anyline-flutter-guide), where we go into detail about result processing and the form of all different possible results. \ No newline at end of file +This project includes an Anyline Flutter Demo App with configurations for 22+ use cases. You can use the app code located in the [`main.dart`](https://github.com/Anyline/anyline-ocr-flutter-module/blob/main/example/lib/main.dart) file as orientation for your own implementation, but we strongly advise against using the same result processing approach as we did in our demo app. The reason why we only used `Map` and not custom model classes for storing results and therefore went without Dart typesafety is because for our purpose of only displaying results this was not really necessary. Creating classes for every single use would have been an overkill for this project, but we strongly encourage you to read our [Anyline Flutter Guide on documentation.anyline.com](https://documentation.anyline.com/flutter-plugin-component/latest/getting-started.html), where we go into detail about result processing and the form of all different possible results. \ No newline at end of file diff --git a/example/config/TINDOTWithUIFeedbackConfig.json b/example/config/TINDOTWithUIFeedbackConfig.json new file mode 100644 index 0000000..3a84ff2 --- /dev/null +++ b/example/config/TINDOTWithUIFeedbackConfig.json @@ -0,0 +1,137 @@ +{ + "options": { + "doneButtonConfig": { + "offset.y": -96 + }, + "rotateButton": { + "alignment": "top_right", + "offset": { + "x": 0, + "y": 0 + } + }, + "defaultOrientation": "landscape" + }, + "cameraConfig": { + "captureResolution": "1080p", + "zoomGesture": true + }, + "flashConfig": { + "mode": "manual", + "alignment": "top_left" + }, + "viewPluginConfig": { + "pluginConfig": { + "id": "tire_tin", + "cancelOnResult": true, + "tinConfig": { + "scanMode": "DOT" + } + }, + "cutoutConfig": { + "maxWidthPercent": "60%", + "maxHeightPercent": "60%", + "alignment": "center", + "strokeWidth": 2, + "cornerRadius": 4, + "strokeColor": "0099FF", + "outerColor": "000000", + "outerAlpha": 0.3, + "ratioFromSize": { + "width": 5, + "height": 1 + }, + "feedbackStrokeColor": "0099FF" + }, + "scanFeedbackConfig": { + "animation": "traverse_multi", + "animationDuration": 250, + "style": "rect", + "strokeColor": "0099FF", + "beepOnResult": true, + "vibrateOnResult": false, + "strokeWidth": 2 + }, + "uiFeedbackConfig": { + "presets": [ + { + "presetName": "tin_custom_v1", + "presetAttributes": [ + { + "attributeName": "lighting_toodark_image", + "attributeValue": "uifeedback_tin_toodark" + }, + { + "attributeName": "lighting_toobright_image", + "attributeValue": "uifeedback_tin_toobright" + }, + { + "attributeName": "distance_moveback_image", + "attributeValue": "uifeedback_tin_moveback" + }, + { + "attributeName": "distance_movecloser_image", + "attributeValue": "uifeedback_tin_movecloser" + }, + { + "attributeName": "format_wrong_image", + "attributeValue": "uifeedback_tin_wrongformat" + }, + { + "attributeName": "date_wrong_image", + "attributeValue": "uifeedback_tin_wrongformat" + }, + { + "attributeName": "lighting_toodark_text", + "attributeValue": "" + }, + { + "attributeName": "lighting_toobright_text", + "attributeValue": "" + }, + { + "attributeName": "distance_moveback_text", + "attributeValue": "" + }, + { + "attributeName": "distance_movecloser_text", + "attributeValue": "" + }, + { + "attributeName": "format_wrong_text", + "attributeValue": "" + }, + { + "attributeName": "date_wrong_text", + "attributeValue": "" + }, + { + "attributeName": "lighting_toodark_sound", + "attributeValue": "info_sound_TIN.wav" + }, + { + "attributeName": "lighting_toobright_sound", + "attributeValue": "info_sound_TIN.wav" + }, + { + "attributeName": "distance_moveback_sound", + "attributeValue": "info_sound_TIN.wav" + }, + { + "attributeName": "distance_movecloser_sound", + "attributeValue": "info_sound_TIN.wav" + }, + { + "attributeName": "format_wrong_sound", + "attributeValue": "info_sound_TIN.wav" + }, + { + "attributeName": "date_wrong_sound", + "attributeValue": "info_sound_TIN.wav" + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/example/config/license.json b/example/config/license.json index 8270fdf..729876c 100644 --- a/example/config/license.json +++ b/example/config/license.json @@ -1,3 +1,3 @@ { "licenseKey": "" -} \ No newline at end of file +} diff --git a/example/ios/Podfile b/example/ios/Podfile index ca9472a..cbef048 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,3 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' + # Uncomment this line to define a global platform for your project platform :ios, '12.0' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 35be927..7d7e08d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,13 +1,13 @@ PODS: - - Anyline (51.3.1) - - anyline_plugin (51.3.1): + - Anyline (51.4.0) + - anyline_plugin (51.4.0): - Anyline (~> 51) - Flutter - Flutter (1.0.0) - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - permission_handler_apple (9.1.1): + - permission_handler_apple (9.3.0): - Flutter - shared_preferences_foundation (0.0.1): - Flutter @@ -21,7 +21,7 @@ DEPENDENCIES: - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) SPEC REPOS: - trunk: + https://github.com/CocoaPods/Specs.git: - Anyline EXTERNAL SOURCES: @@ -37,13 +37,13 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" SPEC CHECKSUMS: - Anyline: c3240b4176f947254b6e2c8ea4e168a75c9c9e7f - anyline_plugin: 70c78cf6dcef1e575f7acd6bd7f1f5f99dbdf3f5 + Anyline: 007428dc62f87f4ef25c93eb4f00b6a49eeea5fd + anyline_plugin: e9b5f89816bacb68aa791ad3e02cebca45136708 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 - permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 - shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c + permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78 + shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 -PODFILE CHECKSUM: 8f522979e3f0c708f1d45db223b2aecbf369433f +PODFILE CHECKSUM: 1ba8e470e8138e872af9577a0e261e59d83eaf57 COCOAPODS: 1.15.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 2bb7ec4..93e3a12 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -407,7 +407,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 51.3.1; + MARKETING_VERSION = 51.4.0; PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -545,7 +545,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 51.3.1; + MARKETING_VERSION = 51.4.0; PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -578,7 +578,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 51.3.1; + MARKETING_VERSION = 51.4.0; PRODUCT_BUNDLE_IDENTIFIER = io.anyline.flutter.examples; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/example/lib/anyline_service.dart b/example/lib/anyline_service.dart index 73f8ff8..115c1c3 100644 --- a/example/lib/anyline_service.dart +++ b/example/lib/anyline_service.dart @@ -15,6 +15,7 @@ abstract class AnylineService { List getResultList(); String? getSdkVersion(); + String? getPluginVersion(); } class AnylineServiceImpl implements AnylineService { @@ -26,6 +27,7 @@ class AnylineServiceImpl implements AnylineService { LicenseState licenseState = new LicenseState(false, 'Sdk not initialised'); List _results = []; String? _sdkVersion = 'Unknown'; + String? _pluginVersion = 'Unknown'; AnylineServiceImpl() { _initAnylinePlugin(); @@ -60,6 +62,10 @@ class AnylineServiceImpl implements AnylineService { return _sdkVersion; } + String? getPluginVersion() { + return _pluginVersion; + } + _initAnylinePlugin() async { String? sdkVersion; try { @@ -68,6 +74,7 @@ class AnylineServiceImpl implements AnylineService { sdkVersion = 'Failed to get SDK version.'; } _sdkVersion = sdkVersion; + _pluginVersion = await AnylinePlugin.pluginVersion; anylinePlugin = AnylinePlugin(); anylinePlugin.setCustomModelsPath("flutter_assets/custom_scripts"); diff --git a/example/lib/home.dart b/example/lib/home.dart index f704d2a..e653a78 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -198,7 +198,10 @@ class _HomeState extends State { content: FittedBox( fit: BoxFit.fitWidth, child: Text( - 'SDK Version ${_anylineService.getSdkVersion()}')), + 'SDK Version ${_anylineService.getSdkVersion()}' + + '\n' + + 'Plugin Version ${_anylineService.getPluginVersion()}' + )), )); }, ), @@ -399,6 +402,12 @@ class _HomeState extends State { scan(ScanMode.TIN); }, ), + ScanButton( + text: 'TIN DOT with UI Feedback', + onPressed: () { + scan(ScanMode.TINDOTWithUIFeedback); + }, + ), ScanButton( text: 'Tire Size', onPressed: () { diff --git a/example/lib/scan_modes.dart b/example/lib/scan_modes.dart index 74ee630..e0891e1 100644 --- a/example/lib/scan_modes.dart +++ b/example/lib/scan_modes.dart @@ -15,6 +15,7 @@ enum ScanMode { SerialNumber, SerialScanning, TIN, + TINDOTWithUIFeedback, TireSize, UniversalId, USNR, @@ -49,6 +50,8 @@ extension ScanModeInfo on ScanMode { return 'Odometer'; case ScanMode.TIN: return 'TIN'; + case ScanMode.TINDOTWithUIFeedback: + return 'TIN DOT With UI Feedback'; case ScanMode.TireSize: return 'Tire Size'; case ScanMode.CommercialTireId: diff --git a/example/pubspec.lock b/example/pubspec.lock index 8080cd5..6c63967 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "51.3.1" + version: "51.4.0" async: dependency: transitive description: @@ -32,6 +32,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" clock: dependency: transitive description: @@ -115,10 +123,10 @@ packages: dependency: transitive description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" http_parser: dependency: transitive description: @@ -135,6 +143,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.17.0" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" matcher: dependency: transitive description: @@ -171,26 +187,26 @@ packages: dependency: transitive description: name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" path_provider_linux: dependency: transitive description: @@ -203,10 +219,10 @@ packages: dependency: transitive description: name: path_provider_platform_interface - sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: @@ -219,42 +235,50 @@ packages: dependency: transitive description: name: permission_handler - sha256: bc56bfe9d3f44c3c612d8d393bd9b174eb796d706759f9b495ac254e4294baa5 + sha256: "74e962b7fad7ff75959161bb2c0ad8fe7f2568ee82621c9c2660b751146bfe44" url: "https://pub.dev" source: hosted - version: "10.4.5" + version: "11.3.0" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: "59c6322171c29df93a22d150ad95f3aa19ed86542eaec409ab2691b8f35f9a47" + sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474" url: "https://pub.dev" source: hosted - version: "10.3.6" + version: "12.0.5" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" + sha256: bdafc6db74253abb63907f4e357302e6bb786ab41465e8635f362ee71fd8707b + url: "https://pub.dev" + source: hosted + version: "9.4.0" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d" url: "https://pub.dev" source: hosted - version: "9.1.4" + version: "0.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4" + sha256: "23dfba8447c076ab5be3dee9ceb66aad345c4a648f0cac292c77b1eb0e800b78" url: "https://pub.dev" source: hosted - version: "3.12.0" + version: "4.2.0" permission_handler_windows: dependency: transitive description: name: permission_handler_windows - sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.1" photo_view: dependency: "direct main" description: @@ -267,18 +291,34 @@ packages: dependency: transitive description: name: platform - sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "1.2.3" shared_preferences: dependency: "direct main" description: @@ -299,10 +339,10 @@ packages: dependency: transitive description: name: shared_preferences_foundation - sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" + sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" url: "https://pub.dev" source: hosted - version: "2.3.4" + version: "2.3.5" shared_preferences_linux: dependency: transitive description: @@ -315,18 +355,18 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: @@ -416,18 +456,26 @@ packages: dependency: transitive description: name: win32 - sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "5.2.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "3.1.2" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=3.7.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 31d5b99..bc2ffdc 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: anyline_plugin_example description: Demonstrates how to use the anyline_plugin plugin. -version: 51.3.1 +version: 51.4.0 # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. diff --git a/ios/Classes/AnylinePlugin.m b/ios/Classes/AnylinePlugin.m index ed86bc6..2987bba 100644 --- a/ios/Classes/AnylinePlugin.m +++ b/ios/Classes/AnylinePlugin.m @@ -30,7 +30,14 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result cacheConfig = [ALCacheConfig offlineLicenseCachingEnabled]; } - BOOL success = [AnylineSDK setupWithLicenseKey:licenseKey cacheConfig:cacheConfig error:&error]; + // wrapper information + ALWrapperConfig *wrapperConfig = [ALWrapperConfig none]; + NSString *pluginVersion = call.arguments[@"EXTRA_PLUGIN_VERSION"]; + if (pluginVersion) { + wrapperConfig = [ALWrapperConfig flutter:pluginVersion]; + } + + BOOL success = [AnylineSDK setupWithLicenseKey:licenseKey cacheConfig:cacheConfig wrapperConfig:wrapperConfig error:&error]; if (!success) { result([FlutterError errorWithCode:@"AnylineLicenseException" message:error.localizedDescription diff --git a/ios/anyline_plugin.podspec b/ios/anyline_plugin.podspec index fed05be..e4be082 100644 --- a/ios/anyline_plugin.podspec +++ b/ios/anyline_plugin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'anyline_plugin' - s.version = '51.3.1' + s.version = '51.4.0' s.summary = 'Anyline SDK' s.description = <<-DESC Anyline OCR Module diff --git a/lib/anyline_plugin.dart b/lib/anyline_plugin.dart index 847a34a..c4afbe4 100644 --- a/lib/anyline_plugin.dart +++ b/lib/anyline_plugin.dart @@ -5,6 +5,7 @@ import 'package:anyline_plugin/constants.dart'; import 'package:anyline_plugin/exceptions.dart'; import 'package:flutter/services.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:pubspec_parse/pubspec_parse.dart'; /// Entrypoint for perfoming any scans using the Anyline OCR library. class AnylinePlugin { @@ -19,6 +20,13 @@ class AnylinePlugin { return version; } + /// Returns the Anyline Plugin version. + static Future get pluginVersion async { + final fileContent = await rootBundle.loadString('packages/anyline_plugin/pubspec.yaml'); + final pubspec = Pubspec.parse(fileContent); + return pubspec.version?.canonicalizedVersion ??""; + } + void setCustomModelsPath(String customModelsPath) { final Map params = { Constants.EXTRA_CUSTOM_MODELS_PATH: customModelsPath @@ -35,11 +43,15 @@ class AnylinePlugin { Future initSdk(String licenseKey, {bool enableOfflineCache = false}) async { + final String pluginVersion = await AnylinePlugin.pluginVersion; + final Map params = { Constants.EXTRA_LICENSE_KEY: licenseKey, - Constants.EXTRA_ENABLE_OFFLINE_CACHE: enableOfflineCache + Constants.EXTRA_ENABLE_OFFLINE_CACHE: enableOfflineCache, + Constants.EXTRA_PLUGIN_VERSION: pluginVersion }; try { + final bool? result = await _channel.invokeMethod(Constants.METHOD_SET_LICENSE_KEY, params); return result; diff --git a/lib/constants.dart b/lib/constants.dart index 4ecdead..99af3dc 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -1,17 +1,21 @@ /// Needed for communication with the native SDK. abstract class Constants { static const String METHOD_GET_SDK_VERSION = "METHOD_GET_SDK_VERSION"; - static const String METHOD_SET_CUSTOM_MODELS_PATH = "METHOD_SET_CUSTOM_MODELS_PATH"; - static const String METHOD_SET_VIEW_CONFIGS_PATH = "METHOD_SET_VIEW_CONFIGS_PATH"; + static const String METHOD_SET_CUSTOM_MODELS_PATH = + "METHOD_SET_CUSTOM_MODELS_PATH"; + static const String METHOD_SET_VIEW_CONFIGS_PATH = + "METHOD_SET_VIEW_CONFIGS_PATH"; static const String METHOD_SET_LICENSE_KEY = "METHOD_SET_LICENSE_KEY"; static const String METHOD_START_ANYLINE = "METHOD_START_ANYLINE"; static const String METHOD_GET_APPLICATION_CACHE_PATH = "METHOD_GET_APPLICATION_CACHE_PATH"; - static const String METHOD_EXPORT_CACHED_EVENTS = "METHOD_EXPORT_CACHED_EVENTS"; + static const String METHOD_EXPORT_CACHED_EVENTS = + "METHOD_EXPORT_CACHED_EVENTS"; static const String EXTRA_CONFIG_JSON = "EXTRA_CONFIG_JSON"; static const String EXTRA_LICENSE_KEY = "EXTRA_LICENSE_KEY"; static const String EXTRA_ENABLE_OFFLINE_CACHE = "EXTRA_ENABLE_OFFLINE_CACHE"; + static const String EXTRA_PLUGIN_VERSION = "EXTRA_PLUGIN_VERSION"; static const String EXTRA_CUSTOM_MODELS_PATH = "EXTRA_CUSTOM_MODELS_PATH"; static const String EXTRA_VIEW_CONFIGS_PATH = "EXTRA_VIEW_CONFIGS_PATH"; diff --git a/pubspec.yaml b/pubspec.yaml index 9522883..0aed020 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: anyline_plugin description: Flutter Plugin for Anyline OCR, which allows you to scan all kinds of numbers, characters, text and codes. -version: 51.3.1 +version: 51.4.0 homepage: https://anyline.com repository: https://github.com/Anyline/anyline-ocr-flutter-module documentation: https://documentation.anyline.com @@ -12,13 +12,13 @@ environment: dependencies: flutter: sdk: flutter - permission_handler: ^10.2.0 + permission_handler: ^11.0.1 + pubspec_parse: ^1.2.0 dev_dependencies: flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -37,9 +37,8 @@ flutter: pluginClass: AnylinePlugin # To add assets to your plugin package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + assets: + - pubspec.yaml # # For details regarding assets in packages, see # https://flutter.dev/assets-and-images/#from-packages