initDB() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
print(documentsDirectory.path);
String path = join(documentsDirectory.path, "TestDB.db");
await deleteDatabase(path);
return await openDatabase(path, version: 1, onOpen: (Database db) {},
onCreate: (Database db, int version) async {
await db.execute("CREATE TABLE homeworks("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,"
"lesson INTEGER,"
"date INTEGER,"
"homework TEXT,"
"isDone INTEGER"
");"
"CREATE TABLE lessons ("
"id INTEGER PRIMARY KEY,"
"lesson TEXT)");
});
}