getCountry method

dynamic getCountry(
  1. String text
)

Implementation

getCountry(String text) {
  // String prefix = 'Gender Country of Stay';
  // int startIndex = text.indexOf(prefix);
  // if (startIndex != -1) {
  //   int endIndex = text.indexOf(' ', startIndex + prefix.length);
  //   if (endIndex != -1) {
  //     return text.substring(startIndex + prefix.length, endIndex);
  //   }
  // }
  // return null;
  return text.toLowerCase().contains('pakistan') ? 'Pakistan' : null;
}