phone_auth_simple 1.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • new67

Phone Auth Simple

This package help you to do phone verification in just 6 lines of code. Isn't this great.

Installation

Step 1- Connect Your app with firebase.
Step 2- Enable Phone Authentication in Firebase.
Step 3-Add phone_auth_simple: in your pubspec.yaml dependencies.

How to use

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

class Test extends StatefulWidget {
  _TestState createState() => _TestState();
}

class _TestState extends State<Test> {
  @override
  Widget build(BuildContext context) {
    return PhoneAuthSimple(
      countryCode: "+91",
      phoneNumber: "9999999999",
      onVerificationSuccess: () {
        print("My Completed");
      },
      onVerificationFailure: () {
        print("My Failed");
      },
    );
  }
}

Example

lib/home.dart

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

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
    body:Center(
    child:Text("Home Page")
    )
    );
  }
}

lib/phone_number.dart

import 'package:flutter/material.dart';
import 'package:phone_auth_simple/phone_auth_simple.dart';
import './get_otp.dart';


class PhoneNumber extends StatelessWidget {

  String phoneNumber;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: <Widget>[
          TextFormField(
            onSaved: (number)=>phoneNumber=number,
          ),
          FlatButton(
            child: Text("Get OTP"),
            onPressed: (){
              Navigator.pushReplacement(
                  context, MaterialPageRoute(builder: (context) => GetOtp(phoneNumber:phoneNumber)));
            },
          )
        ],
      ),
    );
  }
}

lib/get_otp.dart

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

class GetOtp extends StatefulWidget {
  final String phoneNumber;
  GetOtp({this.phoneNumber});
  
  @override
  _GetOtpState createState() => _GetOtpState();
}

class _GetOtpState extends State<GetOtp> {
  @override
  Widget build(BuildContext context) {
    return PhoneAuthSimple(
      countryCode: "+91",
      phoneNumber: widget.phoneNumber,
      onVerificationSuccess: () {
        print("My Completed");
      },
      onVerificationFailure: () {
        print("My Failed");
      },
    );
  }
}

Params

   PhoneAuthSimple(
   @required countryCode (String) 
   @required phoneNumber (String)
   @required onVerificationSuccess (VoidCallBack)
   @required onVerificationFailure (VoidCallBack)
    appBar (Widget)
    progressIndicatorColor (Color)
  )

Screenshot

Screenshot 1 Screenshot 2

Upcoming Update

New layout will be added. More Customization will be added

[0.0.1] - Release.

Integrated Firebase_auth Package

[0.0.2] -Release.

Added UI screen

[0.04] - Release

Auto OTP code retrieve

[0.0.5] - Release

Fixed Bug

[0.0.6] - Release

Improved functionality

[0.0.8] - Release

Added custom color of progress indicator

[0.0.9] - Release

Updated Documentation

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  phone_auth_simple: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:phone_auth_simple/phone_auth_simple.dart';
  
Version Uploaded Documentation Archive
1.0.0 Dec 5, 2018 Go to the documentation of phone_auth_simple 1.0.0 Download phone_auth_simple 1.0.0 archive
0.1.1 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.1.1 Download phone_auth_simple 0.1.1 archive
0.1.0 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.1.0 Download phone_auth_simple 0.1.0 archive
0.0.9 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.9 Download phone_auth_simple 0.0.9 archive
0.0.8 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.8 Download phone_auth_simple 0.0.8 archive
0.0.7 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.7 Download phone_auth_simple 0.0.7 archive
0.0.6 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.6 Download phone_auth_simple 0.0.6 archive
0.0.5 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.5 Download phone_auth_simple 0.0.5 archive
0.0.4 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.4 Download phone_auth_simple 0.0.4 archive
0.0.2 Nov 30, 2018 Go to the documentation of phone_auth_simple 0.0.2 Download phone_auth_simple 0.0.2 archive

All 11 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
39
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs (-9.09 points)

10 out of 11 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Fix lib/phone_auth_simple.dart. (-0.50 points)

Analysis of lib/phone_auth_simple.dart reported 1 hint:

line 6 col 7: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final).

Maintenance suggestions

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use phone_auth_simple.dart. Packages with multiple examples should use example/readme.md.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
firebase_auth ^0.6.6 0.6.6
flutter 0.0.0
Transitive dependencies
collection 1.14.11
firebase_core 0.2.5+1
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test