Skip to content

Commit

Permalink
Use icon instead of prefixIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 23, 2025
1 parent 308ac67 commit 5c88d85
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 50 deletions.
2 changes: 1 addition & 1 deletion lib/fido/views/pin_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class _FidoPinDialogState extends ConsumerState<FidoPinDialog> {
minPinLength, maxPinLength, 2, '123456')
: l10n.p_new_fido2_pin_requirements(
minPinLength, maxPinLength),
helperMaxLines: 5,
helperMaxLines: 7,
errorText: _newIsWrong ? _newPinError : null,
errorMaxLines: 3,
icon: const Icon(Symbols.pin),
Expand Down
2 changes: 1 addition & 1 deletion lib/fido/views/pin_entry_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class _PinEntryFormState extends ConsumerState<PinEntryForm> {
: '', // Prevents dialog resizing
errorText: _pinIsWrong || authBlocked ? _getErrorText() : null,
errorMaxLines: 3,
prefixIcon: const Icon(Symbols.pin),
icon: const Icon(Symbols.pin),
suffixIcon: IconButton(
icon: Icon(
_isObscure ? Symbols.visibility : Symbols.visibility_off),
Expand Down
7 changes: 2 additions & 5 deletions lib/oath/views/rename_account_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ class _RenameAccountDialogState extends ConsumerState<RenameAccountDialog> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(l10n.q_rename_target(widget.issuer != null
? '${widget.issuer} (${widget.name})'
: widget.name)),
Text(l10n.p_rename_will_change_account_displayed),
AppTextField(
controller: _issuerController,
Expand All @@ -197,7 +194,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameAccountDialog> {
border: const OutlineInputBorder(),
labelText: l10n.s_issuer_optional,
helperText: '', // Prevents dialog resizing when disabled
prefixIcon: const Icon(Symbols.business),
icon: const Icon(Symbols.business),
),
textInputAction: TextInputAction.next,
focusNode: _issuerFocus,
Expand All @@ -221,7 +218,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameAccountDialog> {
: !isUnique
? l10n.l_name_already_exists
: null,
prefixIcon: const Icon(Symbols.people_alt),
icon: const Icon(Symbols.people_alt),
),
textInputAction: TextInputAction.done,
focusNode: _nameFocus,
Expand Down
90 changes: 47 additions & 43 deletions lib/oath/views/unlock_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _UnlockFormState extends ConsumerState<UnlockForm> {
labelText: l10n.s_password,
errorText: _passwordIsWrong ? l10n.s_wrong_password : null,
helperText: '', // Prevents resizing when errorText shown
prefixIcon: const Icon(Symbols.password),
icon: const Icon(Symbols.password),
suffixIcon: IconButton(
icon: Icon(_isObscure
? Symbols.visibility
Expand All @@ -132,48 +132,52 @@ class _UnlockFormState extends ConsumerState<UnlockForm> {
).init(),
),
const SizedBox(height: 3.0),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Wrap(
alignment: WrapAlignment.spaceBetween,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 4.0,
runSpacing: 8.0,
children: [
keystoreFailed
? Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 4.0,
runSpacing: 8.0,
children: [
Icon(Symbols.warning_amber,
color:
Theme.of(context).colorScheme.tertiary),
Text(l10n.l_keystore_unavailable)
],
)
: FilterChip(
label: Text(l10n.s_remember_password),
selected: _remember,
onSelected: (value) {
setState(() {
_remember = value;
});
},
),
FilledButton.icon(
key: keys.unlockButton,
label: Text(l10n.s_unlock),
icon: const Icon(Symbols.lock_open),
onPressed: _passwordController.text.isNotEmpty &&
!_passwordIsWrong
? _submit
: null,
),
],
),
],
Padding(
padding: const EdgeInsets.only(left: 40),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Wrap(
alignment: WrapAlignment.spaceBetween,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 4.0,
runSpacing: 8.0,
children: [
keystoreFailed
? Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 4.0,
runSpacing: 8.0,
children: [
Icon(Symbols.warning_amber,
color: Theme.of(context)
.colorScheme
.tertiary),
Text(l10n.l_keystore_unavailable)
],
)
: FilterChip(
label: Text(l10n.s_remember_password),
selected: _remember,
onSelected: (value) {
setState(() {
_remember = value;
});
},
),
FilledButton.icon(
key: keys.unlockButton,
label: Text(l10n.s_unlock),
icon: const Icon(Symbols.lock_open),
onPressed: _passwordController.text.isNotEmpty &&
!_passwordIsWrong
? _submit
: null,
),
],
),
],
),
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/piv/views/manage_pin_puk_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
? l10n.s_puk
: l10n.s_pin,
newMinPinLen),
helperMaxLines: 5,
labelText: widget.target == ManageTarget.puk
? l10n.s_new_puk
: l10n.s_new_pin,
Expand Down

0 comments on commit 5c88d85

Please sign in to comment.