Skip to main content

password_strength_checker 2.0.0 copy "password_strength_checker: ^2.0.0" to clipboard
password_strength_checker: ^2.0.0 copied to clipboard

Animated password strength bar, form validation with a minimum strength, 10k leaked password check and a secure password generator.

example/password_strength_checker_example.dart

import 'package:flutter/material.dart';
import 'package:password_strength_checker/password_strength_checker.dart';

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final _strength = ValueNotifier<PasswordStrength?>(null);

  @override
  void dispose() {
    _strength.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            TextField(
              obscureText: true,
              decoration: const InputDecoration(
                border: OutlineInputBorder(),
                labelText: 'Password',
              ),
              onChanged: (value) =>
                  _strength.value = PasswordStrength.calculate(text: value),
            ),
            const SizedBox(height: 20),
            PasswordStrengthChecker(strength: _strength),
          ],
        ),
      ),
    );
  }
}
55
likes
150
points
11.9k
downloads
screenshot

Documentation

API reference

Publisher

verified publisherdariovarriale.dev

Weekly Downloads

Animated password strength bar, form validation with a minimum strength, 10k leaked password check and a secure password generator.

Repository (GitHub)
View/report issues

Topics

#password #password-strength #security #form #validation

License

MIT (license)

Dependencies

flutter

More

Packages that depend on password_strength_checker