title: How to get data from SQLite in flutter?
body: <p>I am new with flutter and SQLite so I am trying to get data from database which I created DB Browser for SQLite.</p>
  <p>I am getting this on console:
  &quot;/flutter ( 9624): Instance of 'Future&lt;List&lt;Map&lt;String, dynamic&gt;&gt;&gt;'&quot;</p>
  <p>I don't know it's a error or warning but I can't see data on console.</p>
  <p>Here is the codes on my main.dart class and database_helper class.</p>
  <pre><code>Future&lt;Database&gt; _getDatabase() async {
      if (_database == null) {
        _database = await _initializeDatabase();
        return _database;
      } else {
        return _database;
      }
    }
  
    Future&lt;Database&gt; _initializeDatabase() async {
      var lock = Lock();
      Database _db;
  
      if (_db == null) {
        await lock.synchronized(() async {
          if (_db == null) {
            var databasesPath = await getDatabasesPath();
            var path = join(databasesPath, &quot;appDB.db&quot;);
            var file = new File(path);
  
            // check if file exists
            if (!await file.exists()) {
              // Copy from asset
              ByteData data = await rootBundle.load(join(&quot;assets&quot;, &quot;myNotes.db&quot;));
              List&lt;int&gt; bytes =
                  data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
              await new File(path).writeAsBytes(bytes);
            }
            // open the database
            _db = await openDatabase(path);
          }
        });
      }
  
      return _db;
    }
  
    showCategories() async {
      var db = await _getDatabase();
      var categoryList = db.query(&quot;kategori&quot;);
      print(categoryList);
    }
  </code></pre>
  <pre><code>void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      var databaseHelper = DatabaseHelper();
      databaseHelper.showCategories();
      return MaterialApp(
        title: 'Demo',
        debugShowCheckedModeBanner: false,
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Text(&quot;&quot;),
      );
    }
  }
  </code></pre>