Skip to content

Commit

Permalink
fix:secret field label and hide password by default
Browse files Browse the repository at this point in the history
  • Loading branch information
munezerobagira committed Sep 10, 2023
1 parent 6935e58 commit 817fc87
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
34 changes: 24 additions & 10 deletions lib/src/features/password/password_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ class _PasswordGeneratorScreenState extends State<PasswordGeneratorScreen>
});
}

bool _obscureText = true;
bool _hideSecret = true;
bool _hidePassword = true;

void _togglePasswordVisibility() {
setState(() {
_obscureText = !_obscureText;
_hidePassword = !_hidePassword;
});
}

void _toggleSecretVisibility() {
setState(() {
_hideSecret = !_hideSecret;
});
}

Expand All @@ -49,30 +56,37 @@ class _PasswordGeneratorScreenState extends State<PasswordGeneratorScreen>
children: [
StyledTextInput(
controller: secretController,
text: "Text",
text: "Secret",
suffixIcon: GestureDetector(
onTap: _togglePasswordVisibility,
onTap: _toggleSecretVisibility,
child: Icon(
_obscureText ? Icons.visibility : Icons.visibility_off,
_hideSecret ? Icons.visibility : Icons.visibility_off,
),
),
isPasswordField: _obscureText,
isPasswordField: _hideSecret,
),
Divider(
const Divider(
color: Colors.transparent,
),
StyledTextInput(
controller: passwordController,
text: 'Password',
suffixIcon: GestureDetector(
onTap: _togglePasswordVisibility,
child: Icon(
_hidePassword ? Icons.visibility : Icons.visibility_off,
),
),
isPasswordField: _hidePassword,
),
Divider(
const Divider(
color: Colors.transparent,
),
ElevatedButton(
onPressed: generateEncryptedPassword,
child: const Text("Generate strong password"),
),
Divider(
const Divider(
color: Colors.transparent,
),
if (encryptedPassword != "")
Expand All @@ -82,7 +96,7 @@ class _PasswordGeneratorScreenState extends State<PasswordGeneratorScreen>
'You strong password is Password:',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 16),
const SizedBox(height: 16),
Text(
encryptedPassword,
style: TextStyle(fontSize: 16),
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ dependencies:
flutter_launcher_icons:
android: 'launcher_icon'
ios: true
image_path: 'lib/assets/images/logo.png'
image_path: 'lib/assets/image/logo.png'
min_sdk_android: 21 # android min sdk min:16, default 21
web:
generate: true
image_path: 'lib/assets/images/logo.png'
image_path: 'lib/assets/image/logo.png'
background_color: '#hexcode'
theme_color: '#hexcode'
windows:
generate: true
image_path: 'lib/assets/images/logo.png'
image_path: 'lib/assets/image/logo.png'
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: 'lib/assets/images/logo.png'
image_path: 'lib/assets/image/logo.png'

dev_dependencies:
flutter_test:
Expand Down

1 comment on commit 817fc87

@vercel
Copy link

@vercel vercel bot commented on 817fc87 Sep 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

passbags – ./

passbags-git-main-sos10e.vercel.app
passbags-sos10e.vercel.app
passbags.vercel.app

Please sign in to comment.