password_generate 0.0.3 copy "password_generate: ^0.0.3" to clipboard
password_generate: ^0.0.3 copied to clipboard

A new Flutter package to help user in check password strength and help user in generate strong password and check password strength with return a message.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String password="My Password";
  String message="";
  final passwordGenerator = PasswordGenerator();
  void _generate() {

  }
  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text("Password Generator"),
      ),
      body: Center(
        child: Column(
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(
              textAlign: TextAlign.center,
              onChanged: (String val){
                password = val;
              },
            ),
            Text(
              message,
              style: Theme.of(context).textTheme.headline4,
            ),
            ElevatedButton(onPressed: (){
              setState(() {
                message = passwordGenerator.isPasswordValidWithMessage(password,8);
              });
            }, child: Text("Generate Password"))
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
2
likes
130
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter package to help user in check password strength and help user in generate strong password and check password strength with return a message.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on password_generate