{"id":18011317,"url":"https://github.com/mhmzdev/password_validated_field","last_synced_at":"2025-03-26T15:32:43.201Z","repository":{"id":56836551,"uuid":"374464066","full_name":"mhmzdev/password_validated_field","owner":"mhmzdev","description":"A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully \u0026 easily modifiable.","archived":false,"fork":false,"pushed_at":"2021-06-07T13:45:38.000Z","size":12,"stargazers_count":28,"open_issues_count":4,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T02:02:40.936Z","etag":null,"topics":["dart","dart-package","flutter","pub-dev"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/password_validated_field","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhmzdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-06T21:08:14.000Z","updated_at":"2024-05-07T15:18:55.000Z","dependencies_parsed_at":"2022-08-28T21:11:12.291Z","dependency_job_id":null,"html_url":"https://github.com/mhmzdev/password_validated_field","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fpassword_validated_field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fpassword_validated_field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fpassword_validated_field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhmzdev%2Fpassword_validated_field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhmzdev","download_url":"https://codeload.github.com/mhmzdev/password_validated_field/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681558,"owners_count":20655219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-package","flutter","pub-dev"],"created_at":"2024-10-30T03:09:22.299Z","updated_at":"2025-03-26T15:32:42.903Z","avatar_url":"https://github.com/mhmzdev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"A package that lets you include a cool, nice looking and validated `Password TextFormField` in your app to enhance user experience. The package is **fully \u0026 easily modifiable**.\n\n## Customizable Attributes\n\nImport `package:password_validated_field/src/requirement_widget.dart` and following fields are modifiable:\n- `inputDecoration`\n- `textEditingController`\n- `textInputAction`\n- `onEditComplete`\n- `onFieldSubmitted`\n- `focusNode`\n- `cursorColor`\n- `textStyle`\n- `activeIcon`\n- `inActiveIcon`\n- `activeRequirementColor`\n- `inActiveRequirementColor`\n\n## 👀 Here's how it looks\nBelow are few samples of what the package looks like.\n\n**Import** the package and use `package:password_validated_field/password_validated_field.dart`\n\n## 💻 Simple usage\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43790152/121000165-5683b180-c7a3-11eb-8a8f-5524dfa63291.gif\" /\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```dart\nclass Example extends StatefulWidget {\n  const Example({Key? key}) : super(key: key);\n\n  @override\n  _ExampleState createState() =\u003e _ExampleState();\n}\n\nclass _ExampleState extends State\u003cExample\u003e {\n  // simple check\n  bool _validPassword = false;\n\n  // form key\n  final _formKey = GlobalKey\u003cFormState\u003e();\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Password Validated Field\"),\n      ),\n      body: Form(\n        key: _formKey,\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: [\n            _validPassword\n                ? Text(\n                    \"Password Valid!\",\n                    style: TextStyle(fontSize: 22.0),\n                  )\n                : Container(),\n            PasswordValidatedFields(), // password validated field from package\n            ElevatedButton(\n                onPressed: () {\n                  if (_formKey.currentState!.validate()) {\n                    setState(() {\n                      _validPassword = true;\n                    });\n                  } else {\n                    setState(() {\n                      _validPassword = false;\n                    });\n                  }\n                },\n                child: Text(\"Check password!\")),\n          ],\n        ),\n      ),\n    );\n  }\n}\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Customized usage\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43790152/121000355-8e8af480-c7a3-11eb-8763-7ddf64fd48f2.gif\" /\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```dart\nclass CustomizeFieldExample extends StatefulWidget {\n  const CustomizeFieldExample({Key? key}) : super(key: key);\n\n  @override\n  _CustomizeFieldExampleState createState() =\u003e _CustomizeFieldExampleState();\n}\n\nclass _CustomizeFieldExampleState extends State\u003cCustomizeFieldExample\u003e {\n  // simple check\n  bool _validPassword = false;\n\n  // form key\n  final _formKey = GlobalKey\u003cFormState\u003e();\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Customized Field\"),\n      ),\n      body: Form(\n        key: _formKey,\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: [\n            _validPassword\n                ? Text(\n                    \"Password Valid!\",\n                    style: TextStyle(fontSize: 22.0),\n                  )\n                : Container(),\n            PasswordValidatedFields(\n              inActiveIcon: Icons.cancel_outlined,\n              activeIcon: Icons.check,\n              inActiveRequirementColor: Colors.orange,\n              activeRequirementColor: Colors.green,\n            ), // password validated field from package\n            ElevatedButton(\n                onPressed: () {\n                  if (_formKey.currentState!.validate()) {\n                    setState(() {\n                      _validPassword = true;\n                    });\n                  } else {\n                    setState(() {\n                      _validPassword = false;\n                    });\n                  }\n                },\n                child: Text(\"Check password!\")),\n          ],\n        ),\n      ),\n    );\n  }\n}\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## More customized usage\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43790152/121000349-8cc13100-c7a3-11eb-865c-9b84c54f73a5.gif\" /\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```dart\nclass MoreCustomizedField extends StatefulWidget {\n  const MoreCustomizedField({Key? key}) : super(key: key);\n\n  @override\n  _MoreCustomizedFieldState createState() =\u003e _MoreCustomizedFieldState();\n}\n\nclass _MoreCustomizedFieldState extends State\u003cMoreCustomizedField\u003e {\n  // simple check\n  bool _validPassword = false;\n\n  // form key\n  final _formKey = GlobalKey\u003cFormState\u003e();\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Customized Field\"),\n      ),\n      body: Form(\n        key: _formKey,\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: [\n            _validPassword\n                ? Text(\n                    \"Password Valid!\",\n                    style: TextStyle(fontSize: 22.0),\n                  )\n                : Container(),\n            PasswordValidatedFields(\n              inActiveIcon: Icons.cancel,\n              activeIcon: Icons.done_all,\n              inputDecoration: InputDecoration(\n                labelText: \"Enter password\",\n                filled: true,\n                fillColor: Colors.grey[300],\n                prefixIcon: Icon(Icons.lock),\n                enabledBorder: OutlineInputBorder(\n                  borderSide: BorderSide(color: Colors.transparent),\n                  borderRadius: BorderRadius.circular(10.0),\n                ),\n                focusedBorder: OutlineInputBorder(\n                  borderSide: BorderSide(color: Colors.blue),\n                  borderRadius: BorderRadius.circular(10.0),\n                ),\n                errorBorder: OutlineInputBorder(\n                  borderSide: BorderSide(color: Colors.red),\n                  borderRadius: BorderRadius.circular(10.0),\n                ),\n                focusedErrorBorder: OutlineInputBorder(\n                  borderSide: BorderSide(color: Colors.red),\n                  borderRadius: BorderRadius.circular(10.0),\n                ),\n              ),\n            ), // password validated filed from package\n            ElevatedButton(\n                onPressed: () {\n                  if (_formKey.currentState!.validate()) {\n                    setState(() {\n                      _validPassword = true;\n                    });\n                  } else {\n                    setState(() {\n                      _validPassword = false;\n                    });\n                  }\n                },\n                child: Text(\"Check password!\")),\n          ],\n        ),\n      ),\n    );\n  }\n}\n```\n\n## 🛠 Modifying the package\n\nYou can easily modify the package according to your need.\n\nMajor attributes to look for:\n- `RegExp` at the bottom of [validated_field](lib/src/validated_field.dart)\n- `onChange` callBack in [validated_field](lib/src/validated_field.dart)\n- `requirement_widget` in [requirement_widget](lib/src/requirement_widget.dart)\n- `requirement_widget` checks added in [validated_field](lib/src/validated_field.dart)\n\n### RegExp modification\n\n- 1 Uppercase `RegExp(r'[A-Z]')`\n- 1 lowercase `RegExp(r'[a-z]')`\n- 1 numeric value `RegExp(r'[0-9]')`\n- 1 special character `RegExp(r'[!@#$%^\u0026*(),.?\":{}|\u003c\u003e]')`\n- 6 character length `_pass.length \u003e= 6`\n\nCombine `RegExp` that you would need to modify along with the above mentioned:\n\n`RegExp(r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\\$\u0026*~]).{6,}$')`\n\nComplete Simple Example, [here.](example/example.dart)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fpassword_validated_field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmzdev%2Fpassword_validated_field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmzdev%2Fpassword_validated_field/lists"}