NearHuscarl / flutter_login

Provides login screen with login/signup functionalities to help speed up development
MIT License
1.51k stars 799 forks source link

A way to require signup at start ? #465

Closed pi-infected closed 10 months ago

pi-infected commented 10 months ago

I want to send a link by mail to create an account. I would need the user to arrive at a signup page directly, have the mail already written, and have password confirmation field already displayed.

Is is possible ? If yes, could you give me what parameters I would need ?

Best regards,

pi-infected commented 10 months ago

Ok, I found how to do it. For other people interested:

I have an otp sent by email.

String getUrlArgument(String name) {
  String? result = Uri.base.queryParameters[name];
  if (result == null) {
    return '';
  } else {
    return result;
  }
}

[...]

String email = getUrlArgument('email'), otp = getUrlArgument('otp');

[...]

FlutterLogin(
        savedEmail: email,
        hideForgotPasswordButton: otp != '',
        initialAuthMode: otp != '' ? AuthMode.signup : AuthMode.login,
       [....]
)

Great library, hard to understand how to parametrise it, but I am new to Dart.