From 879240cada6c7aa79dedf79a550b78b2bde45f59 Mon Sep 17 00:00:00 2001 From: Piotr Mitkowski Date: Tue, 14 May 2024 09:32:59 +0200 Subject: [PATCH] Updated project dependencies & improved the docs (#21) * Updated FVM and Github Actions config * Updated package dependencies * Added missing readme about adding Proguard config Fixed the README formatting * Updated changelog * Updated publish jobs * Job fix * Updated Flutter constraint Removed ignored file from git * Github Actions cleanup --- .fvm/fvm_config.json | 4 - .fvmrc | 4 + .github/workflows/publish.yml | 21 ++++- .github/workflows/test.yml | 31 +++++-- .gitignore | 6 +- .vscode/settings.json | 20 +++-- CHANGELOG.md | 5 ++ README.md | 46 ++++++++--- example/ios/Podfile | 2 +- example/pubspec.lock | 147 +++++++++++++++++++++------------- example/pubspec.yaml | 10 +-- ios/ar_quido.podspec | 4 +- pubspec.yaml | 14 ++-- 13 files changed, 208 insertions(+), 106 deletions(-) delete mode 100644 .fvm/fvm_config.json create mode 100644 .fvmrc diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json deleted file mode 100644 index 9acb749..0000000 --- a/.fvm/fvm_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "flutterSdkVersion": "3.13.6", - "flavors": {} -} \ No newline at end of file diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..77dfa45 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,4 @@ +{ + "flutter": "3.19.6", + "flavors": {} +} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2eb9dc1..3648a16 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,25 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+*' + +env: + FLUTTER_VERSION: 3.19.6 + jobs: publish: - uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + name: 'Publish to pub.dev' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install and set Flutter version + uses: subosito/flutter-action@v2.4.0 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: stable + cache: true + - name: Install dependencies + run: flutter pub get + - name: Publish - dry run + run: flutter pub publish --dry-run + - name: Publish to pub.dev + run: flutter pub publish -f diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d0a183..9e7e113 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,24 +2,29 @@ name: Run tests and static checks on: push: - branches: - - main + branches: + - main pull_request: branches: - - main + - main workflow_dispatch: +env: + FLUTTER_VERSION: 3.19.6 + jobs: tests: runs-on: ubuntu-latest steps: - name: Checkout the code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install and set Flutter version uses: subosito/flutter-action@v2.4.0 with: - flutter-version: '3.13.6' + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: stable + cache: true - name: Restore packages run: flutter pub get - name: Generate required files @@ -28,6 +33,16 @@ jobs: run: flutter analyze - name: Run tests run: flutter test --coverage - - - + validate-for-pub: + name: "Perform dry run for pub.dev publish" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install and set Flutter version + uses: subosito/flutter-action@v2.4.0 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: stable + cache: true + - name: Publish - dry run + run: flutter pub publish --dry-run diff --git a/.gitignore b/.gitignore index 2e11da3..224accf 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,6 @@ migrate_working_dir/ build/ #Flutter Version Manager - https://fvm.app/docs/getting_started/overview -.fvm/flutter_sdk # Generated files related *.g.dart @@ -38,4 +37,7 @@ build/ *.mocks.dart # Test coverage -coverage/ \ No newline at end of file +coverage/ + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index e6625c3..1bac1be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,10 @@ { - "dart.flutterSdkPath": ".fvm/flutter_sdk", - // Remove .fvm files from search - "search.exclude": { - "**/.fvm": true - }, - // Remove from file watching - "files.watcherExclude": { - "**/.fvm": true - }, - "java.configuration.updateBuildConfiguration": "automatic" - } \ No newline at end of file + "dart.flutterSdkPath": ".fvm/versions/3.19.6", + "search.exclude": { + "**/.fvm": true + }, + "files.watcherExclude": { + "**/.fvm": true + }, + "java.configuration.updateBuildConfiguration": "automatic" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cab81e..5af06b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.0 + +* Updated the project to match Flutter 3.19.6 +* Added Proguard config section in the Readme + ## 0.2.0 * Updated the project to match Flutter 3.13.6 diff --git a/README.md b/README.md index 123881d..4e45ad4 100644 --- a/README.md +++ b/README.md @@ -12,32 +12,53 @@ The plugin has been built by Flutter Division at [Miquido Software development c ## Getting started 🚢 Add the dependency in your `pubspec.yaml`: -- from command line: + +- from command line: + ```bash flutter pub add ar_quido flutter pub get ``` + - directly in pubspec.yaml: + ```yaml dependencies: ar_quido: 0.2.0 ``` + ### Android + Since the Android version depends on the EasyAR solution, you need to -[sign up](https://www.easyar.com/view/signUp.html) on their page and obtain +[sign up](https://www.easyar.com/view/signUp.html) on their page and obtain a "Sense Authorization" License Key. It can be done through the [EasyAR Dashboard](https://portal.easyar.com/sdk/list). -After doing so, provide the key in Android Manifest file as +After doing so, provide the key in Android Manifest file as `application`'s metadata: + ```xml ``` +#### Proguard + +By default, proguard removes the EasyAR library files from a release build. To fix +this, add the following code to the `android/app/src/proguard-rules.pro` file (create +the file if it doesn't exist): + +```proguard +-keep class cn.easyar.** { *; } +-keepattributes SourceFile,LineNumberTable +-keep public class * extends java.lang.Exception +``` + ### iOS + `ARKit` uses the device camera, so do not forget to provide the `NSCameraUsageDescription` in Info.plist: + ```xml NSCameraUsageDescription Describe why your app needs camera (AR) here. @@ -45,17 +66,20 @@ in Info.plist: Also make sure, that your deployment target in project settings is set to at least 14.0. Set the same version in `ios/Podfile`: + ```ruby -platform :ios, '14.0' +platform :ios, '15.0' ``` ## Usage 🌴 -1. Put your reference images inside `assets/reference_images` directory (make + +1. Put your reference images inside `assets/reference_images` directory (make sure to reference them in `pubspec.yaml`). - please note, that only `.jpg` images are supported at this time 2. Place `ARQuidoView` widget in your view's code. Provide at least an array of -image names you want to detect (through `referenceImageNames` property) and a +image names you want to detect (through `referenceImageNames` property) and a callback for detected images (through `onImageDetected` property): + ```dart ARQuidoView( referenceImageNames: const ['applandroid'], @@ -64,24 +88,26 @@ callback for detected images (through `onImageDetected` property): }, ), ``` + 3. That's it, you're all set ⚓ Please see the [example](https://github.com/miquido/AR_quido/tree/main/example) for more info. You can also check the details in [API Documentation](https://pub.dev/documentation/ar_quido/latest/). ## Disclaimer -"EasyAR" is the registered trademark or trademark of VisionStar Information + +"EasyAR" is the registered trademark or trademark of VisionStar Information Technology (Shanghai) Co., Ltd in China and other countries for the augmented reality technology developed by VisionStar Information Technology (Shanghai) Co., Ltd. The copyright notices in the Software and this entire statement, including the above -license grant, this restriction and the following disclaimer, must be included +license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software. - --- #### About Miquido + - [About](https://careers.miquido.com/about-us/) - [Careers](https://careers.miquido.com/job-offers/) -- [Internship at Miquido](https://careers.miquido.com/students/) \ No newline at end of file +- [Internship at Miquido](https://careers.miquido.com/students/) diff --git a/example/ios/Podfile b/example/ios/Podfile index 728c145..211ff74 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '13.0' + platform :ios, '15.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/pubspec.lock b/example/pubspec.lock index ed314d4..7333d6d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -29,25 +29,25 @@ packages: dependency: transitive description: name: ansicolor - sha256: "607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a" + sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" ar_quido: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.1.5" + version: "0.3.0" args: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.5.0" async: dependency: transitive description: @@ -84,10 +84,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -116,10 +116,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.8" dart_code_metrics: dependency: transitive description: @@ -170,6 +170,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" glob: dependency: transitive description: @@ -206,42 +211,66 @@ packages: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "2.0.1" lint_quido: dependency: "direct dev" description: name: lint_quido - sha256: "6198e2d35a17447684b60f164d282ef8d88c2adfdd0a1f6ceab290b8f64e0dd4" + sha256: "4d565d7df4ad7979d68dbf93f6d010f0569f36a53de7443b8dae18d971b714e8" url: "https://pub.dev" source: hosted - version: "1.13.2" + version: "1.16.0" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" package_config: dependency: transitive description: @@ -254,74 +283,82 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" permission_handler: dependency: "direct main" description: name: permission_handler - sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8" + sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb" url: "https://pub.dev" source: hosted - version: "11.0.1" + version: "11.3.1" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: ace7d15a3d1a4a0b91c041d01e5405df221edb9de9116525efc773c74e6fc790 + sha256: "8bb852cd759488893805c3161d0b2b5db55db52f773dbb014420b304055ba2c5" url: "https://pub.dev" source: hosted - version: "11.0.5" + version: "12.0.6" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" + sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662 url: "https://pub.dev" source: hosted - version: "9.1.4" + version: "9.4.4" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d" + url: "https://pub.dev" + source: hosted + version: "0.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2 + sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20" url: "https://pub.dev" source: hosted - version: "3.11.5" + version: "4.2.1" 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" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.8" process: dependency: transitive description: @@ -363,18 +400,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -403,10 +440,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" typed_data: dependency: transitive description: @@ -431,30 +468,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - watcher: + vm_service: dependency: transitive description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "1.1.0" - web: + version: "13.0.0" + watcher: dependency: transitive description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "1.1.0" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.5.0" yaml: dependency: transitive description: @@ -464,5 +501,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" - flutter: ">=3.13.6" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.6" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 3604835..f39cab4 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,21 +3,21 @@ description: Demonstrates how to use the ar_quido plugin. publish_to: 'none' environment: - sdk: '>=3.1.0 <4.0.0' - flutter: ">=3.13.6" + sdk: '>=3.3.0 <4.0.0' + flutter: ">=3.19.6" dependencies: ar_quido: path: ../ - cupertino_icons: 1.0.6 + cupertino_icons: 1.0.8 flutter: sdk: flutter - permission_handler: 11.0.1 + permission_handler: 11.3.1 dev_dependencies: flutter_test: sdk: flutter - lint_quido: 1.13.2 + lint_quido: 1.16.0 flutter: diff --git a/ios/ar_quido.podspec b/ios/ar_quido.podspec index 2b24d97..31e0028 100644 --- a/ios/ar_quido.podspec +++ b/ios/ar_quido.podspec @@ -17,9 +17,9 @@ Downloaded by pub (not CocoaPods) s.documentation_url = 'https://pub.dev/packages/ar_quido' s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.platform = :ios, '14.0' + s.platform = :ios, '15.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } - s.swift_version = '5.0' + s.swift_version = '5.10' end diff --git a/pubspec.yaml b/pubspec.yaml index 18d4752..5b6516a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,28 +1,28 @@ name: ar_quido description: A Flutter plugin for handling image recognition on mobile platforms -version: 0.2.0 +version: 0.3.0 repository: https://github.com/miquido/ar_quido issue_tracker: https://github.com/miquido/ar_quido/issues homepage: https://github.com/miquido/ar_quido documentation: https://pub.dev/documentation/ar_quido/latest/ environment: - sdk: '>=3.1.0 <4.0.0' - flutter: ">=3.13.6" + sdk: '>=3.3.0 <4.0.0' + flutter: '>=3.19.6' dependencies: flutter: sdk: flutter - plugin_platform_interface: ^2.1.4 + plugin_platform_interface: ^2.1.8 stream_transform: ^2.1.0 dev_dependencies: async: 2.11.0 - build_runner: 2.4.6 + build_runner: 2.4.9 flutter_test: sdk: flutter - lint_quido: 1.13.2 - mockito: 5.4.2 + lint_quido: 1.16.0 + mockito: 5.4.4 flutter: