SimplePhoneSignInForm class

A simple phone number login form.

간단한 전화번호 로그인 위젯. 이 위젯은 전화번호를 입력하고, SMS 코드를 입력하는 UI 를 보여준다. 참고로, 이메일로 로그인을 할 수도 있다. 참고로, 국가 코드 선택을 하지는 않는다. 따라서 국가 코드 선택이 필요한 경우, 이 위젯의 코드를 복사해서 수정해서 사용하면 된다.

리뷰 또는 테스트를 위해서 emailLogin, reviewEmail, reviewPassword, reviewPhoneNumber, reviewRealPhoneNumber, reviewRealSmsCode 와 같은 값을 사용 할 수 있다. 만약 리뷰나 테스트 용 로그인이 아니면, 이 값들은 필요 없다.

emailLogin 이 true 이며, 전화번호에 @ 이 포함되어 있으면, 이메일과 비밀번호로 로그인을 한다. 이메일과 비밀번호는 : 로 분리해서 입력한다. 예) my@email.com:4321Pw 와 같이 하면, 메일 주소는 my@email.com 이고, 비밀번호는 4321Pw 이다.

reviewEmail Review 용 임시 이메일. reviewPhoneNumberreviewRealPhoneNumber 를 입력하면, 이 이메일 계정으로 로그인한다.

reviewPasswordreviewEmail 과 함께 사용되는 리뷰용 임시 비밀번호. emailLogin 이 true 인 경우, "reviewEmail:reviewPassword" 와 같이 입력하면, 리뷰 계정으로 로그인한다.

reviewPhoneNumber Review 용 임시 전화번호. 이 값을 전화번호로 입력하면, 리뷰 계정으로 자동 로그인. 예를 들어, 이 값이 '01012345678' 으로 지정되고, 사용자가 이 값을 입력하면, 곧 바로 리뷰 reviewEmail 계정으로 로그인한다. SMS 코드를 입력 할 필요 없이, 바로 로그인한다.

reviewRealPhoneNumber 테스트 전화번호. 이 값을 전화번호로 입력하면, 테스트 SMS 코드를 입력하게 한다. 예를 들어, 이 값이 '01012345678' 으로 지정되고, 사용자가 이 값을 입력하면, 테스트 SMS 코드를 입력하게 한다.

reviewRealSmsCode 리뷰 할 때 사용하는 SMS 코드. reviewRealPhoneNumber 를 입력 한 다음, 이 값을 SMS 코드로 입력하면, reviewEmail 계정으로 자동 로그인. 즉, reviewRealPhoneNumber 을 입력하고, reviewRealSmsCode 를 입력하면, 테스트 계정으로 로그인한다. 이것은 애플 리뷰에서 리뷰 계정 로그인을 할 때, 로그인 전체 과정을 다 보여달라고 하는 경우, 이 reviewRealPhoneNumberreviewRealSmsCode 를 알려주면 된다.

onCompleteNumber 전화번호 입력을 하고, 전송 버튼을 누르면 이 콜백을 호출한다. 이 콜백은 전화번호를 받아서, 전화번호가 올바른지 또는 전화번호를 원하는 형태로 수정해서 반환한다. 예를 들어, 한국 전화번호와 필리핀 전화번호 두 가지만 입력 받고 싶은 경우, 한국 전화번호는 010 로 시작하고, 필리핀 전화번호는 09로 시작한다. 그래서 전화번호의 처음 숫자를 보고 +82 또는 +63을 붙여 완전한 국제 전화번호로 리턴하면 된다. 만약, 이 함수가 null 을 리턴하면, 에러가 있는 것으로 판단하여 동작을 멈춘다.

phoneNumberDisplayBuilder 는 전화번호 입력을 완료하고, SMS 코드를 입력하는 화면에서, 전화번호를 어떻게 표시할지 결정하는 함수이다. 이 함수는 전화번호를 받아서, 표시할 전화번호를 리턴하면 된다. 예를 들어, 사용자가 입력한 전화번호(또는 국제 전화번호)가 +821012345678 이면, 이 것을 010-1234-5678 로 리턴하면 화면에 010-1234-5678 이 표시된다. 이 함수가 null 이면, 전화번호를 그대로 표시한다.

onSignin 로그인이 성공하면 호출되는 콜백. 홈 화면으로 이동하거나 기타 작업을 할 수 있다.

로그인이 성성하면 이 위젯은 UserService.instance.login() 을 호출한다. 그리고 처음 로그인이면, 이 함수에서 /users/

headline 상단에 표시할 헤드라인 위젯. 이 값이 null 이면 기본 텍스트가 표시된다. 기본 텍스트는 다국어 번역이 지원이 된다.

label 전화번호 입력 박스 위에 표시될 레이블

description 전화번호 입력 박스 아래에 표시될 설명

onPhoneNumberVerificationFailed Callback to be called when the phone number verification fails.

onSmsCodeVerificationFailed Callback to be called when the sms code verification fails.

onPhoneNumberVerificationProgress callback that return true when the phone number verification is in progress and false when the phone verification is not in progress

onSmsCodeProgress callback that return true when the sms code verification is in progress and false when the sms code verification

Inheritance

Constructors

SimplePhoneSignInForm({Key? key, bool emailLogin = false, String reviewEmail = 'review@email.com', String reviewPassword = '12345a', String? reviewPhoneNumber, String? reviewRealPhoneNumber, String? reviewRealSmsCode, String? onCompleteNumber(String)?, required void onSignin(), String languageCode = 'ko', Widget? headline, Widget? label, Widget? description, Widget? submitLabel, Widget? phoneNumberInputPrefix, Widget? phoneNumberInputPrefixIcon, BoxConstraints? phoneNumberInputPrefixIconConstraints, String? phoneNumberInputHintText, Widget? smsPhoneLabel, Widget? smsDescription, Widget? smsSubmitLabel, Widget? smsRetry, String? phoneNumberDisplayBuilder(String?)?, dynamic onPhoneNumberVerificationFailed(FirebaseAuthException)?, dynamic onSmsCodeVerificationFailed(FirebaseAuthException)?, dynamic onPhoneNumberVerificationProgress(bool)?, dynamic onSmsCodeProgress(bool)?})
const

Properties

description Widget?
final
emailLogin bool
final
hashCode int
The hash code for this object.
no setterinherited
headline Widget?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label Widget?
final
languageCode String
final
onCompleteNumber → (String? Function(String)?)
final
onPhoneNumberVerificationFailed → (dynamic Function(FirebaseAuthException)?)
final
onPhoneNumberVerificationProgress → (dynamic Function(bool)?)
final
onSignin → void Function()
final
onSmsCodeProgress → (dynamic Function(bool)?)
final
onSmsCodeVerificationFailed → (dynamic Function(FirebaseAuthException)?)
final
phoneNumberDisplayBuilder → (String? Function(String?)?)
final
phoneNumberInputHintText String?
final
phoneNumberInputPrefix Widget?
final
phoneNumberInputPrefixIcon Widget?
final
phoneNumberInputPrefixIconConstraints BoxConstraints?
final
reviewEmail String
final
reviewPassword String
final
reviewPhoneNumber String?
final
reviewRealPhoneNumber String?
final
reviewRealSmsCode String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
smsDescription Widget?
final
smsPhoneLabel Widget?
final
smsRetry Widget?
final
smsSubmitLabel Widget?
final
submitLabel Widget?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SimplePhoneSignInForm>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited