firestoreodm-flutter icon indicating copy to clipboard operation
firestoreodm-flutter copied to clipboard

The same model in many collections.

Open MyisCARRY opened this issue 9 months ago • 0 comments

Expected Behavior

@Collection<SomeModel>("placeA/*/subPlaceA/*/models")
@Collection<SomeModel>("placeB/*/models")
final modelsRef = ModelsCollectionReference();

I would receive the same model from both collections.

Actual Behavior

I get error:

Defined a collection with duplicate class prefix UserGameInfoModel. Either use a different class, or set a unique class prefix.

And when I set prefix build runner generates new separate model. Which means I would need to duplicate my business logic code even though it should use the same model.

MyisCARRY avatar May 16 '24 13:05 MyisCARRY