SMS를 통해 일회용 비밀번호(OTP)를 전송하고 검증하는 과정을 간소화하기 위해 설계된 플러터 패키지입니다. 일반적으로 4자리인 사용자 정의 가능한 OTP 길이를 지원하며 국가 코드가 포함된 전화번호와 통합됩니다. 이 패키지는 OTP 생성, 전달, 검증을 안전하고 효율적으로 처리함으로써 사용자 인증 흐름을 간소화합니다. 두 단계 인증이 필요한 로그인, 등록 또는 계정 복구 워크플로우에 적합합니다.
사용 사례
OTP로 사용자 로그인
계정 확인
비밀번호 재설정
이중 인증
보안 온보딩
SMS 기반 인증
주요 기능
사용자 정의 가능한 OTP 길이
OTP 전송을 위한 SMS 통합
국가 코드 지원
OTP 검증을 위한 간단한 API
안전한 OTP 처리
최소 구성으로 간편한 설정
적합한 대상
OTP 인증이 필요한 모바일 앱
인증 시스템
사용자 등록 프로세스
보안 중심 애플리케이션
SMS 기반 2단계 인증을 사용하는 앱
빠른 OTP 구현을 원하는 개발자
고려 사항
외부 SMS 서비스에 의존합니다
SMS 전송 방법에 제한됨
내장된 OTP 만료 관리 없음
실패한 배송에 대한 적절한 오류 처리가 필요합니다
제3자 SMS 공급자의 신뢰성에 의존
오프라인 사용에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
flutter_otp
A Flutter package for Android and iOS for sending and verifying OTP to a Phone number.
Important message for existing Users
NEW FEATURE !!
Now you can send the message to any country code passed as a parameter to the interface (sendOtp() function)
Installing
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:flutter_otp:^0.3.2
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:flutter_otp/flutter_otp.dart';
Functions
The important functions used in the package are :
sendOtp() to send a OTP (four digit by default, but customizable):
parameter "messageText" is optional. By default the message text is "Your OTP is : XXXX". If "messageText" parameter is passed then message is sent as " XXXX".
resultChecker() which takes the OTP entered by the user as a parameter. The function returns true if OTP is matched, else false is returned.
boolresultChecker(int enteredOtp) {
...
}
NOTE: The OTP entered by user (say, through TextField widget or TextFormField widget etc) is to be passed as a parameter to this function.
Usage
To use this package in your application you need to have a sim card in your mobile.