AckInfer class final
Marks a top-level Ack schema for immutable model-class generation.
Apply @AckInfer() to a top-level schema variable or getter:
@AckInfer()
final userSchema = Ack.object({
'name': Ack.string(),
'age': Ack.integer(),
});
The declaring library must include both generated parts, for example
part 'user.ack.dart'; and part 'user.ack.g.dart';. ack_generator emits
the model class, public parse/JSON API, and runtime bridges in the Ack
part. Structural field mapping is generated into the Ack JSON part.
Ack remains responsible for validation and codec-aware serialization.
Supported targets:
- Top-level variables
- Top-level getters
meta cannot express "top-level getter only", so the annotation allows all
getters and ack_generator enforces the top-level restriction.
Unsupported targets:
- Classes
- Instance members
- Local variables
- Annotations
-
- @Target.new({TargetKind.topLevelVariable, TargetKind.getter})
Constructors
Properties
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
Constants
- jsonSerializable → const Object
- Internal marker used on generated model classes.