SynquillRepository class
An annotation to mark a class as a data model for which a Drift table and repository should be generated.
IMPORTANT: Any class annotated with @SynquillRepository MUST either:
- Implement
toJson()andfromJson()methods - Use
@JsonSerializableannotation - Use
@freezedannotation with appropriate JSON serialization
The build system will throw an error if these requirements are not met.
Constructors
-
SynquillRepository({IdGenerationStrategy idGeneration = IdGenerationStrategy.client, List<
Type> ? adapters, List<Object> ? relations, bool localOnly = false}) -
Creates a new SynquillRepository annotation.
const
Properties
-
adapters
→ List<
Type> ? -
A list of API adapter types to be used with this repository.
For Stage 1, this might be a placeholder or a single adapter type.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- idGeneration → IdGenerationStrategy
-
Strategy for ID generation.
Defaults to IdGenerationStrategy.client
final
- localOnly → bool
-
Whether this repository should work in local-only mode.
When set to
true, the repository will not attempt to sync with remote API and will only work with local Drift database storage. Defaults tofalsefor backward compatibility.final -
relations
→ List<
Object> ? -
Relations defined at class level (OneToMany and ManyToOne).
This is a cleaner alternative to field-level annotations.
Each element should be either OneToMany or ManyToOne annotation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited