toString method

  1. @keepToString
  2. @override
String toString()

Returns a string representing the locale.

This identifier happens to be a valid Unicode Locale Identifier using underscores as separator, however it is intended to be used for debugging purposes only. For parsable results, use toLanguageTag instead.


String toString() {
  if (!identical(_cachedLocale, this)) {
    _cachedLocale = this;
    _cachedLocaleString = _rawToString('_');
  return _cachedLocaleString!;