v1.1.1otp_timer_button
इस पैकेज का उपयोग ओटीपी टाइमर बटन को आसानी से लागू करने के लिए किया जाता है, जो निर्दिष्ट समय के बाद सक्षम होगा।
39लाइक 79630-दिन डाउनलोड150Pub अंक
AndroidiOSWebmacOSWindowsLinux
यह OTP टाइमर बटन के आसान कार्यान्वयन के लिए एक Flutter पैकेज है।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This is a Flutter package for easy implementation otp timer button.

Add the following to your pubspec.yaml file:
dependencies:
otp_timer_button: ^1.1.1
import 'package:otp_timer_button/otp_timer_button.dart';
OtpTimerButtonController controller = OtpTimerButtonController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: OtpTimerButton(
controller: controller,
onPressed: () {},
text: Text('Resend OTP'),
duration: 60,
),
),
);
}
If you want to wait for the response to the OTP request, you can use the controller:
NOTE: if use controller, auto start timer is disabled on pressed button.
OtpTimerButtonController controller = OtpTimerButtonController();
_requestOtp() {
controller.loading();
Future.delayed(Duration(seconds: 2), () {
controller.startTimer();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: OtpTimerButton(
controller: controller,
onPressed: () => _requestOtp(),
text: Text('Resend OTP'),
duration: 2,
),
),
);
}

controller.startTimer();
controller.loading();
controller.enableButton();
OtpTimerButton(
controller: controller,
height: 60,
text: Text(
'Resend OTP',
),
duration: 60,
radius: 30,
backgroundColor: Colors.blue,
textColor: Colors.white,
buttonType: ButtonType.text_button, // or ButtonType.outlined_button
loadingIndicator: CircularProgressIndicator(
strokeWidth: 2,
color: Colors.red,
),
loadingIndicatorColor: Colors.red,
onPressed: () {},
),
निर्भरता सूची 2 आइटम
{"sdk":"flutter"}{"sdk":"flutter"}उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