我使用此方法将我的 ObjectBox Store 注册为 LazySingleton
setupLocatorAdditions() async {
stackedAdditionLocator.registerLazySingletonAsync<Store>(() => openStore());
}
效果很好。但是在从 BuildRunner 多次重建之后,ObjectBox Generator 抛出了这个错误,不管我是否删除了单例注册并重新运行它。
lib/objectbox.g.dart:1341:67: Error: No named parameter with the name 'lazy'.
weekDays: const fb.ListReader<int>(fb.Int8Reader(), lazy: false)
^^^^
../../Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/objectbox-1.1.1/lib/flatbuffers/flat_buffers.dart:994:9: Context: Found this candidate, but the arguments don't match.
const ListReader(this._elementReader);
^^^^^^^^^^
lib/objectbox.g.dart:1343:68: Error: No named parameter with the name 'lazy'.
locations: const fb.ListReader<int>(fb.Int8Reader(), lazy: false)
^^^^
../../Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/objectbox-1.1.1/lib/flatbuffers/flat_buffers.dart:994:9: Context: Found this candidate, but the arguments don't match.
const ListReader(this._elementReader);
^^^^^^^^^^
2
FAILURE: Build failed with an exception.