enum LoginType { email, fb, google, apple }

extension LoginTypeExt on LoginType {
  bool equalsTo(LoginType type) => this.toString() == type.toString();
  bool equalsStringTo(String type) => this.toString() == type;
}

enum TrackingEvent {
  enter,
  login,
  logout,
  registration,
  login_skip,
  home,
  sizes,
  sizes_save,
  my_development,
  my_exerciseplan,
  account,
  settings,
  sales_page,
  purchase_request,
  purchase_successful,
  exercise_new,
  exercise_new_paralell,
  result,
  exercise_log,
  exercise_log_open,
  exercise_log_delete,
  exercise_log_result,
  my_body_development,
  my_muscle_development,
  my_size_development,
  my_custom_exercise_plan,
  my_custom_exercise_plan_save,
  my_exercise_plan_execute_open,
  my_exercise_plan_execute_save,
  my_special_plan,
  my_suggested_plan,
  prediction,
  search,
  exercise_device,
  customer_change,
  settings_lang,
  settings_server,
  test_set_edit,
  test_set_new,
  tutorial_step,
  tutorial_finished,
  tutorial_activate,
  terms_of_use,
  data_privacy,
  faq
}

T enumFromString<T>(Iterable<T> values, String value) {
  return values.firstWhere((type) => type.toString().split(".").last == value);
}

extension TrackingEventExt on TrackingEvent {
  String enumToString() => this.toString().split(".").last;

  bool equalsTo(TrackingEvent event) => this.toString() == event.toString();
  bool equalsStringTo(String event) => this.toString() == event;
}

enum PropertyEnum { Ectomorph, Mesomorph, Endomorph }

extension PropertyExt on PropertyEnum {
  String toStr() => this.toString().split(".").last;

  bool equalsTo(PropertyEnum event) => this.toString() == event.toString();
  bool equalsStringTo(String event) => this.toString() == event;
}

enum SizesEnum { Weight, Height, Shoulder, Neck, Biceps, Chest, Belly, Hip, ThighTop, ThighMiddle, Knee, Calf, Ankle, Underarm, Lowerarm }

extension SizesExt on SizesEnum {
  String toStr() => this.toString().split(".").last;
  bool equalsTo(SizesEnum event) => this.toString() == event.toString();
  bool equalsStringTo(String event) => this.toString() == event;
}

enum EvaluationText { very_poor, poor, fair, below_average, average, above_average, good, excellent, elite }

extension EvaluationTextExt on EvaluationText {
  String toStr() => this.toString().split(".").last;
  bool equalsTo(EvaluationText eval) => this.toString() == eval.toString();
  bool equalsStringTo(String eval) => this.toStr() == eval;
}
