zema 0.2.0
zema: ^0.2.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