zema 0.3.0
zema: ^0.3.0 copied to clipboard
A high-performance, type-safe schema validation library for Dart & Flutter.
Zema #
Zema is a Dart validation library inspired by Zod, with best-in-class type inference and zero-cost abstractions.
Features #
- 🎯 100% Type-Safe: Full generic inference, no
dynamic - ⚡ Zero-Cost Abstractions:
final class+ const singletons - 🔥 Dart 3.5+ Native: Records, pattern matching, sealed classes
- 🌊 Fluent API: Chainable like Zod
- 📊 Multi-Error Collection: See all validation errors at once
- 🔄 Coercion System: Parse environment variables effortlessly
- ⚡ Async Support:
refineAsyncfor database checks
🚀 Quick Start #
dependencies:
zema: ^0.1.0
import 'package:zema/zema.dart';
final userSchema = z.object({
'name': z.string().min(2),
'email': z.string().email(),
'age': z.number().positive().optional(),
});
final user = userSchema.parse({
'name': 'John',
'email': 'john@example.com',
'age': 30,
});
📚 Documentation #
📄 License #
MIT License - see LICENSE