signIn method Null safety

dynamic signIn(
  1. {required BuildContext context,
  2. required String identifierType,
  3. dynamic callback}
)

Call signIn function for showing signIn form

identifierType should be either 'email' or 'phone_number_sms'

When the user is successfully verified, the callback method will get invoked with the payload containing the userID and other information. If something went wrong, it will return no values.

Implementation

signIn({
  required BuildContext context,
  required String identifierType,
  callback,
}) async {
  identifierType = identifierType;

  /// Navigator.push returns a Future that completes after calling
  // Navigator.pop on the Selection Screen.
  final result = await Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => WebViewContainer(
        apiKey: apiKey,
        secretKey: secretKey,
        navContext: context,
        identifierType: identifierType,
      ),
    ),
  );

  callback(context, result);
}