decode static method

String decode(
  1. String text
)

Implementation

static String decode(String text) {
  if (text == null) {
    return text;
  } else {
    final Pattern unicodePattern = new RegExp(r'\\u([0-9A-Fa-f]{5})');
    final String newStr =
    text.replaceAllMapped(unicodePattern, (Match unicodeMatch) {
      final int hexCode = int.parse(unicodeMatch.group(1)!, radix: 16);
      final unicode = String.fromCharCode(hexCode);
      return unicode;
    });

    return Helper.checkAnd(newStr);
  }
}