revert fido credential provider changes

This commit is contained in:
Adam Velebil 2024-03-13 11:23:54 +01:00
parent 4490547e2d
commit 8349135aee
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
4 changed files with 6 additions and 10 deletions

View File

@ -180,7 +180,7 @@ class _FidoFingerprintsNotifier extends FidoFingerprintsNotifier {
}
final androidCredentialProvider = AsyncNotifierProvider.autoDispose
.family<FidoCredentialsNotifier, List<FidoCredential>?, DevicePath>(
.family<FidoCredentialsNotifier, List<FidoCredential>, DevicePath>(
_FidoCredentialsNotifier.new);
class _FidoCredentialsNotifier extends FidoCredentialsNotifier {
@ -188,7 +188,7 @@ class _FidoCredentialsNotifier extends FidoCredentialsNotifier {
late StreamSubscription _sub;
@override
FutureOr<List<FidoCredential>?> build(DevicePath devicePath) async {
FutureOr<List<FidoCredential>> build(DevicePath devicePath) async {
_sub = _events.receiveBroadcastStream().listen((event) {
final json = jsonDecode(event);
if (json == null) {
@ -203,7 +203,7 @@ class _FidoCredentialsNotifier extends FidoCredentialsNotifier {
});
ref.onDispose(_sub.cancel);
return Completer<List<FidoCredential>?>().future;
return Completer<List<FidoCredential>>().future;
}
@override

View File

@ -269,7 +269,7 @@ class _DesktopFidoFingerprintsNotifier extends FidoFingerprintsNotifier {
}
final desktopCredentialProvider = AsyncNotifierProvider.autoDispose
.family<FidoCredentialsNotifier, List<FidoCredential>?, DevicePath>(
.family<FidoCredentialsNotifier, List<FidoCredential>, DevicePath>(
_DesktopFidoCredentialsNotifier.new);
class _DesktopFidoCredentialsNotifier extends FidoCredentialsNotifier {

View File

@ -44,11 +44,11 @@ abstract class FidoFingerprintsNotifier
}
final credentialProvider = AsyncNotifierProvider.autoDispose
.family<FidoCredentialsNotifier, List<FidoCredential>?, DevicePath>(
.family<FidoCredentialsNotifier, List<FidoCredential>, DevicePath>(
() => throw UnimplementedError(),
);
abstract class FidoCredentialsNotifier
extends AutoDisposeFamilyAsyncNotifier<List<FidoCredential>?, DevicePath> {
extends AutoDisposeFamilyAsyncNotifier<List<FidoCredential>, DevicePath> {
Future<void> deleteCredential(FidoCredential credential);
}

View File

@ -237,10 +237,6 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
}
final credentials = data.value;
if (credentials == null) {
return _buildLoadingPage(context);
}
if (credentials.isEmpty) {
return MessagePage(
title: l10n.s_passkeys,