decodePayload function

String decodePayload(
  1. String payloadBase64
)

Implementation

String decodePayload(String payloadBase64) {
  var delta4 = payloadBase64.length % 4;
  if (delta4 > 0 && delta4 < 4) {
    payloadBase64 =
        payloadBase64.padRight(payloadBase64.length + (4 - delta4), '=');
  }

  var json = utf8.decode(base64Decode(payloadBase64));
  return json;
}