小编use*_*163的帖子

int 不是一种类型

在将版本传递给 on create 方法和我想从数据库中获取的 id 的 integer(int) 时,我收到一条错误消息,指出“int 不是类型”错误图像

class NewsDbProvider {
  Database db;

  int() async {

    Directory documentsDirectory =await getApplicationDocumentsDirectory();
    final path = join(documentsDirectory.path, "items.db");

    db = await openDatabase(
        path,
        version: 1,
        onCreate: (Database newDb,int version){
          newDb.execute("""
            CREATE TABLE Items
            (

            )
            """);
        }
    );
  }

  fetchItem(int id) async{
    db.query(
      "Items",
      columns: null,
      where: 'id = ?',
      whereArgs: {id},
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

sql dart flutter

6
推荐指数
1
解决办法
824
查看次数

标签 统计

dart ×1

flutter ×1

sql ×1