atob static method

String atob(
  1. String base64Str
)

将Base64编码的字符串解码为原始字符串 base64Str Base64编码的字符串 @example

String decoded = Tools.atob('SGVsbG8gV29ybGQ=');
// 返回: Hello World

Implementation

static String atob(String base64Str) {
  try {
    List<int> bytes = base64.decode(base64Str);
    return utf8.decode(bytes);
  } catch (e) {
    return '';
  }
}