Skip to content

Introduction ​

Acanthis validates data at runtime. Define a schema, pass it an input, and get a typed value or issues that describe what failed.

dart
import 'package:acanthis/acanthis.dart';

void main() {
  final email = string().trim().email();

  final String address = email.parse(' ada@example.com ');
  print(address); // ada@example.com
  print(email.validate('invalid')); // false
}

Schemas compose: use the same email schema in an object, a list, or a nullable field. Fluent methods return new schemas, so adding a check leaves the original reusable.

Installation ​

These docs describe the V2 API in this repository. Use Dart 3.13 or later, or a Flutter SDK that includes a compatible Dart version. When using a published package, check that its version exposes this API.

sh
dart pub add acanthis
sh
flutter pub add acanthis

All public APIs are available from one import:

dart
import 'package:acanthis/acanthis.dart';

Choose your next step ​

You want to…Read
Define and parse your first objectQuick start
Find a type or a checkSchema reference
Show useful errorsResults and issues
Validate a form as it changesLive validation
Share a JSON contractJSON Schema
Upgrade an existing projectMigrating to V2

Acanthis does not require code generation. Objects produce maps; use a class schema when you want a Dart class as output.

Built by Avesbox · Made for Dart & Flutter