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