replace method

dynamic replace(
  1. String from,
  2. String to
)

Implementation

replace(String from, String to) {
  String? value;

  switch (toString()) {
    case "Endpoint.registryMobileTokens":
      value = "https://login.plataformasocial.com.br/users/portal/{}/signup"
          .replaceFirst(from, to);
      break;
    case "Endpoint.events":
      value =
          "https://notification.plataformasocial.com.br/users/{}/mobile-tokens/"
              .replaceFirst(from, to);
      break;
    case "Endpoint.openNotification":
      value =
          "https://notification.plataformasocial.com.br/notifications/{}/open"
              .replaceFirst(from, to);
      break;
    default:
      value = "https://login.plataformasocial.com.br/users/portal/{}/signup"
          .replaceFirst(from, to);
      break;
  }

  return value;
}