mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-02 07:03:06 +03:00
Merge PR #92.
This commit is contained in:
commit
20ce8c0811
@ -26,7 +26,7 @@ class AboutPage extends ConsumerWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// TODO: Store the version number elsewhere
|
||||
const Text('Yubico Authenticator: 6.0.0-alpha.1'),
|
||||
const Text('Yubico Authenticator: 6.0.0-alpha.2'),
|
||||
if (isDesktop)
|
||||
Text('ykman version: ${ref.watch(rpcStateProvider).version}'),
|
||||
Text('Dart version: ${Platform.version}'),
|
||||
|
@ -70,7 +70,7 @@ class FidoLockedPage extends ConsumerWidget {
|
||||
},
|
||||
),
|
||||
MenuAction(
|
||||
text: 'Delete all data',
|
||||
text: 'Reset FIDO',
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
action: (context) {
|
||||
showDialog(
|
||||
|
@ -29,6 +29,14 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
_label = widget.fingerprint.name ?? '';
|
||||
}
|
||||
|
||||
_submit() async {
|
||||
final renamed = await ref
|
||||
.read(fingerprintProvider(widget.devicePath).notifier)
|
||||
.renameFingerprint(widget.fingerprint, _label);
|
||||
Navigator.of(context).pop(renamed);
|
||||
showMessage(context, 'Fingerprint renamed');
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// If current device changes, we need to pop back to the main Page.
|
||||
@ -36,14 +44,12 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
|
||||
final fingerprint = widget.fingerprint;
|
||||
|
||||
return ResponsiveDialog(
|
||||
title: const Text('Rename fingerprint'),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Rename ${fingerprint.label}?'),
|
||||
Text('Rename ${widget.fingerprint.label}?'),
|
||||
const Text('This will change the label of the fingerprint.'),
|
||||
TextFormField(
|
||||
initialValue: _label,
|
||||
@ -57,6 +63,11 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
_label = value.trim();
|
||||
});
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
if (_label.isNotEmpty) {
|
||||
_submit();
|
||||
}
|
||||
},
|
||||
),
|
||||
]
|
||||
.map((e) => Padding(
|
||||
@ -67,15 +78,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: _label.isNotEmpty
|
||||
? () async {
|
||||
final renamed = await ref
|
||||
.read(fingerprintProvider(widget.devicePath).notifier)
|
||||
.renameFingerprint(fingerprint, _label);
|
||||
Navigator.of(context).pop(renamed);
|
||||
showMessage(context, 'Fingerprint renamed');
|
||||
}
|
||||
: null,
|
||||
onPressed: _label.isNotEmpty ? _submit : null,
|
||||
child: const Text('Save'),
|
||||
),
|
||||
],
|
||||
|
@ -71,10 +71,10 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
|
||||
children: [
|
||||
Text(subtitle ?? ''),
|
||||
const SizedBox(height: 8.0),
|
||||
Center(child: buildCodeView(ref, big: true)),
|
||||
Center(child: FittedBox(child: buildCodeView(ref, big: true))),
|
||||
],
|
||||
),
|
||||
actions: _buildActions(context, ref),
|
||||
actions: [FittedBox(child: Row(children: _buildActions(context, ref)))],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ class _UnlockedView extends ConsumerWidget {
|
||||
},
|
||||
),
|
||||
MenuAction(
|
||||
text: 'Delete all data',
|
||||
text: 'Reset OATH',
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
action: (context) {
|
||||
showDialog(
|
||||
|
Loading…
Reference in New Issue
Block a user