Ack validates data in Dart and Flutter. This branch documents 2.0.0-beta.4; see the migration guide for 1.x changes.
Install the version documented on this branch:
dart pub add ack:^2.0.0-beta.4import 'package:ack/ack.dart';
final userSchema = Ack.object({
'name': Ack.string().minLength(2).maxLength(50),
'age': Ack.integer().min(0).max(120),
'email': Ack.string().email().nullable(),
});
final result = userSchema.safeParse({
'name': 'Ada',
'age': 36,
'email': 'ada@example.com',
});
if (result.isOk) {
print('Welcome, ${result.getOrThrow()!['name']}');
} else {
print(result.getError()); // one path: message line per failure
}See installation for SDK requirements,
model generation for @Schemable, and
codecs for encoding and callback failure semantics.
| Package | Purpose |
|---|---|
| ack | Runtime schemas, codecs, JSON Schema import/export, annotations |
| ack_generator | Models from schemas and schemas from classes |
| ack_firebase_ai | Firebase AI response JSON Schema maps |
| ack_json_schema_builder | Bidirectional json_schema_builder bridge |
| ack_mcp_dart | MCP input schemas and typed argument validation |
Examples demonstrate the packages together.
- Guides and the branch-local agent API index
- Ack agent skills plugin for Claude Code, Codex, and Cursor
- Architecture decisions: rationale and superseded choices
- CONTRIBUTING.md: setup, checks, and generator resource limits
- PUBLISHING.md: coordinated releases and tag-only publication
- SUPPORT.md, SECURITY.md, and Code of Conduct