New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation #154
Comments
@mafudge Share your pubspec.yml, make sure that you are using the latest |
I am using flutter_login: "2.0.0-nullsafety.0" If my onLogin calls a function, it works but the same implementation within the onLogin does not work. If I get time I'll post an example for clarity. |
@mafudge Create a new issue |
This question is beyond the topic of the Issue but.. He is using font ligatures, if I am not mistaken, it is the Fira code font. You can find more infomation here: https://github.com/tonsky/FiraCode |
Hi, this is not a bug, the documentation is right. It is a null safety package, but the onLogin and onSignup are Future<String?>?, that means that accepts null. Maybe this could be changed in a near future to Future<String?> since is a required parameter, but at the moment is Future<String?>?. (I don't remember exactly why is a Future<String?>?, will take a look to remember later. I can update here after) You need to use a Future<String?> function Return null if it has success. Return string with error to be shown. Example: Duration get loginTime => Duration(milliseconds: 2250);
Future<String?> loginUser(LoginData data) {
log.d('Name: ${data.name}, Password: ${data.password}');
return Future.delayed(loginTime).then((_) async {
/// Change this with your Sign In Logic
/// expects [null] if success or [string] with error message.
/// The error message will appear to users
String? result = await _auth.doSignIn(data.name, data.password);
return result;
}
}
|
@juliansteenbakker This can be closed too. It is not a bug. I have provided a brief explanation above. |
Thanks for the great package!
The documentation for the Null Safe version of the package shows various callbacks returning null, which is no longer possible with null safety. Please show how the returns should be handled in the new version.
The text was updated successfully, but these errors were encountered: