Add tileColor for passkeys in grid view

This commit is contained in:
Elias Bonnici 2024-08-12 10:01:04 +02:00
parent 3cd299fe9a
commit fbbd0e2667
No known key found for this signature in database
GPG Key ID: 5EAC28EA3F980CCF
2 changed files with 9 additions and 1 deletions

View File

@ -33,6 +33,7 @@ class AppListItem<T> extends ConsumerStatefulWidget {
final Widget Function(BuildContext context)? itemBuilder;
final Intent? tapIntent;
final Intent? doubleTapIntent;
final Color? tileColor;
final bool selected;
const AppListItem(
@ -47,6 +48,7 @@ class AppListItem<T> extends ConsumerStatefulWidget {
this.itemBuilder,
this.tapIntent,
this.doubleTapIntent,
this.tileColor,
this.selected = false,
});
@ -134,6 +136,7 @@ class _AppListItemState<T> extends ConsumerState<AppListItem> {
borderRadius: BorderRadius.circular(16)),
selectedTileColor: colorScheme.secondaryContainer,
selectedColor: colorScheme.onSecondaryContainer,
tileColor: widget.tileColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
selected: widget.selected,
leading: widget.leading,

View File

@ -546,6 +546,9 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
cred,
expanded: expanded,
selected: _selected == cred,
tileColor: layout == FlexLayout.grid
? Theme.of(context).hoverColor
: null,
),
layout: layout,
cellMinWidth: 265,
@ -576,9 +579,10 @@ class _CredentialListItem extends StatelessWidget {
final FidoCredential credential;
final bool selected;
final bool expanded;
final Color? tileColor;
const _CredentialListItem(this.credential,
{required this.expanded, required this.selected});
{required this.expanded, required this.selected, this.tileColor});
@override
Widget build(BuildContext context) {
@ -591,6 +595,7 @@ class _CredentialListItem extends StatelessWidget {
backgroundColor: colorScheme.secondary,
child: const Icon(Symbols.passkey),
),
tileColor: tileColor,
title: credential.rpId,
subtitle: credential.userName,
trailing: expanded