generateFlagEmojiUnicode static method

String generateFlagEmojiUnicode(
  1. String countryCode
)

Returns a String which will be the unicode of a Flag Emoji, from a country countryCode passed as a parameter.

Implementation

static String generateFlagEmojiUnicode(String countryCode) {
  final base = 127397;

  return countryCode.codeUnits
      .map((e) => String.fromCharCode(base + e))
      .toList()
      .reduce((value, element) => value + element)
      .toString();
}