tiny_invariant 1.0.0+2 tiny_invariant: ^1.0.0+2 copied to clipboard
A tiny implementation of the invariant function in Dart.
import 'package:tiny_invariant/tiny_invariant.dart';
void main() {
final x = 2;
final y = 2;
invariant((y + x) == 3, 'x + y is not 3'); // return exception
}