email_auth 0.0.1+1 copy "email_auth: ^0.0.1+1" to clipboard
email_auth: ^0.0.1+1 copied to clipboard

outdated

A Flutter package to verify emails using OTP, the service will help you verify the emails provided to you are valid and genuine ones, so we don't get random data stored in our Databases, and also prev [...]

Email verification for Flutter Apps using DART. #

Key points :
  • This package allows developers to verify that the provided Email is valid and also an existing one,
  • We confirmit by sending an OTP to the specified email ID and verify them.

Features! #

  • It has Email ID by default, just call the function and voila...
  • Verifying an email again call a function and that's it..

Next Plans #

  • Making the availablity of custom Email Ids.
  • Supporting different formats.

Usage #

import 'package:email_auth/email_auth.dart';
...
Inside your stateLess / Statefull widget class
  ...
  final TextEditingController _emailController = TextEditingController();
  final TextEditingController _otpController = TextEditingController();
  //create a method to send the Emails
  void sendOtp()async{
       EmailAuth.sessionName = "Sample";
    var data =
        await EmailAuth.sendOtp(recieverMail: _emailController.value.text);
    if(!data){
        //have your error handling logic here, like a snackbar or popup widget
    }
  }
  //create a bool method to validate if the OTP is true
  bool verify(){
    return(EmailAuth.validate(
        recieverMail: _emailController.value.text, //to make sure the email ID is not changed
        userOTP: _otpController.value.text)); //pass in the OTP typed in
    //This will return you a bool, and you can proceed further after that, add a fail case and a success case (result will be true/false)
  }
  ...
   Widget build(BuildContext context) {
   // have your controllers assigned to textFields or textFormFields
   ...
    body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(
              controller: _emailController,
            ),
            TextField(
              controller: _otpController,
            ),
          ],
        ),
      ),
      ...

Thankyou ❤️ #

159
likes
0
pub points
94%
popularity

Publisher

unverified uploader

A Flutter package to verify emails using OTP, the service will help you verify the emails provided to you are valid and genuine ones, so we don't get random data stored in our Databases, and also prevent misusing our app.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http

More

Packages that depend on email_auth