acanthis 0.1.0 copy "acanthis: ^0.1.0" to clipboard
acanthis: ^0.1.0 copied to clipboard

Acanthis is an easy-to-use validation library for Dart and Flutter.

Acanthis #

Acanthis is a Validation library heavily inspired by Zod. It is designed to be a simple, and easy to use validation library.

Features #

Acanthis is designed to be composable. Schemas can be composed together to create more complex schemas.

Also Acanthis doesn't require any runtime dependencies, and makes use of a chainable API to create schemas.

Getting Started #

To get started with Acanthis, you can install it using the following command:

dart pub add acanthis

Example #

Here is a simple example of how to use Acanthis:

import 'package:acanthis/acanthis.dart';

void main() {
  final schema = jsonObject({
	'name': string().min(3),
	'age': number().positive(),
  });

  final result = schema.tryParse({
	'name': 'Francesco',
	'age': 59,
  });

  if (result.success) {
	print('The schema is valid!');
  } else {
	print('The schema is invalid!');
  }
}

As you can see if you come from a Zod background, the API is very similar and should be familiar to you.

Contributions #

Contributions are welcome! If you want to contribute to Acanthis, you can open a pull request on the GitHub repository

6
likes
0
pub points
31%
popularity

Publisher

verified publisherserinus.app

Acanthis is an easy-to-use validation library for Dart and Flutter.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

email_validator

More

Packages that depend on acanthis