{"id":13491360,"url":"https://github.com/JerinFrancisA/flutter_otp","last_synced_at":"2025-03-28T08:33:04.824Z","repository":{"id":54866010,"uuid":"203632510","full_name":"JerinFrancisA/flutter_otp","owner":"JerinFrancisA","description":"A Flutter package for iOS and Android for sending and verifying OTP to a Phone number.","archived":false,"fork":false,"pushed_at":"2021-01-24T06:00:52.000Z","size":58,"stargazers_count":61,"open_issues_count":7,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-01T19:37:45.091Z","etag":null,"topics":["android","app","flutter","flutter-package","otp","phone-number","sendotp"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JerinFrancisA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-21T17:26:43.000Z","updated_at":"2024-01-09T09:55:21.000Z","dependencies_parsed_at":"2022-08-14T05:10:26.650Z","dependency_job_id":null,"html_url":"https://github.com/JerinFrancisA/flutter_otp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerinFrancisA%2Fflutter_otp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerinFrancisA%2Fflutter_otp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerinFrancisA%2Fflutter_otp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JerinFrancisA%2Fflutter_otp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JerinFrancisA","download_url":"https://codeload.github.com/JerinFrancisA/flutter_otp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222364109,"owners_count":16972423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","app","flutter","flutter-package","otp","phone-number","sendotp"],"created_at":"2024-07-31T19:00:56.144Z","updated_at":"2024-10-31T05:31:09.821Z","avatar_url":"https://github.com/JerinFrancisA.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true\u0026style=flat-square)](https://github.com/Solido/awesome-flutter)\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)\n[![Known Vulnerabilities](https://snyk.io/test/github/dwyl/hapi-auth-jwt2/badge.svg?targetFile=package.json)](https://snyk.io/test/github/dwyl/hapi-auth-jwt2?targetFile=package.json)\n[![Build Status](https://travis-ci.org/dwyl/esta.svg?branch=master)](https://travis-ci.org/dwyl/esta)\n\n# flutter_otp\n\nA Flutter package for Android and iOS for sending and verifying OTP to a Phone number.\n\n### Important message for existing Users\n#### NEW FEATURE !!\n\nNow you can send the message to any country code passed as a parameter to the interface (sendOtp() function)\n\n# Installing\n## Use this package as a library\n### 1. Depend on it\nAdd this to your package's pubspec.yaml file:\n```\ndependencies:\n  flutter_otp: ^0.3.2\n```\n### 2. Install it\nYou can install packages from the command line:\nwith Flutter:\n```\n$ flutter packages get\n```\nAlternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.\n\n### 3. Import it\nNow in your Dart code, you can use:\n```\nimport 'package:flutter_otp/flutter_otp.dart';\n```\n\n# Functions\n\nThe important functions used in the package are : \n\n1. sendOtp() to send a OTP (four digit by default, but customizable): \n\n``` \nvoid sendOtp(String phoneNumber, [String messageText]) {\n    ...        \n}\n```\n\n\u003eNOTE:\n\u003e 1. 10 digit phoneNumber should be passed.\n\u003e 2. parameter \"messageText\" is optional. By default the message text is \"Your OTP is : XXXX\". If \"messageText\" parameter is passed then message is sent as \"\u003cmessageText\u003e XXXX\".\n\n2. resultChecker() which takes the OTP entered by the user as a parameter. The function returns true if OTP is matched, else false is returned.\n\n``` \nbool resultChecker(int enteredOtp) {\n    ...\n} \n```\n\n\u003eNOTE: The OTP entered by user (say, through TextField widget or TextFormField widget etc) is to be passed as a parameter to this function.\n\n# Usage\n\nTo use this package in your application you need to have a sim card in your mobile.\n\nExample Usage:\n\n```\n...\nsendOtp('958347XXXX');  //Pass phone number as String\n\n...\n\nint enteredOtp;\nTextField(\n  onChanged: (val) {\n    enteredOtp = val;    \n  }\n)\n\n...\n\nbool isCorrectOTP = resultChecker();\nif(isCorrectOTP) {\n    print('Success');\n} else {\n    print('Failure');\n}\n...\n```\n\nOR custom \"messageText\" can be passed as parameter to sendOTP\n\n```\n...\nsendOtp('958347XXXX', 'OTP is : ');  //Pass phone number and Custom messaseText as String\n\n...\n\nint enteredOtp;\nTextField(\n  onChanged: (val) {\n    enteredOtp = val;    \n  }\n)\n\n...\n\nbool isCorrectOTP = resultChecker();\nif(isCorrectOTP) {\n    print('Success');\n} else {\n    print('Failure');\n}\n...\n```\n\n## Contributors\n1. [Fawaz Hussain](https://github.com/fawazhussain)\n2. [Jerin Francis](https://github.com/JerinFrancisA)\n\n\n:star: the repo to show support!\n\n\n## More Information\n[Pub package](https://pub.dartlang.org/packages/flutter_otp)\n[Flutter documentation](https://flutter.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJerinFrancisA%2Fflutter_otp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJerinFrancisA%2Fflutter_otp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJerinFrancisA%2Fflutter_otp/lists"}