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 & easily modifiable.

Overview

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 & easily modifiable.

Customizable Attributes

Import package:password_validated_field/src/requirement_widget.dart and following fields are modifiable:

  • inputDecoration
  • textEditingController
  • textInputAction
  • onEditComplete
  • onFieldSubmitted
  • focusNode
  • cursorColor
  • textStyle
  • activeIcon
  • inActiveIcon
  • activeRequirementColor
  • inActiveRequirementColor

πŸ‘€ Here's how it looks

Below are few samples of what the package looks like.

Import the package and use package:password_validated_field/password_validated_field.dart

πŸ’» Simple usage



class Example extends StatefulWidget {
  const Example({Key? key}) : super(key: key);

  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  // simple check
  bool _validPassword = false;

  // form key
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Password Validated Field"),
      ),
      body: Form(
        key: _formKey,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            _validPassword
                ? Text(
                    "Password Valid!",
                    style: TextStyle(fontSize: 22.0),
                  )
                : Container(),
            PasswordValidatedFields(), // password validated field from package
            ElevatedButton(
                onPressed: () {
                  if (_formKey.currentState!.validate()) {
                    setState(() {
                      _validPassword = true;
                    });
                  } else {
                    setState(() {
                      _validPassword = false;
                    });
                  }
                },
                child: Text("Check password!")),
          ],
        ),
      ),
    );
  }
}


Customized usage



class CustomizeFieldExample extends StatefulWidget {
  const CustomizeFieldExample({Key? key}) : super(key: key);

  @override
  _CustomizeFieldExampleState createState() => _CustomizeFieldExampleState();
}

class _CustomizeFieldExampleState extends State<CustomizeFieldExample> {
  // simple check
  bool _validPassword = false;

  // form key
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Customized Field"),
      ),
      body: Form(
        key: _formKey,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            _validPassword
                ? Text(
                    "Password Valid!",
                    style: TextStyle(fontSize: 22.0),
                  )
                : Container(),
            PasswordValidatedFields(
              inActiveIcon: Icons.cancel_outlined,
              activeIcon: Icons.check,
              inActiveRequirementColor: Colors.orange,
              activeRequirementColor: Colors.green,
            ), // password validated field from package
            ElevatedButton(
                onPressed: () {
                  if (_formKey.currentState!.validate()) {
                    setState(() {
                      _validPassword = true;
                    });
                  } else {
                    setState(() {
                      _validPassword = false;
                    });
                  }
                },
                child: Text("Check password!")),
          ],
        ),
      ),
    );
  }
}


More customized usage



class MoreCustomizedField extends StatefulWidget {
  const MoreCustomizedField({Key? key}) : super(key: key);

  @override
  _MoreCustomizedFieldState createState() => _MoreCustomizedFieldState();
}

class _MoreCustomizedFieldState extends State<MoreCustomizedField> {
  // simple check
  bool _validPassword = false;

  // form key
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Customized Field"),
      ),
      body: Form(
        key: _formKey,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            _validPassword
                ? Text(
                    "Password Valid!",
                    style: TextStyle(fontSize: 22.0),
                  )
                : Container(),
            PasswordValidatedFields(
              inActiveIcon: Icons.cancel,
              activeIcon: Icons.done_all,
              inputDecoration: InputDecoration(
                labelText: "Enter password",
                filled: true,
                fillColor: Colors.grey[300],
                prefixIcon: Icon(Icons.lock),
                enabledBorder: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.transparent),
                  borderRadius: BorderRadius.circular(10.0),
                ),
                focusedBorder: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.blue),
                  borderRadius: BorderRadius.circular(10.0),
                ),
                errorBorder: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.red),
                  borderRadius: BorderRadius.circular(10.0),
                ),
                focusedErrorBorder: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.red),
                  borderRadius: BorderRadius.circular(10.0),
                ),
              ),
            ), // password validated filed from package
            ElevatedButton(
                onPressed: () {
                  if (_formKey.currentState!.validate()) {
                    setState(() {
                      _validPassword = true;
                    });
                  } else {
                    setState(() {
                      _validPassword = false;
                    });
                  }
                },
                child: Text("Check password!")),
          ],
        ),
      ),
    );
  }
}

πŸ›  Modifying the package

You can easily modify the package according to your need.

Major attributes to look for:

RegExp modification

  • 1 Uppercase RegExp(r'[A-Z]')
  • 1 lowercase RegExp(r'[a-z]')
  • 1 numeric value RegExp(r'[0-9]')
  • 1 special character RegExp(r'[!@#$%^&*(),.?":{}|<>]')
  • 6 character length _pass.length >= 6

