tryDecode static method

JWT? tryDecode(
  1. String token
)

Exactly like decode, just return null instead of throwing exceptions.

Implementation

static JWT? tryDecode(String token) {
  try {
    return decode(token);
  } catch (ex) {
    return null;
  }
}