0

I have Expense Model,

  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});
  }

and Hive Model as,

  @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});
  }

Can I use only Hype Model for Expense or need to keep separate Model for Hive TypeAdapter sepefic?

mck
  • 40,932
  • 13
  • 35
  • 50
Mrudul Addipalli
  • 574
  • 6
  • 10

1 Answers1

0

Hive does not require separate Hive Model specifically to create a Type Adapter, we can edit the existing model and and convert them to Hive Model and can create Type Adaptor from it.

Mrudul Addipalli
  • 574
  • 6
  • 10