title: Flutter - How to delay a function for some seconds
body: <p>I have a function which returns false when the user select incorrect answer.</p>
  <pre><code>tappedbutton(int index) async {
   final userAnswer = await userAnswer();
     if (userAnswer) {
  // Executing some code
  }else{
  ErrorSnackbar(); // This snackbar takes 2 second to close.
  }
  </code></pre>
  <p>My objective is to delay calling the function for two seconds(user can click the button again , with no action triggering) after the user selects the wrong answer and to prevent the click immediatly. How can i achieve it?</p>