I am trying to create a class with methods inside to a specific Authentication process
So I have created a file MyAuthMethods.dart
class UserAuth {
static int seconds = 10000000;
static String username;
static String password;
static String key = "abc123";
static Future<String> _generateAuthCode(seconds, username, password, key) async{
var result = "something";
print("Seconds: seconds, Username: username, Password: password, Key: key");
return result;
}
}
on my form (FormScreen.dart), a button has onPressed to execute the function
onPressed:(){
UserAuth._generateAuthCode(UserAuth.seconds, "username", "password", UserAuth.key);
}
but it does not work. It says:
error: The method '_generateAuthCode' isn't defined for the class 'UserAuth'.
What do I need to change?