base64Decode method

String? base64Decode()

对当前 Base64 字符串进行解码

如果字符串为 null 或空,或者解码失败,则返回 null

Implementation

String? base64Decode() {
  if (isNullOrEmpty()) {
    return null;
  }
  try {
    return utf8.decode(base64.decode(this!));
  } catch (e) {
    // Base64 decoding error
    return null;
  }
}