我有费用模型,
class Expense {
String id;
String amount;
String details;
String type;
DateTime date;
ExpenseMode mode;
Expense(
{this.id, this.amount, this.details, this.type, this.date, this.mode});
}
和 Hive 模型为,
@HiveType(typeId: 1)
class Expense {
@HiveField(0)
String id;
@HiveField(1)
String amount;
@HiveField(2)
String details;
@HiveField(3)
String type;
@HiveField(4)
DateTime date;
@HiveField(5)
ExpenseMode mode;
Expense(
{this.id, this.amount, this.details, this.type, this.date, this.mode});
}
我可以只使用 Hype 模型来处理费用,还是需要为 Hive TypeAdapter sepefic 保留单独的模型?