toBigInt function
- IValidator child, {
- String? message,
Coerces value to a BigInt.
Implementation
IValidator toBigInt(IValidator child, {String? message}) {
final base = (isType<BigInt>() | $isInt | $isIntString) &
core.transform(
(v) => switch (v) {
final BigInt b => b,
final int i => BigInt.from(i),
final String s => BigInt.tryParse(s.trim()),
_ => null,
},
child,
);
return handleReturnPreserveValue(base, message);
}