tryDecode static method

Map<String, dynamic>? tryDecode(
  1. String token
)

Decode a string JWT token into a Map<String, dynamic> containing the decoded JSON payload.

Implementation

static Map<String, dynamic>? tryDecode(String token) {
  try {
    return decode(token);
  } catch (error) {
    return null;
  }
}