otp_resend_timer 1.0.0 copy "otp_resend_timer: ^1.0.0" to clipboard
otp_resend_timer: ^1.0.0 copied to clipboard

Flutter widget that handle OTP resend functionality with customizable UI, animations, and callback support.

๐Ÿ”ฅ OTP Resend Timer ๐Ÿ”ฅ #

Pub Version License: MIT

Preview #

ScreenRecording2025-03-10at2 15 20AM-ezgif com-video-to-gif-converter

โœจ Super Flexible OTP Resend Timer for Flutter! #

Tired of building OTP verification screens from scratch? Say goodbye to that frustration! OTP Resend Timer is here to make your life easier! ๐Ÿš€

OTP Resend Timer Demo

๐ŸŒŸ Features #

  • โฑ๏ธ Flexible Timer - Fully customizable countdown timer
  • ๐ŸŽฎ Full Control - Start and reset functionality with dedicated UI controls
  • ๐ŸŽจ Beautiful UI - Customizable styles and animations
  • โœจ Smooth Animations - Elegant transitions between timer states
  • ๐Ÿงฉ Easy Integration - Simple to implement in your Flutter apps
  • ๐Ÿงช Well Tested - Comprehensive test coverage for reliability

๐Ÿ“ฆ Installation #

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

dependencies:
  otp_resend_timer: ^1.0.0
copied to clipboard

Then run:

flutter pub get
copied to clipboard

๐Ÿš€ Usage #

Using OTP Resend Timer is super simple! Just import the package and add the widget to your build method:

import 'package:otp_resend_timer/otp_resend_timer.dart';

// Create a controller
final controller = OtpResendTimerController(initialTime: 30);

// Add the widget to your UI
OtpResendTimer(
  controller: controller,
  autoStart: true,
  timerMessage: "Resend OTP in ",
  readyMessage: "You can now resend the code",
  onFinish: () {},
  onResendClicked: () {},
  onStart: () {}
)
copied to clipboard

๐ŸŽฎ Controller Features #

The OtpResendTimerController gives you full control over the timer:

// Start the timer
controller.start();

// restart the timer
controller.reset();

// Always dispose when done
@override
void dispose() {
  controller.dispose();
  super.dispose();
}
copied to clipboard

๐ŸŽจ Customization #

Make it your own! The OTP Resend Timer is fully customizable:

OtpResendTimer(
controller: controller,
// Messages
timerMessage: "Resend in",
readyMessage: "Ready to resend!",
// would never show in case autoplay is true
holdMessage: "Timer paused",
resendMessage: "RESEND",

// Styles
timerMessageStyle: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
readyMessageStyle: TextStyle(color: Colors.green),
holdMessageStyle: TextStyle(color: Colors.orange),
resendMessageStyle: TextStyle(color: Colors.purple, decoration: TextDecoration.underline),
resendMessageDisabledStyle: TextStyle(color: Colors.grey),

// Callbacks
onStart: () => print("Timer started"),
onFinish: () => print("Timer finished"),
onResendClicked: () => print("Resend clicked"),

// Auto-start the timer
autoStart: true,
)
copied to clipboard

๐Ÿ“ฑ Examples #

Check out the example folder for a complete working example:

โค๏ธ Contributing #

Contributions are always welcome! Please feel free to submit a PR.

๐Ÿ“„ License #

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

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Author #

Emad Beltaje #

๐Ÿงก Support #

Don't forget to like the package ๐Ÿ‘๐Ÿป and star the repo โญ๏ธ

8
likes
150
points
113
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.15 - 2025.03.30

Flutter widget that handle OTP resend functionality with customizable UI, animations, and callback support.

Repository (GitHub)
View/report issues

Topics

#flutter #dart #otp #animation #resend

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on otp_resend_timer