decodeUnicode static method

String decodeUnicode(
  1. String? input
)

Implementation

static String decodeUnicode(String? input) {
  if (input == null) return "";
  return input.replaceAllMapped(RegExp(r'\\u([0-9a-fA-F]{4})'), (match) {
    final hexCode = match.group(1);
    return String.fromCharCode(int.parse(hexCode!, radix: 16));
  });
}