From 40eeaad9889ccaf70faac30ec37748b7963a9873 Mon Sep 17 00:00:00 2001 From: Matthew Jones <35195921+MatthewJones517@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:26:31 -0400 Subject: [PATCH] Update generate_adapter.md Added note to make sure the hive_generator is added as a dependency. --- custom-objects/generate_adapter.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/custom-objects/generate_adapter.md b/custom-objects/generate_adapter.md index a3b25be..84e2fdb 100644 --- a/custom-objects/generate_adapter.md +++ b/custom-objects/generate_adapter.md @@ -2,10 +2,11 @@ The [hive\_generator](https://pub.dev/packages/hive_generator) package can automatically generate `TypeAdapter`s for almost any class. -1. To generate a `TypeAdapter` for a class, annotate it with `@HiveType` and provide a `typeId` (between 0 and 223) -2. Annotate all fields which should be stored with `@HiveField` -3. Run build task `flutter packages pub run build_runner build` -4. [Register](custom-objects/type_adapters.md) the generated adapter +1. Make sure [hive_generator](https://pub.dev/packages/hive_generator) is added as a dev dependency to your project. +2. To generate a `TypeAdapter` for a class, annotate it with `@HiveType` and provide a `typeId` (between 0 and 223) +3. Annotate all fields which should be stored with `@HiveField` +4. Run build task `flutter packages pub run build_runner build` +5. [Register](custom-objects/type_adapters.md) the generated adapter ### Example