tryParse static method

ObjectId? tryParse(
  1. String hexString
)

Implementation

static ObjectId? tryParse(String hexString) =>
    isValidHexId(hexString) ? parse(hexString) : null;