title: Flutter Sqflite multiple table models
body: <p>I've gone through many tutorials and samples on how to implement Sqflite in Flutter. Every other example is done using only one model or database table. As defined in these tutorials:</p>
  
  <p><a href="https://pub.dartlang.org/packages/sqflite" rel="noreferrer">https://pub.dartlang.org/packages/sqflite</a></p>
  
  <p><a href="https://www.developerlibs.com/2018/07/flutter-sqlite-database-example.html" rel="noreferrer">https://www.developerlibs.com/2018/07/flutter-sqlite-database-example.html</a></p>
  
  <p><a href="http://camposha.info/flutter/sqflite-insert-select-show" rel="noreferrer">http://camposha.info/flutter/sqflite-insert-select-show</a></p>
  
  <p>As far as I've understood, we need to create as many models and helpers as there are tables. For each database table there will be a model.dart file and a helper.dart file.</p>
  
  <p>My question here, is there any way I can have only one helper for all models?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In helper.dart file there is a future "insert". How can I use the same insert future for all models?</p>
  
  <pre><code>Future&lt;Todo&gt; insert(Todo todo) async {
      todo.id = await db.insert(tableTodo, todo.toMap());
      return todo;
  }
  </code></pre>