title: flutter await for condition to fulfill before continue with rest of code
body: <p>I need my async function to await for some expression to validate (ex. x == true) before continue with the rest of code.</p>
  
  <p>right now I am using while loop like this</p>
  
  <pre><code>var x = false;
  
  someFunction() async {
  
     // here I want to await for 
     // as long as it takes for x to become true
  
     while(!x) {
         await new Future.delayed(new Duration(milliseconds: 250));
     }
  
     // i put 250 millisecond intentional delay 
     // to protect process from blocking.
     // x is to be set true by external function
     // rest of code ...
  }
  
  await someFunction();
  </code></pre>
  
  <p>do you think there is a better way to wait for x to change to true before continue with execution ?
  Thank you</p>