Skip to content

Commit

Permalink
doc: add hint about absolute imports in models.md (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
devj3ns authored May 27, 2024
1 parent bcd6b4c commit 72097d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/data/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Models are business logic unique to the app. Fetched by the `Repository`, and if

## Setup

Every model must be decorated by an annotation and extend a base type that the repository manages:
Models must be stored inside files with the `.model.dart` suffix, be decorated by an annotation and extend a base type that the repository manages:

```dart
@ConnectOfflineFirstWithRest()
Expand All @@ -25,4 +25,4 @@ class Hat extends OfflineFirstModel {
}
```

?> Every `import` in a model definition file will be copied to `brick.g.dart` and available to the adapters. This is useful for field-level generators or class-level annotations that stringified functions (`RestSerializable#endpoint`).
?> Every `import` in a model definition file will be copied to `brick.g.dart` and available to the adapters. This is useful for field-level generators or class-level annotations that stringified functions (`RestSerializable#endpoint`). Please note that only absolute imports are supported inside `.model.dart` files, as these imports are directly copied to `brick.g.dart`.

0 comments on commit 72097d8

Please sign in to comment.