Я получаю сообщение об ошибке
E/SQLiteLog( 3975): (1) near "TEXT": syntax error
I/flutter ( 3975): error DatabaseException(near "TEXT": syntax error (code 1): , while compiling: CREATE TABLE Expense (id INTEGER PRIMARY KEY,amount REAL,date TEXT,category TEXT) sql 'CREATE TABLE Expense (id INTEGER PRIMARY KEY,amount REAL,date TEXT,category TEXT' args []} during open, closing...
E/flutter ( 3975): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: DatabaseException(near "TEXT": syntax error (code 1): , while compiling: CREATE TABLE Expense (id INTEGER PRIMARY KEY,amount REAL,date TEXT,category TEXT) sql 'CREATE TABLE Expense (id INTEGER PRIMARY KEY,amount REAL,date TEXT,category TEXT' args []}
по этому коду
initDB() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
String path = join(documentsDirectory.path, "ExpenseDB2.db");
return await openDatabase(path, version: 1, onOpen: (db) {},
onCreate: (Database db, int version) async {
await db.execute("CREATE TABLE Expense (" //the error is on this line
"id INTEGER PRIMARY KEY,"
"amount REAL,"
"date TEXT,"
"category TEXT");
Что с ним не так?