Combine RegExp that you would need to modify along with the above mentioned:

RegExp(r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{6,}$')

Complete Simple Example, here.

You might also like...

Radiao - a radio explorer app that lets you listen to several stations of various countries

Radiao - a radio explorer app that lets you listen to several stations of various countries

radiao Radiao is a radio explorer app that lets you listen to several stations of various countries. features trending stations popular stations liste

Apr 20, 2022

Caching with flutter riverpod and looking into future providers. Example to demonstrate stale while revalidate pattern.

Caching with flutter riverpod and looking into future providers. Example to demonstrate stale while revalidate pattern.

FLUTTER SWR EXAMPLE Test stale-while-revalidate pattern with riverpod. Look; query_provider package Backend calls are made with ghibli-api Tested Prov

Jun 30, 2022

ghiNote is a quick note application with a good-looking interface and simple operation.

ghi_note ghiNote is a quick note application with a good-looking interface and simple operation. Getting Started This project is a starting point for

Dec 15, 2021

This plugin lets you show a message in a simple way.

error_message This plugin lets you show a message in a simple way. Usage ErrorMessage( icon: Icon(Icons.error), title: "Error Title",

Dec 5, 2021

story_designer is created to help developers out there who are looking for implementing Instagram like stories editor.

story_designer is created to help developers out there who are looking for implementing Instagram like stories editor.

story_designer A package for creating instagram like story, you can use this package to edit images and make it story ready by adding other contents o

Nov 2, 2022

Stream Feed official Flutter SDK. Build your own feed experience using Dart and Flutter.

Stream Feed official Flutter SDK. Build your own feed experience using Dart and Flutter.

Official Flutter packages for Stream Activity Feeds The official Dart client for Stream Activity Feeds, a service for building activity feed applicati

Sep 26, 2022

Pensil Community official Flutter SDK. Build your own community experience using Dart and Flutter.

Official flutter package for Pensil The official Dart client for Pensil communities, a service for building communites applications. This library can

Oct 6, 2022

A nice clean recipe app UI using flutter.

A nice clean recipe app UI using flutter.

Recipe App - Flutter UI Watch it on YouTube Also work on both landscape and portrait mood Packages we are using: flutter_svg: link provider: link Try

Dec 17, 2022

Enhancing your WhatsApp experience.

Enhancing your WhatsApp experience.

WhishApp Enhancing your WhatsApp experience. Chat with unknown Number Status Saver Represent a name using emoji's (Coming soon) Sticker chat (Coming s

Oct 16, 2022
Owner
Muhammad Hamza
Flutter - UI/UX - Writer @Medium Find me @mhamzadev - YouTube @happyfluttering
Muhammad Hamza
Amir Khan 47 Jan 8, 2023
One Password to Rule - A Flutter Deterministic password manager.

OPTR - One Password to Rule Flutter #Hack20 - Cyberpunk Concepta Team: Leo Farias and Ianko Leite Pitch Are you ready for password freedom? Create eas

Leo Farias 43 Nov 16, 2022
πŸ› A full E-commerce app with nice UI consists of on-boarding, login, sign-up, home, product details, cart and user profile.

About (Download) ?? A full E-commerce app with nice UI consists of on-boarding, login, sign-up, home, product details, cart and user profile. ?? Scree

null 56 Nov 27, 2022
This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return as Image and share them directly as well in the form of an image.

share_files_and_screenshot_widgets This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return a

Jay Mehta 22 Dec 28, 2022
Android app that converts an URL to markdown, and lets you share it to your favorite notes app.

markdownr Android app that converts an URL to markdown, and lets you share it to your favorite notes app. I've written this app to save articles I fou

Andrea Ghensi 41 Dec 10, 2022
A shopping cart application that lets the user create an account, select items, save the items in the cart, pay using the payment gateway, change account details and check order history.

Shopping Cart A new Flutter application. The main code file has all the code required for the mobile application. Getting Started This project is a st

null 1 Oct 14, 2021
A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

Anikate De 3 Oct 21, 2022
Kite is the chat app with the most minimalist user experience.

Kite is the chat app with the most minimalist user experience. It's simple, easy to use and perfect for chatting with your friends in the classroom, at work or on the go.

Felipe Passos 1 Nov 19, 2021
About This is Personal Expenses Planner. You can add your expenses in to the app and manage your transaction. and you can see How much did you spend on which day. I developed this project using flutter.

expense_planner A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Darshit Rudani 5 Jul 6, 2022
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 6, 2023