FLUTTER ECOSYSTEM

oohyugi/sms_otp_auto_verify

oohyugi/sms_otp_auto_verify open-source repository details.

sms_otp_auto_verify 프로젝트 이미지
Stars
10
Forks
41
최근 푸시(UTC)
2024. 8. 28.
프로젝트 상태
활성
Yogi Putra GitHub avatar
GITHUB User

Yogi Putra ↗

언어KotlinDartRubySwiftObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

sms_otp_auto_verify

A new Flutter plugin to enter a digit code usually in cases of Sms Otp Code. and provide SMS Auto Fill using library SMS Retriever API.

Example App

Getting Started

Import package
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
Get Signature Code
String? signature = await SmsVerification.getAppSignature();
Add Widget

codeLength must equals with Sms OTP Code length

TextFieldPin(
    textController: textEditingController,
    autoFocus: true,
    codeLength: _otpCodeLength,
    alignment: MainAxisAlignment.center,
    defaultBoxSize: 46.0,
    margin: 10,
    selectedBoxSize: 46.0,
    textStyle: TextStyle(fontSize: 16),
    defaultDecoration: _pinPutDecoration.copyWith(
    border: Border.all(
    color: Theme.of(context)
    .primaryColor
        .withOpacity(0.6))),
    selectedDecoration: _pinPutDecoration,
    onChange: (code) {
    _onOtpCallBack(code,false);
}),
Listen result from OtpListTextField
_onOtpCallBack(String otpCode, bool isAutofill) {
    setState(() {
      this._otpCode = otpCode;
      if (otpCode.length == _otpCodeLength && isAutofill) {
        _enableButton = false;
        _isLoadingButton = true;
        _verifyOtpCode();
      } else if (otpCode.length == _otpCodeLength && !isAutofill) {
        _enableButton = true;
        _isLoadingButton = false;
      }else{
        _enableButton = false;
      }
    });
  }
Example Sms
<#> ExampleApp: Your code is 5664
   r64Iw/6mD1D