title: Convert Future<bool> to bool in flutter to check if database exists or not
body: <p>I need to convert <code>Future &lt;bool&gt;</code> to <code>bool</code>. I know it can be done with <code>then</code> and <code>await</code> but how?</p>
  
  <pre><code>class MyHomeApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
  
      bool isLogin;
      checkDatabase().then((onValue){
        isLogin = onValue;
      });
  
      if(isLogin) return HomePageScreen();
      if(!isLogin) return SignInScreen();
    }
  
    Future&lt;bool&gt; checkDatabase() async{
      Directory directory = await getApplicationDocumentsDirectory();
      String path = directory.path + 'koca.db';
      return databaseExists(path);
    }
  }
  </code></pre>