How to do Phone Authentication in Flutter using Firebase?

前端 未结 6 1657
刺人心
刺人心 2021-02-02 02:27

I have searched many websites and I didn\'t find a way to implement phone authentication in Flutter using Firebase. Can anyone tell me how to this?

6条回答
  •  爱一瞬间的悲伤
    2021-02-02 03:15

    Use the flutter_otp package to send SMS with OTP easily. The advantages are:

    1. You can send custom OTP messages.
    2. OTP can be generated in any range.

    Example of using it :

     import 'package:flutter_otp/flutter_otp.dart';
    
     ...
    
     FlutterOtp myOtpObj = FlutterOtp();
     myOtpObj.sendOtp('7975235555');
    
     ...
    
     // you can check as follows
     bool correctOrNot = myOtpObj.resultChecker();
    

    Check out the flutter_otp repository here

提交回复
热议问题