email_auth 0.0.1+2
email_auth: ^0.0.1+2 copied to clipboard

Flutter Android iOS Linux macOS web Windows

A Flutter package to verify emails using OTP based method, to make sure we get real world data.

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{
    ///Accessing the EmailAuth class from the package
       EmailAuth.sessionName = "Sample";
    ///a boolean value will be returned if the OTP is sent successfully
    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,
            ),
          ],
        ),
      ),
      ...

Reference #

PropertyTypeDesciption
EmailAuthclassThe main wrapper class for all the methods and variables
EmailAuth.sessionNameCallbackCall this method to set the CompanyName / Org Name => "sessionName"
EmailAuth.sendOtp(receiverMail : "")boolean functionTakes the Email ID and sends OTP returns a boolean
EmailAuth.validate(receiverMail : "", userOTP: "")boolean functionVerifies if the provided OTP and mail ID are correct and returns a boolean
receiverMailStringTakes in the user entered Email ID
userOTPStringTakes in the user entered OTP that was sent through mail

Privacy Policy #

We never share the email ID's we get to any service, nor do we use them for our purposes, we regularly clean up the sent mail section, and we never save any data on our servers, we work on the main motive to be OPEN SOURCE , If so you have any queries kindly mail me at the email ID provided Always happy to answer :)

Thankyou ❤️ #

21
likes
110
pub points
71%
popularity

A Flutter package to verify emails using OTP based method, to make sure we get real world data.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

saransurya199@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, http

More

Packages that depend on email_auth