flutter_login_funnel 0.1.1 copy "flutter_login_funnel: ^0.1.1" to clipboard
flutter_login_funnel: ^0.1.1 copied to clipboard

An easy to use Flutter widgets to do the UI UX of a login with nice animation transition.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_login_funnel/main.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const Scaffold(
        body: LoginScreen(),
      ),
    );
  }
}

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

  bool signInWithEmailAndPassword(String email, String password) {
    return true;
  }

  bool registerWithEmailAndPassword(
      String name, String email, String password) {
    return true;
  }

  @override
  Widget build(BuildContext context) {
    return LoginFunnel(
      loadingWidget: const CircularProgressIndicator(),
      backWidget: const Icon(Icons.arrow_back),
      onEmailValidation: (_) => _.contains('@'),
      onPasswordValidation: (_) => _.length > 3,
      onNameValidation: (_) => _.length > 3,
      onAuthSubmit: (createAccount, name, email, pwd) async {
        if (!createAccount) {
          final res = signInWithEmailAndPassword(email, pwd);
          if (!res) return false;
        }
        final res = registerWithEmailAndPassword(name, email, pwd);
        if (!res) return false;
        return true;
      },
    );
  }
}
17
likes
130
pub points
35%
popularity

Publisher

unverified uploader

An easy to use Flutter widgets to do the UI UX of a login with nice animation transition.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, tap_debouncer

More

Packages that depend on flutter_login_funnel