added show/hide password buttons
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
parent
f5b912b16f
commit
1cc3e6baf0
@ -347,7 +347,7 @@ Future<String?> promptPassword() async {
|
||||
obscuringCharacter: '*',
|
||||
onChanged: (value) => password = value,
|
||||
),
|
||||
title: const Text('Enter Authentication Password'),
|
||||
title: const Text('Enter Repertory Portal Password'),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -161,9 +161,13 @@ void createPasswordSetting(
|
||||
onPressed: (_) {
|
||||
String updatedValue1 = value;
|
||||
String updatedValue2 = value;
|
||||
bool hidePassword1 = true;
|
||||
bool hidePassword2 = true;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return StatefulBuilder(
|
||||
builder: (context, setDialogState) {
|
||||
return AlertDialog(
|
||||
actions: [
|
||||
TextButton(
|
||||
@ -200,21 +204,59 @@ void createPasswordSetting(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TextField(
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
controller: TextEditingController(text: updatedValue1),
|
||||
obscureText: true,
|
||||
controller: TextEditingController(
|
||||
text: updatedValue1,
|
||||
),
|
||||
obscureText: hidePassword1,
|
||||
obscuringCharacter: '*',
|
||||
onChanged: (value) => updatedValue1 = value,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => setDialogState(
|
||||
() => hidePassword1 = !hidePassword1,
|
||||
),
|
||||
icon: Icon(
|
||||
hidePassword1
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: constants.padding),
|
||||
TextField(
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: false,
|
||||
controller: TextEditingController(text: updatedValue2),
|
||||
obscureText: true,
|
||||
controller: TextEditingController(
|
||||
text: updatedValue2,
|
||||
),
|
||||
obscureText: hidePassword2,
|
||||
obscuringCharacter: '*',
|
||||
onChanged: (value) => updatedValue2 = value,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => setDialogState(
|
||||
() => hidePassword2 = !hidePassword2,
|
||||
),
|
||||
icon: Icon(
|
||||
hidePassword2
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
title: createSettingTitle(context, key, description),
|
||||
@ -222,6 +264,8 @@ void createPasswordSetting(
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user