createTable method

Future<void> createTable(
  1. String tableName,
  2. Map<String, String> columns
)

Implementation

Future<void> createTable(
    String tableName, Map<String, String> columns) async {
  final columnDefs =
      columns.entries.map((e) => '${e.key} ${e.value}').join(', ');
  await _database
      .execute('CREATE TABLE IF NOT EXISTS $tableName ($columnDefs)');
}