mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-24 18:52:55 +03:00
Merge PR #1094.
This commit is contained in:
commit
2aeffce0a4
@ -142,7 +142,32 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
|||||||
},
|
},
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final helper = AccountHelper(context, ref, credential);
|
final helper = AccountHelper(context, ref, credential);
|
||||||
return GestureDetector(
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
|
final showAvatar = constraints.maxWidth >= 315;
|
||||||
|
final subtitle = helper.subtitle;
|
||||||
|
final circleAvatar = CircleAvatar(
|
||||||
|
foregroundColor: darkMode ? Colors.black : Colors.white,
|
||||||
|
backgroundColor: _iconColor(darkMode ? 300 : 400),
|
||||||
|
child: Text(
|
||||||
|
(credential.issuer ?? credential.name)
|
||||||
|
.characters
|
||||||
|
.first
|
||||||
|
.toUpperCase(),
|
||||||
|
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w300),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Shortcuts(
|
||||||
|
shortcuts: {
|
||||||
|
LogicalKeySet(LogicalKeyboardKey.enter): const OpenIntent(),
|
||||||
|
LogicalKeySet(LogicalKeyboardKey.space): const OpenIntent(),
|
||||||
|
},
|
||||||
|
child: Semantics(
|
||||||
|
label: _a11yCredentialLabel(
|
||||||
|
credential.issuer, credential.name, helper.code?.value),
|
||||||
|
child: InkWell(
|
||||||
|
focusNode: _focusNode,
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
onSecondaryTapDown: (details) {
|
onSecondaryTapDown: (details) {
|
||||||
showMenu(
|
showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
@ -155,37 +180,6 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
|||||||
items: _buildPopupMenu(context, helper),
|
items: _buildPopupMenu(context, helper),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: LayoutBuilder(builder: (context, constraints) {
|
|
||||||
final showAvatar = constraints.maxWidth >= 315;
|
|
||||||
|
|
||||||
final subtitle = helper.subtitle;
|
|
||||||
|
|
||||||
final circleAvatar = CircleAvatar(
|
|
||||||
foregroundColor: darkMode ? Colors.black : Colors.white,
|
|
||||||
backgroundColor: _iconColor(darkMode ? 300 : 400),
|
|
||||||
child: Text(
|
|
||||||
(credential.issuer ?? credential.name)
|
|
||||||
.characters
|
|
||||||
.first
|
|
||||||
.toUpperCase(),
|
|
||||||
style:
|
|
||||||
const TextStyle(fontSize: 16, fontWeight: FontWeight.w300),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Shortcuts(
|
|
||||||
shortcuts: {
|
|
||||||
LogicalKeySet(LogicalKeyboardKey.enter): const OpenIntent(),
|
|
||||||
LogicalKeySet(LogicalKeyboardKey.space): const OpenIntent(),
|
|
||||||
},
|
|
||||||
child: Semantics(
|
|
||||||
label: _a11yCredentialLabel(
|
|
||||||
credential.issuer, credential.name, helper.code?.value),
|
|
||||||
child: ListTile(
|
|
||||||
focusNode: _focusNode,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
|
||||||
),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (isDesktop) {
|
if (isDesktop) {
|
||||||
final now = DateTime.now().millisecondsSinceEpoch;
|
final now = DateTime.now().millisecondsSinceEpoch;
|
||||||
@ -208,6 +202,7 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
|||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
Actions.maybeInvoke(context, const CopyIntent());
|
Actions.maybeInvoke(context, const CopyIntent());
|
||||||
},
|
},
|
||||||
|
child: ListTile(
|
||||||
leading: showAvatar
|
leading: showAvatar
|
||||||
? AccountIcon(
|
? AccountIcon(
|
||||||
issuer: credential.issuer,
|
issuer: credential.issuer,
|
||||||
@ -247,9 +242,9 @@ class _AccountViewState extends ConsumerState<AccountView> {
|
|||||||
child: helper.buildCodeIcon()),
|
child: helper.buildCodeIcon()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}),
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user