diff --git a/android/build.gradle b/android/build.gradle index 165dd0b5..078f1712 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.tfliteflutter.tflite_flutter_helper' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.7.10' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3c9d0852..3c472b99 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt b/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt index 37b31929..642387be 100644 --- a/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt +++ b/android/src/main/kotlin/com/tfliteflutter/tflite_flutter_helper/TfliteFlutterHelperPlugin.kt @@ -140,8 +140,8 @@ class TfliteFlutterHelperPlugin : FlutterPlugin, } } - override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, - grantResults: IntArray?): Boolean { + override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, + grantResults: IntArray): Boolean { when (requestCode) { AUDIO_RECORD_PERMISSION_CODE -> { if (grantResults != null) { diff --git a/example/audio_classification/android/app/build.gradle b/example/audio_classification/android/app/build.gradle index 0d7a73fd..2a0da20f 100644 --- a/example/audio_classification/android/app/build.gradle +++ b/example/audio_classification/android/app/build.gradle @@ -26,7 +26,17 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -36,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.audio_classification" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/audio_classification/android/app/src/main/AndroidManifest.xml b/example/audio_classification/android/app/src/main/AndroidManifest.xml index 932596bd..75b38691 100644 --- a/example/audio_classification/android/app/src/main/AndroidManifest.xml +++ b/example/audio_classification/android/app/src/main/AndroidManifest.xml @@ -7,7 +7,9 @@ android:icon="@mipmap/ic_launcher"> CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 12.0 diff --git a/example/audio_classification/ios/Podfile b/example/audio_classification/ios/Podfile new file mode 100644 index 00000000..eea7da85 --- /dev/null +++ b/example/audio_classification/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # target 'RunnerTests' do + # inherit! :search_paths + # end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/audio_classification/ios/Podfile.lock b/example/audio_classification/ios/Podfile.lock new file mode 100644 index 00000000..de642061 --- /dev/null +++ b/example/audio_classification/ios/Podfile.lock @@ -0,0 +1,68 @@ +PODS: + - camera_avfoundation (0.0.1): + - Flutter + - Flutter (1.0.0) + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - TensorFlowLiteC (2.12.0): + - TensorFlowLiteC/Core (= 2.12.0) + - TensorFlowLiteC/Core (2.12.0) + - TensorFlowLiteC/CoreML (2.12.0): + - TensorFlowLiteC/Core + - TensorFlowLiteC/Metal (2.12.0): + - TensorFlowLiteC/Core + - TensorFlowLiteSwift (2.12.0): + - TensorFlowLiteSwift/Core (= 2.12.0) + - TensorFlowLiteSwift/Core (2.12.0): + - TensorFlowLiteC (= 2.12.0) + - TensorFlowLiteSwift/CoreML (2.12.0): + - TensorFlowLiteC/CoreML (= 2.12.0) + - TensorFlowLiteSwift/Core (= 2.12.0) + - TensorFlowLiteSwift/Metal (2.12.0): + - TensorFlowLiteC/Metal (= 2.12.0) + - TensorFlowLiteSwift/Core (= 2.12.0) + - tflite_flutter (0.0.1): + - Flutter + - TensorFlowLiteSwift (= 2.12.0) + - TensorFlowLiteSwift/CoreML (= 2.12.0) + - TensorFlowLiteSwift/Metal (= 2.12.0) + - tflite_flutter_helper (0.0.1): + - Flutter + +DEPENDENCIES: + - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) + - Flutter (from `Flutter`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - tflite_flutter (from `.symlinks/plugins/tflite_flutter/ios`) + - tflite_flutter_helper (from `.symlinks/plugins/tflite_flutter_helper/ios`) + +SPEC REPOS: + trunk: + - TensorFlowLiteC + - TensorFlowLiteSwift + +EXTERNAL SOURCES: + camera_avfoundation: + :path: ".symlinks/plugins/camera_avfoundation/ios" + Flutter: + :path: Flutter + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + tflite_flutter: + :path: ".symlinks/plugins/tflite_flutter/ios" + tflite_flutter_helper: + :path: ".symlinks/plugins/tflite_flutter_helper/ios" + +SPEC CHECKSUMS: + camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + TensorFlowLiteC: 20785a69299185a379ba9852b6625f00afd7984a + TensorFlowLiteSwift: 3a4928286e9e35bdd3e17970f48e53c80d25e793 + tflite_flutter: 9433d086a3060431bbc9f3c7c20d017db0e72d08 + tflite_flutter_helper: 543b46b6bd064b21c92ea6e54bc0b29f1ce74cb5 + +PODFILE CHECKSUM: 0805b11bfb13bd44fc55fe52946ce14f22a2998e + +COCOAPODS: 1.15.2 diff --git a/example/audio_classification/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/audio_classification/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..e67b2808 100644 --- a/example/audio_classification/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/audio_classification/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + diff --git a/example/audio_classification/ios/Runner/AppDelegate.swift b/example/audio_classification/ios/Runner/AppDelegate.swift index 70693e4a..b6363034 100644 --- a/example/audio_classification/ios/Runner/AppDelegate.swift +++ b/example/audio_classification/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/example/audio_classification/ios/Runner/Info.plist b/example/audio_classification/ios/Runner/Info.plist index 83fe6749..b859ed0e 100644 --- a/example/audio_classification/ios/Runner/Info.plist +++ b/example/audio_classification/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -22,6 +24,8 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/example/audio_classification/lib/classifier.dart b/example/audio_classification/lib/classifier.dart index e8361bed..7f499e71 100644 --- a/example/audio_classification/lib/classifier.dart +++ b/example/audio_classification/lib/classifier.dart @@ -15,7 +15,7 @@ class Classifier { TensorType _outputType = TensorType.uint8; - final String _modelFileName = 'yamnet.tflite'; + final String _modelFileName = 'assets/yamnet.tflite'; final String _labelFileName = 'assets/yamnet_class_map.csv'; late Map labels; diff --git a/example/audio_classification/pubspec.lock b/example/audio_classification/pubspec.lock index 8d944b31..06f9ada9 100644 --- a/example/audio_classification/pubspec.lock +++ b/example/audio_classification/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: archive - sha256: a92e39b291073bb840a72cf43d96d2a63c74e9a485d227833e8ea0054d16ad16 + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.6.1" async: dependency: transitive description: @@ -29,18 +29,42 @@ packages: dependency: transitive description: name: camera - sha256: "2bfd375ed79503d909c3356c862c19ef95bfd84772f167cfe4aa7258b94be8fc" + sha256: "26ff41045772153f222ffffecba711a206f670f5834d40ebf5eed3811692f167" url: "https://pub.dev" source: hosted - version: "0.8.1+7" + version: "0.11.0+2" + camera_android_camerax: + dependency: transitive + description: + name: camera_android_camerax + sha256: e3627fdc2132d89212b8a8676679f5b07008c7e3d8ae00cea775c3397f9e742b + url: "https://pub.dev" + source: hosted + version: "0.6.10" + camera_avfoundation: + dependency: transitive + description: + name: camera_avfoundation + sha256: "2e4c568f70e406ccb87376bc06b53d2f5bebaab71e2fbcc1a950e31449381bcf" + url: "https://pub.dev" + source: hosted + version: "0.9.17+5" camera_platform_interface: dependency: transitive description: name: camera_platform_interface - sha256: "50cee64830e009e2213a4d1e57ba5b7cad18d258742f29f3f65feb1b1e599db3" + sha256: b3ede1f171532e0d83111fe0980b46d17f1aa9788a07a2fbed07366bbdbb9061 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.8.0" + camera_web: + dependency: transitive + description: + name: camera_web + sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f" + url: "https://pub.dev" + source: hosted + version: "0.3.5" characters: dependency: transitive description: @@ -69,26 +93,26 @@ packages: dependency: transitive description: name: cross_file - sha256: "437b2b8da454fe1e01131f4410274fd607347325e9330f0b469ed5a204991068" + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" url: "https://pub.dev" source: hosted - version: "0.3.1+4" + version: "0.3.4+2" crypto: dependency: transitive description: name: crypto - sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.6" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.8" fake_async: dependency: transitive description: @@ -106,31 +130,44 @@ packages: source: hosted version: "2.1.3" file: - dependency: transitive + dependency: "direct main" description: name: file - sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" + url: "https://pub.dev" + source: hosted + version: "2.0.23" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" image: dependency: transitive description: name: image - sha256: "3e5c9ef82c0af7823be4cb5294a829a6e0548a6f6b4e261e6386509a9e03bcab" + sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.3.0" leak_tracker: dependency: transitive description: @@ -191,66 +228,66 @@ packages: dependency: transitive description: name: path_provider - sha256: cfdc261c62a7273be7e051b19d27e503927a40919932f790681042a038f3605d + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.0.2" - path_provider_linux: + version: "2.1.5" + path_provider_android: dependency: transitive description: - name: path_provider_linux - sha256: "938d2b6591587bcb009d2109a6ea464fd8fb2a75dc6423171b0d0afb1d27c708" + name: path_provider_android + sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a url: "https://pub.dev" source: hosted - version: "2.0.0" - path_provider_macos: + version: "2.2.12" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - sha256: eb58b896ea3a504f0b0fa7870646bda6935a6f752b2a54df33f97070dacca8d4 + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.0.0" - path_provider_platform_interface: + version: "2.4.0" + path_provider_linux: dependency: transitive description: - name: path_provider_platform_interface - sha256: c2af5a8a6369992d915f8933dfc23172071001359d17896e83db8be57db8a397 + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.0.1" - path_provider_windows: + version: "2.2.1" + path_provider_platform_interface: dependency: transitive description: - name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.1.7" - pedantic: + version: "2.1.2" + path_provider_windows: dependency: transitive description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "2.3.0" petitparser: dependency: transitive description: name: petitparser - sha256: "85e8f8b118afcccf948a9844d199e56260117400bd9b9982d87bf1d62ebc1690" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: ebc79f16b5f6b609aad4a5e63447d4795d16f7adee46e93ed03200848c006735 + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -259,22 +296,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - process: - dependency: transitive - description: - name: process - sha256: dc3c073b5bc0db4e0f3dbc6b69f8e9cf2f336dafb3db996242ebdacf94c295dd - url: "https://pub.dev" - source: hosted - version: "4.2.1" quiver: dependency: transitive description: name: quiver - sha256: "5e592c348a6c528fb8deb7cc7d85a7097ce65bf2349121ad004d1fc5d5905eaa" + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.2" random_color: dependency: "direct main" description: @@ -316,10 +345,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: @@ -358,23 +387,23 @@ packages: path: "../.." relative: true source: path - version: "0.3.0" + version: "0.4.3" tuple: dependency: transitive description: name: tuple - sha256: fe3ae4f0dca3f9aac0888e2e0d117b642ce283a82d7017b54136290c0a3b0dd3 + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" vector_math: dependency: transitive description: @@ -391,30 +420,30 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" - win32: + web: dependency: transitive description: - name: win32 - sha256: "4d45dc9069dba4619dc0ebd93c7cec5e66d8482cb625a370ac806dcc8165f2ec" + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb url: "https://pub.dev" source: hosted - version: "5.5.5" + version: "1.1.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "0186b3f2d66be9a12b0295bddcf8b6f8c0b0cc2f85c6287344e2a6366bc28457" + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.1.0" xml: dependency: transitive description: name: xml - sha256: "30498604ab00fc50286f8aaf7e077c496550b16ed2f325c14152244882314f03" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "5.1.2" + version: "6.5.0" sdks: dart: ">=3.5.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.24.0" diff --git a/example/audio_classification/pubspec.yaml b/example/audio_classification/pubspec.yaml index 50a02e1f..09c169d3 100644 --- a/example/audio_classification/pubspec.yaml +++ b/example/audio_classification/pubspec.yaml @@ -30,6 +30,8 @@ dependencies: path: ../../ random_color: ^1.0.6-nullsafety + file: ^6.1.4 + dev_dependencies: flutter_test: sdk: flutter diff --git a/lib/src/task/bindings/text/nl_classifier/types.dart b/lib/src/task/bindings/text/nl_classifier/types.dart index 94902df1..5ce2fa49 100644 --- a/lib/src/task/bindings/text/nl_classifier/types.dart +++ b/lib/src/task/bindings/text/nl_classifier/types.dart @@ -2,9 +2,9 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; -class TfLiteNLClassifier extends Opaque {} +final class TfLiteNLClassifier extends Opaque {} -class TfLiteNLClassifierOptions extends Struct { +final class TfLiteNLClassifierOptions extends Struct { @Int32() external int inputTensorIndex; @@ -40,23 +40,23 @@ class TfLiteNLClassifierOptions extends Struct { } } -class TfLiteCategories extends Struct { +final class TfLiteCategories extends Struct { @Int32() external int size; external Pointer categories; } -class TfLiteCategory extends Struct { +final class TfLiteCategory extends Struct { external Pointer text; @Double() external double score; } -class TfLiteBertNLClassifier extends Opaque {} +final class TfLiteBertNLClassifier extends Opaque {} -class TfLiteBertNLClassifierOptions extends Struct { +final class TfLiteBertNLClassifierOptions extends Struct { @Int32() external int maxSeqLen; diff --git a/lib/src/task/bindings/text/qa/types.dart b/lib/src/task/bindings/text/qa/types.dart index 0f7255d5..dcfb6768 100644 --- a/lib/src/task/bindings/text/qa/types.dart +++ b/lib/src/task/bindings/text/qa/types.dart @@ -2,9 +2,9 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; -class TfLiteBertQuestionAnswerer extends Opaque {} +final class TfLiteBertQuestionAnswerer extends Opaque {} -class TfLiteQaAnswer extends Struct { +final class TfLiteQaAnswer extends Struct { @Int32() external int start; @Int32() @@ -15,7 +15,7 @@ class TfLiteQaAnswer extends Struct { external Pointer text; } -class TfLiteQaAnswers extends Struct { +final class TfLiteQaAnswers extends Struct { @Int32() external int size; diff --git a/pubspec.lock b/pubspec.lock index 8bf2eb92..27074ed5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: camera_avfoundation - sha256: "0d04cec8715b59fb6dc60eefb47e69024f51233c570e475b886dc9290568bca7" + sha256: "2e4c568f70e406ccb87376bc06b53d2f5bebaab71e2fbcc1a950e31449381bcf" url: "https://pub.dev" source: hosted - version: "0.9.17+4" + version: "0.9.17+5" camera_platform_interface: dependency: transitive description: @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" fake_async: dependency: transitive description: @@ -148,10 +148,10 @@ packages: dependency: "direct main" description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.3.0" leak_tracker: dependency: transitive description: @@ -212,10 +212,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: @@ -268,10 +268,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -369,10 +369,10 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index feceeef0..68b04a06 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.4.3 homepage: https://www.github.com/am15h/tflite_flutter_helper environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.10.0" + sdk: '>=3.3.0 <4.0.0' + flutter: '>=1.10.0' dependencies: flutter: