objectbox / objectbox/objectbox-dart

Generate separate code file for each entity

Open
#525 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Dart
Stars
1.2k
Forks
162
Avg merge
15m
Merged PRs (30d)
1

Description

Is it possible that Generator generat binding code to different file according Entity file instead of only one file "objectbox.g.dart"

I have many entity files in my project. I would like to generate binding code to different file according Entity file. lIke below example
generate "bp_status_dto.g.dart" for entity file "bp_status_dto.dart", generate "company_info_dto.g.dart" for entity file " company_info_dto.dart"

WeChat Image_20230331170427

Basic info:
ObjectBox and ObjectBox generator version: 2.0.0
Flutter/Dart SDK: 3.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the generator entry point that currently produces objectbox.g.dart and review how entity source files are discovered. Define how entities map to generated filenames such as _bp_status_dto.g.dart, then verify generation across the reported multiple-entity-file scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.