AdBrixRmCommerceCategoryModel constructor

AdBrixRmCommerceCategoryModel(
  1. String category1,
  2. String? category2,
  3. String? category3,
  4. String? category4,
  5. String? category5,
)

Implementation

AdBrixRmCommerceCategoryModel(String category1, String? category2,
    String? category3, String? category4, String? category5) {
  if ((category2 != null) &&
      (category3 != null) &&
      (category4 != null) &&
      (category5 != null)) {
    this.category1 = category1;
    this.category2 = category2;
    this.category3 = category3;
    this.category4 = category4;
    this.category5 = category5;

    this.setCategoryList(
        [category1, category2, category3, category4, category5]);
  } else if ((category2 != null) &&
      (category3 != null) &&
      (category4 != null)) {
    this.category1 = category1;
    this.category2 = category2;
    this.category3 = category3;
    this.category4 = category4;

    this.setCategoryList([category1, category2, category3, category4]);
  } else if ((category2 != null) && (category3 != null)) {
    this.category1 = category1;
    this.category2 = category2;
    this.category3 = category3;

    this.setCategoryList([category1, category2, category3]);
  } else if ((category2 != null)) {
    this.category1 = category1;
    this.category2 = category2;

    this.setCategoryList([category1, category2]);
  } else {
    this.category1 = category1;

    this.setCategoryList([category1]);
  }
}