Android: Better keyboard "done" actions.

This commit is contained in:
Dain Nilsson 2022-08-12 09:54:47 +02:00
parent 112bc1ee08
commit f2cb9de037
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 8 additions and 0 deletions

View File

@ -222,6 +222,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
helperText: '', // Prevents dialog resizing when enabled = false
prefixIcon: Icon(Icons.business_outlined),
),
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
// Update maxlengths
@ -243,6 +244,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
helperText: '', // Prevents dialog resizing when enabled = false
prefixIcon: Icon(Icons.person_outline),
),
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
// Update maxlengths
@ -277,6 +279,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage> {
? 'Invalid length'
: null),
readOnly: _qrState == _QrScanState.success,
textInputAction: TextInputAction.done,
onChanged: (value) {
setState(() {
_validateSecretLength = false;

View File

@ -67,6 +67,7 @@ class _ManagePasswordDialogState extends ConsumerState<ManagePasswordDialog> {
prefixIcon: const Icon(Icons.password_outlined),
errorText: _currentIsWrong ? 'Wrong password' : null,
errorMaxLines: 3),
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
_currentIsWrong = false;
@ -123,6 +124,7 @@ class _ManagePasswordDialogState extends ConsumerState<ManagePasswordDialog> {
prefixIcon: const Icon(Icons.password_outlined),
enabled: !widget.state.hasKey || _currentPassword.isNotEmpty,
),
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
_newPassword = value;
@ -143,6 +145,7 @@ class _ManagePasswordDialogState extends ConsumerState<ManagePasswordDialog> {
enabled: (!widget.state.hasKey || _currentPassword.isNotEmpty) &&
_newPassword.isNotEmpty,
),
textInputAction: TextInputAction.done,
onChanged: (value) {
setState(() {
_confirmPassword = value;

View File

@ -109,6 +109,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameAccountDialog> {
helperText: '', // Prevents dialog resizing when enabled = false
prefixIcon: Icon(Icons.business_outlined),
),
textInputAction: TextInputAction.next,
onChanged: (value) {
setState(() {
_issuer = value.trim();
@ -127,6 +128,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameAccountDialog> {
errorText: isValid ? null : 'Your account must have a name',
prefixIcon: const Icon(Icons.people_alt_outlined),
),
textInputAction: TextInputAction.done,
onChanged: (value) {
setState(() {
_account = value.trim();