mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 10:11:52 +03:00
improved fingerprint views
This commit is contained in:
parent
742d5d79b9
commit
6a22c23ece
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Yubico.
|
||||
* Copyright (C) 2022-2024 Yubico.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -255,7 +255,11 @@ class _AddFingerprintDialogState extends ConsumerState<AddFingerprintDialog>
|
||||
});
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
_submit();
|
||||
if (_label.isNotEmpty) {
|
||||
_submit();
|
||||
} else {
|
||||
_nameFocus.requestFocus();
|
||||
}
|
||||
},
|
||||
).init(),
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Yubico.
|
||||
* Copyright (C) 2022-2024 Yubico.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -41,12 +41,20 @@ class RenameFingerprintDialog extends ConsumerStatefulWidget {
|
||||
|
||||
class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
late String _label;
|
||||
late FocusNode _labelFocus;
|
||||
_RenameAccountDialogState();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_label = widget.fingerprint.name ?? '';
|
||||
_labelFocus = FocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_labelFocus.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
_submit() async {
|
||||
@ -94,6 +102,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
Text(l10n.p_will_change_label_fp),
|
||||
AppTextFormField(
|
||||
initialValue: _label,
|
||||
focusNode: _labelFocus,
|
||||
maxLength: 15,
|
||||
inputFormatters: [limitBytesLength(15)],
|
||||
buildCounter: buildByteCounterFor(_label),
|
||||
@ -110,6 +119,8 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
|
||||
onFieldSubmitted: (_) {
|
||||
if (_label.isNotEmpty) {
|
||||
_submit();
|
||||
} else {
|
||||
_labelFocus.requestFocus();
|
||||
}
|
||||
},
|
||||
).init(),
|
||||
|
Loading…
Reference in New Issue
Block a user