sms_pin_code 0.0.1+1 sms_pin_code: ^0.0.1+1 copied to clipboard
A pin code widget with can be automatically fullfiled with codes received via SMS.
sms_pin_code #
A pin code widget with can be automatically fullfiled with codes received via SMS both on Android and iOS.
Android codes are provided via the native user_consent
API https://developers.google.com/identity/sms-retriever/user-consent/request
iOS are automatically provided by the system as an auto-complete suggestion over the keyboard.
Getting Started #
Just add the SMSPinCode
at your widget hierarchy:
SmsPinCode(
controller: _smsCodeController,
focusNode: _smsCodeFocus,
onSubmitted: (text) => _confirmSmsTap()
)
Parameters
controller
: A regularTextEditingController
which will hold the entire input pin code on a single string.focusNode
: The focus of the SMS Pin Code. Useful to focus on it automatically after the sms is sent.onSubmitted
: AVoidCallback
to be called when the pin is completed.color
: The background color of the input.digits
: The number of digits of the PIN. Defaults to6
.isSmsCode
: If SMS Code completion should be enabled. Defaults to true whendigits == 6
.