reduce flicker on Accounts and Fingerprints screen

This commit is contained in:
Adam Velebil 2024-04-15 08:59:07 +02:00
parent 1d178a78c6
commit 43d69a6025
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
3 changed files with 9 additions and 4 deletions

View File

@ -54,6 +54,8 @@ class FingerprintsScreen extends ConsumerWidget {
final l10n = AppLocalizations.of(context)!;
return ref.watch(fidoStateProvider(deviceData.node.path)).when(
loading: () => AppPage(
title: l10n.s_fingerprints,
capabilities: const [Capability.fido2],
centered: true,
delayedContent: true,
builder: (context, _) => const CircularProgressIndicator(),
@ -344,6 +346,8 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
}
Widget _buildLoadingPage(BuildContext context) => AppPage(
title: AppLocalizations.of(context)!.s_fingerprints,
capabilities: const [Capability.fido2],
centered: true,
delayedContent: true,
builder: (context, _) => const CircularProgressIndicator(),

View File

@ -263,7 +263,7 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
final data = ref.watch(credentialProvider(widget.node.path)).asData;
if (data == null) {
return _buildLoadingPage(l10n, context);
return _buildLoadingPage(context);
}
final credentials = data.value;
final filteredCredentials =
@ -502,9 +502,8 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
);
}
Widget _buildLoadingPage(AppLocalizations l10n, BuildContext context) =>
AppPage(
title: l10n.s_passkeys,
Widget _buildLoadingPage(BuildContext context) => AppPage(
title: AppLocalizations.of(context)!.s_passkeys,
capabilities: const [Capability.fido2],
centered: true,
delayedContent: true,

View File

@ -204,6 +204,8 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
if (numCreds == null) {
return AppPage(
title: AppLocalizations.of(context)!.s_accounts,
capabilities: const [Capability.oath],
centered: true,
delayedContent: true,
builder: (context, _) => const CircularProgressIndicator(),