generateCode method Null safety

String generateCode(
  1. Locale locale
)

Generate code for provided locale

Implementation

static String generateCode(Locale locale) {
  return locale.languageCode +
      ((locale.countryCode != null && locale.countryCode!.length > 0)
          ? "_" + locale.countryCode!
          : "");
}