diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b187a2..0b57819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -## 5.0.1-dev.1 +## 5.0.1 * Add option for iOS/MacOS to allow non-biometric authentication (`darwinBiometricOnly`) #101 * Improve [canAuthenticate] to differentiate between no available biometry and no available user code. +* Bump dart sdk requirement to `3.2`. ## 5.0.0+4 diff --git a/README.md b/README.md index ebd775b..d41886c 100644 --- a/README.md +++ b/README.md @@ -30,29 +30,33 @@ makes heavy use of this plugin. * `android/build.gradle`: `ext.kotlin_version = '1.4.31'` * MainActivity must extend FlutterFragmentActivity * Theme for the main activity must use `Theme.AppCompat` thme. - (Otherwise there will be crases on Android < 29) + (Otherwise there will be crashes on Android < 29) For example: - **AndroidManifest.xml**: + **android/app/src/main/AndroidManifest.xml**: ```xml + [...] + + ``` - **xml/styles.xml**: + **android/app/src/main/res/values/styles.xml**: ```xml - + + + + ``` ##### Resources @@ -65,7 +69,7 @@ makes heavy use of this plugin. https://developer.apple.com/documentation/localauthentication/logging_a_user_into_your_app_with_face_id_or_touch_id * include the NSFaceIDUsageDescription key in your app’s Info.plist file -* Requires at least iOS 9 +* Supports all iOS versions supported by Flutter. (ie. iOS 12) **Known Issue**: since iOS 15 the simulator seem to no longer support local authentication: https://developer.apple.com/forums/thread/685773 @@ -76,7 +80,7 @@ https://developer.apple.com/documentation/localauthentication/logging_a_user_int * enable keychain sharing and signing. (not sure why this is required. but without it You will probably see an error like: > SecurityError, Error while writing data: -34018: A required entitlement isn't present. -* Requires at least Mac OS 10.12 +* Supports all MacOS Versions supported by Flutter (ie. >= MacOS 10.14) ### Usage diff --git a/analysis_options.yaml b/analysis_options.yaml index fa59827..0ba1255 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,7 +1,4 @@ -# Defines a default set of lint rules enforced for -# projects at Google. For details and rationale, -# see https://github.com/dart-lang/pedantic#enabled-lints. -include: package:lints/recommended.yaml +include: package:flutter_lints/flutter.yaml analyzer: errors: @@ -20,156 +17,3 @@ analyzer: linter: rules: - # these rules are documented on and in the same order as - # the Dart Lint rules page to make maintenance easier - # http://dart-lang.github.io/linter/lints/ - - # HP mostly in sync with https://github.com/flutter/flutter/blob/master/analysis_options.yaml - - - always_declare_return_types - - always_put_control_body_on_new_line - # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 - - always_require_non_null_named_parameters - #- always_specify_types - - annotate_overrides - # - avoid_annotating_with_dynamic # not yet tested - # - avoid_as - - avoid_bool_literals_in_conditional_expressions - # - avoid_catches_without_on_clauses # not yet tested - # - avoid_catching_errors # not yet tested - # - avoid_classes_with_only_static_members # not yet tested - # - avoid_double_and_int_checks # only useful when targeting JS runtime - - avoid_empty_else - - avoid_field_initializers_in_const_classes - - avoid_function_literals_in_foreach_calls - # - avoid_implementing_value_types # not yet tested - - avoid_init_to_null - # - avoid_js_rounded_ints # only useful when targeting JS runtime - - avoid_null_checks_in_equality_operators - # - avoid_positional_boolean_parameters # not yet tested - # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) - - avoid_relative_lib_imports - - avoid_renaming_method_parameters - - avoid_return_types_on_setters - # - avoid_returning_null # not yet tested - # - avoid_returning_null_for_future # not yet tested - - avoid_returning_null_for_void - # - avoid_returning_this # not yet tested - # - avoid_setters_without_getters # not yet tested - # - avoid_shadowing_type_parameters # not yet tested - # - avoid_single_cascade_in_expression_statements # not yet tested - - avoid_slow_async_io - - avoid_types_as_parameter_names - # - avoid_types_on_closure_parameters # not yet tested - - avoid_unused_constructor_parameters - - avoid_void_async - - await_only_futures - - camel_case_types - - cancel_subscriptions - # - cascade_invocations # not yet tested - # - close_sinks # not reliable enough - # - comment_references # blocked on https://github.com/flutter/flutter/issues/20765 - # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 - - control_flow_in_finally - - curly_braces_in_flow_control_structures - # - diagnostic_describe_all_properties # not yet tested - - directives_ordering - - empty_catches - - empty_constructor_bodies - - empty_statements - # - file_names # not yet tested - # - flutter_style_todos TODO(HP) - - hash_and_equals - - implementation_imports - # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811 - - iterable_contains_unrelated_type - # - join_return_with_assignment # not yet tested - - library_names - - library_prefixes - # - lines_longer_than_80_chars # not yet tested - - list_remove_unrelated_type - # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 - - no_adjacent_strings_in_list - - no_duplicate_case_values - - non_constant_identifier_names - # - null_closures # not yet tested - # - omit_local_variable_types # opposite of always_specify_types - # - one_member_abstracts # too many false positives - # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 - - overridden_fields - - package_api_docs - - package_names - - package_prefixed_library_names - # - parameter_assignments # we do this commonly - - prefer_adjacent_string_concatenation - - prefer_asserts_in_initializer_lists - # - prefer_asserts_with_message # not yet tested - - prefer_collection_literals - - prefer_conditional_assignment - - prefer_const_constructors - - prefer_const_constructors_in_immutables - - prefer_const_declarations - - prefer_const_literals_to_create_immutables - # - prefer_constructors_over_static_methods # not yet tested - - prefer_contains - # - prefer_double_quotes # opposite of prefer_single_quotes - - prefer_equal_for_default_values - # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - - prefer_final_fields - # - prefer_final_in_for_each # not yet tested - - prefer_final_locals - # - prefer_for_elements_to_map_fromIterable # not yet tested - - prefer_foreach - # - prefer_function_declarations_over_variables # not yet tested - - prefer_generic_function_type_aliases - # - prefer_if_elements_to_conditional_expressions # not yet tested - - prefer_if_null_operators - - prefer_initializing_formals - - prefer_inlined_adds - # - prefer_int_literals # not yet tested - # - prefer_interpolation_to_compose_strings # not yet tested - - prefer_is_empty - - prefer_is_not_empty - - prefer_iterable_whereType - # - prefer_mixin # https://github.com/dart-lang/language/issues/32 - # - prefer_null_aware_operators # disable until NNBD, see https://github.com/flutter/flutter/pull/32711#issuecomment-492930932 - - prefer_single_quotes - - prefer_spread_collections - - prefer_typing_uninitialized_variables - - prefer_void_to_null - # - provide_deprecation_message # not yet tested - # - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml - - recursive_getters - - slash_for_doc_comments - # - sort_child_properties_last # not yet tested - - sort_constructors_first - #- sort_pub_dependencies - - sort_unnamed_constructors_first - - test_types_in_equals - - throw_in_finally - # - type_annotate_public_apis # subset of always_specify_types - - type_init_formals - # - unawaited_futures # https://github.com/flutter/flutter/issues/5793 - # - unnecessary_await_in_return # not yet tested - - unnecessary_brace_in_string_interps - - unnecessary_const - - unnecessary_getters_setters - # - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 - - unnecessary_new - - unnecessary_null_aware_assignments - - unnecessary_null_in_if_null_operators - - unnecessary_overrides - #- unnecessary_parenthesis HP: I like parenthesis :-) - - unnecessary_statements - - unnecessary_this - - unrelated_type_equality_checks - # - unsafe_html # not yet tested - - use_full_hex_values_for_flutter_colors - # - use_function_type_syntax_for_parameters # not yet tested - - use_rethrow_when_possible - # - use_setters_to_change_properties # not yet tested - # - use_string_buffers # https://github.com/dart-lang/linter/pull/664 - # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review - - valid_regexps - # - void_checks # not yet tested - diff --git a/android/src/main/kotlin/design/codeux/biometric_storage/BiometricStoragePlugin.kt b/android/src/main/kotlin/design/codeux/biometric_storage/BiometricStoragePlugin.kt index aa8e56d..2894fc8 100644 --- a/android/src/main/kotlin/design/codeux/biometric_storage/BiometricStoragePlugin.kt +++ b/android/src/main/kotlin/design/codeux/biometric_storage/BiometricStoragePlugin.kt @@ -159,7 +159,7 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { errorInfo.message.toString(), errorInfo.errorDetails ) - logger.error("AuthError: $errorInfo") + logger.error { "AuthError: $errorInfo" } } @@ -221,7 +221,7 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { } } - val options = call.argument>("options")?.let { it -> + val options = call.argument>("options")?.let { InitOptions( authenticationValidityDurationSeconds = it["authenticationValidityDurationSeconds"] as Int, authenticationRequired = it["authenticationRequired"] as Boolean, @@ -318,7 +318,7 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { } private fun canAuthenticate(): CanAuthenticateResponse { - val credentialsResponse = biometricManager.canAuthenticate(DEVICE_CREDENTIAL); + val credentialsResponse = biometricManager.canAuthenticate(DEVICE_CREDENTIAL) logger.debug { "canAuthenticate for DEVICE_CREDENTIAL: $credentialsResponse" } if (credentialsResponse == BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED) { return CanAuthenticateResponse.Success @@ -345,7 +345,7 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { @WorkerThread onSuccess: (cipher: Cipher?) -> Unit, onError: ErrorCallback ) { - logger.trace("authenticate()") + logger.trace {"authenticate()" } val activity = attachedActivity ?: return run { logger.error { "We are not attached to an activity." } onError( @@ -358,7 +358,7 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { val prompt = BiometricPrompt(activity, executor, object : BiometricPrompt.AuthenticationCallback() { override fun onAuthenticationError(errorCode: Int, errString: CharSequence) { - logger.trace("onAuthenticationError($errorCode, $errString)") + logger.trace { "onAuthenticationError($errorCode, $errString)" } ui(onError) { onError( AuthenticationErrorInfo( @@ -372,12 +372,12 @@ class BiometricStoragePlugin : FlutterPlugin, ActivityAware, MethodCallHandler { @WorkerThread override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) { - logger.trace("onAuthenticationSucceeded($result)") + logger.trace { "onAuthenticationSucceeded($result)" } worker(onError) { onSuccess(result.cryptoObject?.cipher) } } override fun onAuthenticationFailed() { - logger.trace("onAuthenticationFailed()") + logger.trace { "onAuthenticationFailed()" } // this just means the user was not recognised, but the O/S will handle feedback so we don't have to } }) diff --git a/doc/screenshot_ios.png b/doc/screenshot_ios.png new file mode 100644 index 0000000..08fee0c Binary files /dev/null and b/doc/screenshot_ios.png differ diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d2..8c6e561 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/Flutter/Flutter.podspec b/example/ios/Flutter/Flutter.podspec index 29758b7..98e1633 100644 --- a/example/ios/Flutter/Flutter.podspec +++ b/example/ios/Flutter/Flutter.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.license = { :type => 'BSD' } s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '12.0' # Framework linking is handled by Flutter tooling, not CocoaPods. # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. s.vendored_frameworks = 'path/to/nothing' diff --git a/example/ios/Podfile b/example/ios/Podfile index 88359b2..279576f 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, '11.0' +# platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 3366bad..e9c8ef2 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -15,8 +15,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: biometric_storage: 1400f1382af3a4cc2bf05340e13c3d8de873ceb9 - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 +PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index cf61e3c..1772d3e 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -352,7 +352,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -435,7 +435,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -484,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 928e6d5..d8315c7 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -19,4 +19,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.0 diff --git a/example/pubspec.lock b/example/pubspec.lock index 3cfe29d..3d69d78 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -15,7 +15,7 @@ packages: path: ".." relative: true source: path - version: "5.0.0+4" + version: "5.0.1" boolean_selector: dependency: transitive description: @@ -44,26 +44,18 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" + version: "1.18.0" dio: dependency: transitive description: name: dio - sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 + sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.4.0" fake_async: dependency: transitive description: @@ -85,6 +77,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 + url: "https://pub.dev" + source: hosted + version: "3.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -107,18 +107,18 @@ packages: dependency: transitive description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" lints: - dependency: "direct dev" + dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" logging: dependency: "direct main" description: @@ -155,10 +155,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -171,10 +171,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.8" sky_engine: dependency: transitive description: flutter @@ -192,18 +192,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" string_scanner: dependency: transitive description: @@ -224,10 +224,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: @@ -248,18 +248,18 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: name: win32 - sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" url: "https://pub.dev" source: hosted - version: "5.0.6" + version: "5.2.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=2.8.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c609e2d..b9578db 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=2.15.0-259.16.beta <3.0.0' + sdk: '>=3.2.0 <4.0.0' dependencies: biometric_storage: @@ -14,14 +14,10 @@ dependencies: logging: ^1.2.0 logging_appenders: ^1.1.0 - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - dev_dependencies: flutter_test: sdk: flutter - lints: ^2.0.0 + flutter_lints: ^3.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/src/biometric_storage_win32.dart b/lib/src/biometric_storage_win32.dart index bc7ae24..84d807a 100644 --- a/lib/src/biometric_storage_win32.dart +++ b/lib/src/biometric_storage_win32.dart @@ -1,6 +1,5 @@ import 'dart:convert'; import 'dart:ffi'; -import 'dart:typed_data'; import 'package:ffi/ffi.dart'; import 'package:logging/logging.dart'; @@ -103,7 +102,7 @@ class Win32BiometricStoragePlugin extends BiometricStorage { PromptInfo promptInfo, ) async { _logger.fine('write()'); - final examplePassword = utf8.encode(content) as Uint8List; + final examplePassword = utf8.encode(content); final blob = examplePassword.allocatePointer(); final namePointer = TEXT(name); final userNamePointer = TEXT('flutter.biometric_storage'); diff --git a/pubspec.yaml b/pubspec.yaml index c68e742..1e8f409 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,11 +2,11 @@ name: biometric_storage description: | Secure Storage: Encrypted data store optionally secured by biometric lock with support for iOS, Android, MacOS. Partial support for Linux, Windows and web (localStorage). -version: 5.0.1-dev.1 +version: 5.0.1 homepage: https://github.com/authpass/biometric_storage/ environment: - sdk: '>=2.17.0 <4.0.0' + sdk: '>=3.2.0 <4.0.0' flutter: ">=2.8.0" dependencies: @@ -23,7 +23,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - lints: ^2.1.1 + flutter_lints: ^3.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -53,9 +53,11 @@ flutter: fileName: src/biometric_storage_web.dart topics: - - files - biometrics - encryption - storage - security - + - secure-storage +screenshots: + - description: 'Face ID on iPhone' + path: doc/screenshot_ios.png diff --git a/test/biometric_storage_test.dart b/test/biometric_storage_test.dart index 52cb1d4..085e8d0 100644 --- a/test/biometric_storage_test.dart +++ b/test/biometric_storage_test.dart @@ -8,7 +8,8 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { - channel.setMockMethodCallHandler((MethodCall methodCall) async { + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, (MethodCall methodCall) async { if (methodCall.method == 'canAuthenticate') { return 'ErrorUnknown'; } @@ -17,7 +18,8 @@ void main() { }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler(channel, null); }); test('canAuthenticate', () async {