convertDigitsByLocale method

String convertDigitsByLocale(
  1. String text
)

Implementation

String convertDigitsByLocale(String text) {
  if (currentLocale!.languageCode == 'fa' ||
      currentLocale!.languageCode == 'ar') {
    return text.toPersianDigit();
  }
  return text.toEnglishDigit();
}