Skip to content

Instantly share code, notes, and snippets.

@Rahiche
Created December 11, 2018 13:56
Show Gist options
  • Save Rahiche/50b3ff2bba0485ba16f4e00d603c05e9 to your computer and use it in GitHub Desktop.
Save Rahiche/50b3ff2bba0485ba16f4e00d603c05e9 to your computer and use it in GitHub Desktop.
initDB() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
String path = join(documentsDirectory.path, "TestDB.db");
return await openDatabase(path, version: 1, onOpen: (db) {
}, onCreate: (Database db, int version) async {
await db.execute("CREATE TABLE Client ("
"id INTEGER PRIMARY KEY,"
"first_name TEXT,"
"last_name TEXT,"
"blocked BIT"
")");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment