Getting Started
📢 v1.0.0-dev Documentation
You are viewing the documentation for Validasi v1.0.0-dev (development version). This version includes significant API changes and new features. Looking for the stable version? View v0 Documentation →
Welcome to Validasi! This guide will help you get started with the most flexible and type-safe validation library for Dart and Flutter.
What is Validasi?
Validasi is a powerful validation library that brings type safety, composability, and elegance to data validation in Dart and Flutter applications. Whether you're validating user input, API responses, or configuration files, Validasi makes it simple and maintainable.Key Features
Type Safety First
Validasi is built with Dart's type system in mind, providing full type safety throughout your validation logic. No more runtime surprises!
Composable & Reusable
Create complex validation schemas from simple, reusable rules. Mix and match rules to build exactly what you need.
Performance Optimized
Built-in caching system ensures your validations run fast, even when validating thousands of objects.
Why Choose Validasi?
🎯 Intuitive API
final schema = Validasi.string([
StringRules.minLength(3),
StringRules.maxLength(20),
]);
final result = schema.validate('Hello');Simple, readable, and self-documenting code.
🔧 Comprehensive Rules
Built-in rules for every common validation scenario:
- String validation (length, patterns, formats)
- Number validation (ranges, comparisons)
- Collection validation (lists, maps)
- Custom validation (inline rules, transformations)
🌲 Nested Validation
Validate complex, nested data structures with ease:
final userSchema = Validasi.map<dynamic>([
MapRules.hasFields({
'profile': Validasi.map<dynamic>([
MapRules.hasFields({
'name': Validasi.string([StringRules.minLength(2)]),
'age': Validasi.number<int>([NumberRules.moreThan(0)]),
}),
]),
}),
]);🎨 Flexible Transformations
Transform data during validation:
final schema = Validasi.string([
Transform((value) => value?.trim().toLowerCase()),
StringRules.minLength(3),
]);Next Steps
Ready to dive in? Check out:
- Installation Guide - Add Validasi to your project
- Quick Start - Build your first validation schema
- String Examples - See practical examples
Community & Support
- GitHub: albetnov/validasi
- Issues: Report bugs or request features
- Pub.dev: Package documentation
LLM Support
This documentation has support for LLMS, you can click the button at the bottom right corner to copy or download the current page as markdown file for your LLM processing. Or you can visit llms-full.txt or llms.txt files.
