Skip to content

feat: support code generation #1

@simonpham

Description

@simonpham

Description

As a developer, I expect to only define my keys as an Enum class, then build_runner will help me to generate the required code. For example:

settings.dart

part 'settings.g.dart';

@EasyBoxClass(
  isLazy: false,
  isEncrypted: true,
  boxKey: 'settings',
  generatedClassName: 'SettingsBox',
)
enum Settings {
  @EasyBoxField(ThemeMode, ThemeMode.system)
  themeMode,
  @EasyBoxField(int, 0)
  counter,
}

then after run flutter pub run build_runner build, I got the full implementation of SettingsBox as following easy_hive documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions