tryParse static method

BigInt? tryParse(
  1. dynamic v
)

Tries to parse a dynamic value v into a BigInt, returning null if parsing fails.

Attempts to parse the dynamic value v into a BigInt using the parse method. If successful, returns the resulting BigInt; otherwise, returns null.

Parameters:

  • v: The dynamic value to be parsed into a BigInt.

Returns:

  • A BigInt if parsing is successful; otherwise, returns null.

Implementation

static BigInt? tryParse(dynamic v) {
  try {
    return parse(v);
  } on ArgumentException {
    return null;
  }
}