mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 00:12:09 +03:00
Add tileColor
for passkeys in grid view
This commit is contained in:
parent
3cd299fe9a
commit
fbbd0e2667
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user