2025-05-20 08:35:22 -05:00
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
|
import 'package:local_auth/local_auth.dart';
|
|
|
|
|
|
|
|
|
|
class BiometricStatus {
|
|
|
|
|
final List<BiometricType> availableBiometrics;
|
|
|
|
|
final bool canAuthenticate;
|
|
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
const BiometricStatus({required this.availableBiometrics, required this.canAuthenticate});
|
2025-05-20 08:35:22 -05:00
|
|
|
|
|
|
|
|
@override
|
2025-07-25 08:07:22 +05:30
|
|
|
String toString() => 'BiometricStatus(availableBiometrics: $availableBiometrics, canAuthenticate: $canAuthenticate)';
|
2025-05-20 08:35:22 -05:00
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
BiometricStatus copyWith({List<BiometricType>? availableBiometrics, bool? canAuthenticate}) {
|
2025-05-20 08:35:22 -05:00
|
|
|
return BiometricStatus(
|
|
|
|
|
availableBiometrics: availableBiometrics ?? this.availableBiometrics,
|
|
|
|
|
canAuthenticate: canAuthenticate ?? this.canAuthenticate,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(covariant BiometricStatus other) {
|
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
final listEquals = const DeepCollectionEquality().equals;
|
|
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
return listEquals(other.availableBiometrics, availableBiometrics) && other.canAuthenticate == canAuthenticate;
|
2025-05-20 08:35:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => availableBiometrics.hashCode ^ canAuthenticate.hashCode;
|
|
|
|
|
}
|