OK, so I'm not done yet, new issue, after deleting with what I wrote before it gives:
"E/flutter (16571): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The method 'query' was called on null.".
Which is great!, it is deleted!.
But... new issue has appeared, what I changed is in here:
_initDatabase() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
String path = join(documentsDirectory.path, _databaseName);
//await deleteDatabase(path); //delete file incase of error
return await openDatabase(path,
version: _databaseVersion,
onCreate: _onCreate);
}
Future _onCreate(Database db, int version) async {
await db.execute('''CREATE TABLE $table ($columnName TEXT NOT NULL, $columnServer TEXT NOT NULL,);''');
}
gives me this error:
E/SQLiteLog(16571): (1) near ")": syntax error
I/flutter (16571): error DatabaseException(near ")": syntax error (code 1 SQLITE_ERROR): , while compiling: CREATE TABLE contacts (name TEXT NOT NULL, server TEXT NOT NULL,);) sql 'CREATE TABLE contacts (name TEXT NOT NULL, server TEXT NOT NULL,);' args []} during open, closing...
E/flutter (16571): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: DatabaseException(near ")": syntax error (code 1 SQLITE_ERROR): , while compiling: CREATE TABLE contacts (name TEXT NOT NULL, server TEXT NOT NULL,);) sql 'CREATE TABLE contacts (name TEXT NOT NULL, server TEXT NOT NULL,);' args []}