valueAsBigInt<T extends BigInt?> method
T
valueAsBigInt<T extends BigInt?>(})
Reads key and coerces it to a BigInt.
Implementation
T valueAsBigInt<T extends BigInt?>(
K key, {
bool allowHex = false,
T Function(BuError err)? onError,
T Function()? onMissing,
bool? sign,
bool allowDecimals = false,
/// Only applicable when [K] is `String`.
bool normalizeKeyLookup = false,
}) {
try {
final value = _checkItem<T>(key, onMissing, normalizeKeyLookup);
if (value == null) return value as T;
return JsonParser.valueAsBigInt<T>(
value,
allowHex: allowHex,
sign: sign,
allowDecimals: allowDecimals,
);
} on BuError catch (e) {
if (onError != null) return onError(e);
throw CoreErrors.jsonErrorWithKey(e, key);
}
}