AckType class

Marks a top-level Ack schema for frozen legacy extension-type generation.

Legacy AckType behavior is frozen until removal in Ack 2.

Apply @AckType() to a top-level schema variable or getter:

@AckType()
final userSchema = Ack.object({
  'name': Ack.string(),
  'age': Ack.integer(),
});

ack_generator emits a typed wrapper around the schema's validated representation plus parse() and safeParse() helpers.

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
  • @Deprecated('Use @Schemable() for schema-first or class-first models. AckType will ' 'be removed in 2.0.0.')
  • @Target.new({TargetKind.topLevelVariable, TargetKind.getter})

Constructors

AckType({String? name})
Creates an annotation to generate extension types for validated data.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String?
Optional custom name for the generated extension type.
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