Schemable class final

Marks an Ack schema declaration.

Use this annotation on a top-level schema variable or getter to generate a schema-first model. Use it on a class to generate a class-first schema. name applies only to a top-level schema; every other option applies only to a class. ack_generator rejects an option set for the other target. The deprecated @AckInfer and @AckModel spellings remain supported until 2.0.0.

Annotations
  • @Target.new({TargetKind.classType, TargetKind.topLevelVariable, TargetKind.getter})

Constructors

Schemable({String? name, String? schemaName, String? description, AckCaseStyle caseStyle = AckCaseStyle.none, String? discriminatorKey, String? discriminatorValue, AckUnknownPropertyPolicy unknownProperties = AckUnknownPropertyPolicy.reject, String captureField = 'additionalProperties'})
Creates a unified schema declaration annotation.
const

Properties

captureField → String
Dart field that stores captured unknown properties.
final
caseStyle → AckCaseStyle
JSON field-name style for a class declaration.
final
description → String?
Description for a class schema. This takes precedence over an @description doc tag. A top-level schema uses .describe(...) instead.
final
discriminatorKey → String?
Discriminator key for a sealed class declaration.
final
discriminatorValue → String?
Discriminator value for a concrete union branch.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String?
Exact generated model name for a top-level schema declaration.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaName → String?
Exact generated schema facade name for a class declaration.
final
unknownProperties → AckUnknownPropertyPolicy
Unknown-property policy for a class declaration.
final

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

generatedJson → const Object
Internal marker used on generated schema-first model classes.