tryParse static method

Decimal? tryParse(
  1. String value
)

Implementation

static Decimal? tryParse(String value) {
  try {
    return Decimal.parse(value);
  } on FormatException {
    return null;
  }
}