otp_phone_verify 1.0.4 copy "otp_phone_verify: ^1.0.4" to clipboard
otp_phone_verify: ^1.0.4 copied to clipboard

A beautiful and customizable Flutter package for phone number verification using WhatsApp OTP via WhatsOTP.me service. Features multi-language support, beautiful themes, and easy integration.

OTP Phone Verify #

A beautiful and customizable Flutter package for phone number verification using WhatsApp OTP via WhatsOTP.me service.

pub package License: MIT

Screenshots #

Phone Input Screen OTP Input Screen

API Documentation #

Full API Documentation: WhatsOTP.me API Docs

Features #

  • Send OTP via WhatsApp to any phone number
  • Verify OTP codes with local verification (fast & secure)
  • Resend OTP functionality with countdown timer
  • Check account balance
  • Multiple theme presets (Default, Dark, Blue, Green, Purple)
  • Multi-language support (English, Arabic, French, Spanish)
  • RTL support for Arabic
  • Easy integration with just a few lines of code

Installation #

Add this to your pubspec.yaml:

dependencies:
  otp_phone_verify: ^1.0.3

Or from GitHub:

dependencies:
  otp_phone_verify:
    git:
      url: https://github.com/Ouknik/otp_phone_verify.git
      ref: main

Then run:

flutter pub get

Getting API Credentials #

  1. Sign up at WhatsOTP.me
  2. Go to your dashboard and get your API credentials
  3. View full API documentation: API Docs

Quick Start #

Basic Usage with Dialog #

The easiest way to implement phone verification:

import 'package:otp_phone_verify/otp_phone_verify.dart';

// Configure your credentials
final config = OtpConfig(
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
);

// Show verification dialog
final result = await OtpPhoneVerifyDialog.show(
  context: context,
  config: config,
  phoneNumber: '+1234567890',
);

if (result != null && result.verified) {
  print('Phone verified successfully!');
  print('Phone: ${result.phoneNumber}');
}

With Custom Theme #

final result = await OtpPhoneVerifyDialog.show(
  context: context,
  config: config,
  phoneNumber: '+1234567890',
  theme: OtpDialogTheme.dark(), // or .blue(), .green(), .purple()
);

With Arabic Language (RTL) #

final result = await OtpPhoneVerifyDialog.show(
  context: context,
  config: config,
  phoneNumber: '+1234567890',
  translations: OtpTranslations.arabic(),
  isRtl: true,
);

Available Themes #

Theme Description
OtpDialogTheme() Default light theme
OtpDialogTheme.dark() Dark mode theme
OtpDialogTheme.blue() Blue accent theme
OtpDialogTheme.green() Green accent theme
OtpDialogTheme.purple() Purple accent theme

Available Languages #

Language Usage
English OtpTranslations()
Arabic OtpTranslations.arabic()
French OtpTranslations.french()
Spanish OtpTranslations.spanish()

API Reference #

OtpConfig #

Parameter Type Description
apiKey String Your WhatsOTP.me API key
apiSecret String Your WhatsOTP.me API secret

OtpPhoneVerifyDialog.show() #

Parameter Type Description
context BuildContext Required - Build context
config OtpConfig Required - API configuration
phoneNumber String Required - Phone number to verify
theme OtpDialogTheme Optional - Dialog theme
translations OtpTranslations Optional - Text translations
isRtl bool Optional - RTL layout support

Security #

  • OTP codes are verified locally after being received from the server
  • API credentials are sent via secure headers
  • All communication uses HTTPS

Example App #

Check out the example directory for a complete working example.

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

Support #

For questions or support, please visit WhatsOTP.me or open an issue on GitHub.

3
likes
125
points
45
downloads
screenshot

Publisher

unverified uploader

Weekly Downloads

A beautiful and customizable Flutter package for phone number verification using WhatsApp OTP via WhatsOTP.me service. Features multi-language support, beautiful themes, and easy integration.

Homepage
Repository (GitHub)
View/report issues

Topics

#otp #phone-verification #authentication #whatsapp #sms

Documentation

Documentation
API reference

Funding

Consider supporting this project:

whatsotp.me

License

MIT (license)

Dependencies

flutter, http, pinput

More

Packages that depend on otp_phone_verify