Skip to content

Instantly share code, notes, and snippets.

@nbnD
Created June 30, 2022 09:33
Show Gist options
  • Save nbnD/d494f0c4e1384ddb7ff4b7e991dac202 to your computer and use it in GitHub Desktop.
Save nbnD/d494f0c4e1384ddb7ff4b7e991dac202 to your computer and use it in GitHub Desktop.
CRUD
static Future<int> createItem(String? title, String? descrption) async {
final db = await DatabaseHelper.db();
final data = {'title': title, 'description': descrption};
final id = await db.insert('items', data,
conflictAlgorithm: sql.ConflictAlgorithm.replace);
return id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment