Open kaciula opened 2 weeks ago
There is not currently, but I am working on a new way to generate type adapters in https://github.com/IO-Design-Team/hive_ce/pull/35. I will make it so that hive_registrar.g.dart
is placed in the same directory as the file containing the @GenerateAdapters
annotation.
I added the feature to that PR. Could you try this and see if it does what you need?
pubspec.yaml
dependency_overrides:
hive_ce:
git:
url: https://github.com/IO-Design-Team/hive_ce
ref: 7a0792d407d7563f56a88bcb3d8427e4a9315968
path: hive
hive_ce_generator:
git:
url: https://github.com/IO-Design-Team/hive_ce
ref: 7a0792d407d7563f56a88bcb3d8427e4a9315968
path: hive_generator
Create a file where you want hive_registrar.g.dart
to be containing the following:
import 'package:hive_ce/hive.dart';
part '{YOUR_FILE_NAME}.g.dart';
@GenerateAdapters([AdapterSpec<StubType>()])
class StubType {}
You could transition your project to using @GenerateAdapters
, but I'm not sure how much work that would be for you (and also the feature is not quite stable yet). If you are interested in attempting the migration for science, see the documentation here.
Is there a way to specify where to create the hive_registrar.g.dart file? Currently, it is being created in the main lib folder. I would much prefer to control where to place it in the file hierarchy (e.g closer to where the database is)