flutter floor floor_generator错误:没有实体添加到数据库注解中

s4chpxco  于 2023-05-29  发布在  Flutter
关注(0)|答案(1)|浏览(201)

我已经创建了楼层实体和DAO,但当我运行

flutter packages pub run build_runner build --delete-conflicting-outputs

我得到以下错误
没有添加到数据库注解中的实体。package:storeapp/database/myAppDatabase.dart:74:16 74 │ abstract class MyAppDatabase extends FloorDatabase {} │
但我添加了如下实体

@Database(version: 1, entities: [
  Account,
  AccountingClass,
  LocalizedProperty,
  PointOfSale,
  StoreCurrencyMapping,
  User,
  InventoryTransaction,
  JournalVoucher,
  JournalVoucherEntry,
  JournalVoucherEntryDetail,
  BaseObject,
  StoreCustomer,
  StoreEmployee,
  StoreVendor,
  Store,
  Warehouse,
  Category,
  Product,
  ProductCategory,
  StoreProductMapping,
  Order
])
4smxwvx5

4smxwvx51#

我正在导入一个文件

import 'models/baseObjects/Warehouse.dart';

当我把它改成小写

import 'models/baseObjects/warehouse.dart';

很好用。

相关问题