convertToFinglish function

String convertToFinglish(
  1. String val
)

Implementation

String convertToFinglish(String val) {
  late String result;
  switch (val) {
    case 'ا':
      result = 'a';
      break;
    case 'ب':
      result = 'b';
      break;
    case 'پ':
      result = 'p';
      break;
    case 'ت':
      result = 't';
      break;
    case 'ث':
      result = 's';
      break;
    case 'ج':
      result = 'j';
      break;
    case 'چ':
      result = 'ch';
      break;
    case 'ح':
      result = 'h';
      break;
    case 'خ':
      result = 'kh';
      break;
    case 'د':
      result = 'd';
      break;
    case 'ذ':
      result = 'z';
      break;
    case 'ر':
      result = 'r';
      break;
    case 'ز':
      result = 'z';
      break;
    case 'ژ':
      result = 'j';
      break;
    case 'س':
      result = 's';
      break;
    case 'ش':
      result = 'sh';
      break;
    case 'ص':
      result = 's';
      break;
    case 'ض':
      result = 'z';
      break;
    case 'ط':
      result = 't';
      break;
    case 'ظ':
      result = 'z';
      break;
    case 'ع':
      result = 'a';
      break;
    case 'غ':
      result = 'g';
      break;
    case 'ف':
      result = 'f';
      break;
    case 'ق':
      result = 'q';
      break;
    case 'ک':
      result = 'k';
      break;
    case 'گ':
      result = 'g';
      break;
    case 'ل':
      result = 'l';
      break;
    case 'م':
      result = 'm';
      break;
    case 'ن':
      result = 'n';
      break;
    case 'و':
      result = 'v';
      break;
    case 'ه':
      result = 'a';
      break;
    case 'ی':
      result = 'h';
      break;
    case 'ئ':
      result = 'a';
      break;
    case 'ء':
      result = 'a';
      break;
  }
  // print('result.characters.first ===> ${result.characters.first}');
  return result.characters.first;
}