diff --git a/android/build.gradle b/android/build.gradle index 8ef67d3..192aee5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'nl.dutchcodingcompany.pin_lock' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '2.0.20' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -33,6 +33,7 @@ android { defaultConfig { minSdkVersion 16 } + namespace 'nl.dutchcodingcompany.pin_lock' } dependencies { diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 3c9d085..57bde5c 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,6 @@ 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-8.10.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true diff --git a/lib/src/entities/authenticator.dart b/lib/src/entities/authenticator.dart index 89ab5f3..87bc38d 100644 --- a/lib/src/entities/authenticator.dart +++ b/lib/src/entities/authenticator.dart @@ -12,8 +12,8 @@ abstract class Authenticator with WidgetsBindingObserver { /// Interval after which the app will become pin locked after entering the background Duration get lockAfterDuration; - /// Emits a [LockState] event every time the state is changed - Stream get lockState; + /// Emits a [PinLockState] event every time the state is changed + Stream get lockState; /// The number of times that a pin can be entered incorrectly, before the app /// stops accepting unlock attempts for [lockedOutDuration] diff --git a/lib/src/entities/authenticator_impl.dart b/lib/src/entities/authenticator_impl.dart index f78f566..fc41a5d 100644 --- a/lib/src/entities/authenticator_impl.dart +++ b/lib/src/entities/authenticator_impl.dart @@ -38,7 +38,7 @@ class AuthenticatorImpl with WidgetsBindingObserver implements Authenticator { ); @override - Stream get lockState { + Stream get lockState { _checkInitialLockStatus(); return _lockController.state; } diff --git a/lib/src/entities/lock_controller.dart b/lib/src/entities/lock_controller.dart index 578d232..7b0515f 100644 --- a/lib/src/entities/lock_controller.dart +++ b/lib/src/entities/lock_controller.dart @@ -8,9 +8,9 @@ import 'package:pin_lock/src/entities/lock_state.dart'; /// It allows registering callbacks that will get triggered when the /// app is locked/unlocked (e.g., for analytics purposes) class LockController { - /// The stream of [LockState] where the last entry is always the current + /// The stream of [PinLockState] where the last entry is always the current /// state of the app - late final Stream state; + late final Stream state; /// Optionally register a callback that gets triggered every time the app is locked /// (e.g., for analytics purposes) @@ -20,7 +20,7 @@ class LockController { /// (e.g., for analytics purposes) final VoidCallback? onUnlockCallback; - final StreamController _streamController; + final StreamController _streamController; LockController({this.onUnlockCallback, this.onLockCallback}) : _streamController = StreamController.broadcast() { diff --git a/lib/src/entities/lock_state.dart b/lib/src/entities/lock_state.dart index 2fbf535..9fb6b35 100644 --- a/lib/src/entities/lock_state.dart +++ b/lib/src/entities/lock_state.dart @@ -1,13 +1,13 @@ import 'package:equatable/equatable.dart'; import 'package:pin_lock/src/entities/biometric_method.dart'; -abstract class LockState extends Equatable { - const LockState(); +abstract class PinLockState extends Equatable { + const PinLockState(); @override List get props => []; } -class Locked extends LockState { +class Locked extends PinLockState { final List availableBiometricMethods; const Locked({required this.availableBiometricMethods}); @@ -16,6 +16,6 @@ class Locked extends LockState { List get props => [availableBiometricMethods]; } -class Unlocked extends LockState { +class Unlocked extends PinLockState { const Unlocked() : super(); } diff --git a/lib/src/presentation/authenticator_widget.dart b/lib/src/presentation/authenticator_widget.dart index 8b3a769..f2f188b 100644 --- a/lib/src/presentation/authenticator_widget.dart +++ b/lib/src/presentation/authenticator_widget.dart @@ -70,7 +70,7 @@ class _AuthenticatorWidgetState extends State { late final StreamSubscription lockSubscription; OverlayEntry? overlayEntry; bool _isShowingSplashScreen = true; - late final Stream lockState ; + late final Stream lockState; @override void initState() { @@ -123,7 +123,7 @@ class _AuthenticatorWidgetState extends State { @override Widget build(BuildContext context) { - return StreamBuilder( + return StreamBuilder( stream: lockState, builder: (context, snapshot) { if (snapshot.hasData && !_isShowingSplashScreen) {