title: how to make global variable in flutter
body: <p>i wanted global variable to use in any function
  so i added code</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart';
  Future&lt;Database&gt; dataBase;
  </code></pre>
  
  <p>like this. so i thought dataBase became global-variable and store the value the whole time. but it didn't. after i use dataBase variable</p>
  
  <pre class="lang-dart prettyprint-override"><code>createDB() async {
    dataBase = openDatabase(join(await getDatabasesPath(), 'data.db');
  }
  </code></pre>
  
  <p>like this<br> 
  and i would have use the dataBase in others function</p>
  
  <pre class="lang-dart prettyprint-override"><code>getData() async {
    final Database db = await dataBase;
  }
  </code></pre>
  
  <p>but when i runned the app dataBase in <code>getData() function</code> was null why dataBase was null?
  and how can i make global variable?</p>