A package facilitating the basic ingredients for creating functional yet customizable login pages
Find a file
2023-03-07 11:20:33 +01:00
.github/workflows Updated README, added GIF, added Github Actions, fixed overflow bug when opening a keyboard on mobile devices. 2022-11-25 11:41:44 +01:00
example feat: mfa_widget 2023-03-07 10:37:07 +01:00
lib feat: mfa 2023-03-07 11:20:33 +01:00
.flutter-plugins feat: mfa_widget 2023-03-07 10:37:07 +01:00
.flutter-plugins-dependencies feat: mfa_widget 2023-03-07 10:37:07 +01:00
.gitignore feat: expanded translations 2022-11-04 09:23:48 +01:00
.metadata refactor login to be a minimal component 2022-09-27 16:48:52 +02:00
analysis_options.yaml refactor login to be a minimal component 2022-09-27 16:48:52 +02:00
CHANGELOG.md feat: add textstyle for fields 2023-02-13 14:57:57 +01:00
flutter_login.gif Updated README, added GIF, added Github Actions, fixed overflow bug when opening a keyboard on mobile devices. 2022-11-25 11:41:44 +01:00
LICENSE Add BSD-3-Clause license 2022-10-31 17:13:54 +01:00
pubspec.yaml feat: mfa_widget 2023-03-07 10:37:07 +01:00
README.md Updated README, added GIF, added Github Actions, fixed overflow bug when opening a keyboard on mobile devices. 2022-11-25 11:41:44 +01:00

pub package Build status style: effective dart

Login Widget

A package facilitating the basic ingredients for creating functional yet customizable login pages

Login GIF

Setup

To use this package, add flutter_login_widget as a dependency in your pubspec.yaml file.

How to use

final loginOptions = LoginOptions(
  decoration: const InputDecoration(
    border: OutlineInputBorder(),
  ),
  emailInputPrefix: const Icon(Icons.email),
  passwordInputPrefix: const Icon(Icons.password),
  title: const Text('Login'),
  image: const FlutterLogo(),
  requestForgotPasswordButtonBuilder: (context, onPressed, isDisabled) {
    return Opacity(
      opacity: isDisabled ? 0.5 : 1.0,
      child: ElevatedButton(
        onPressed: onPressed,
        child: const Text('Send request'),
      ),
    );
  },
);

class LoginExample extends StatelessWidget {
  const LoginExample({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark(),
      home: LoginScreen(),
    );
  }
}

class LoginScreen extends StatelessWidget {
  const LoginScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: EmailPasswordLoginForm(
        options: loginOptions,
        onLogin: (email, password) => print('$email:$password'),
        onRegister: (email, password) => print('Register!'),
        onForgotPassword: (email) {
          Navigator.of(context).push(
            MaterialPageRoute(
              builder: (context) {
                return const ForgotPasswordScreen();
              },
            ),
          );
        },
      ),
    );
  }
}

class ForgotPasswordScreen extends StatelessWidget {
  const ForgotPasswordScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ForgotPasswordForm(
        options: loginOptions,
        title: Text('Forgot password'),
        description: Text('Hello world'),
        onRequestForgotPassword: (email) {
          print('Forgot password email sent to $email');
        },
      ),
    );
  }
}

See the Example Code for an example on how to use this package.

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page. Commercial support is available if you need help with integration with your app or services. You can contact us at support@iconica.nl.

Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Author

This flutter_login_widget for Flutter is developed by Iconica. You can contact us at support@iconica.nl