class FAQ {
  String id;
  int sn;
  String questionEng;
  String questionMm;
  String answerEng;
  String answerMm;
  String pageLinkLabelEng;
  String pageLinkLabelMm;
  String pageLink;

  String question(bool isEng) => isEng ? questionEng : questionMm;
  String answer(bool isEng) => isEng ? answerEng : answerMm;

  FAQ(
      {this.id,
      this.sn,
      this.questionEng,
      this.questionMm,
      this.answerEng,
      this.answerMm,
      this.pageLinkLabelEng,
      this.pageLinkLabelMm,
      this.pageLink});

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'sn': sn,
      'question_eng': questionEng,
      'answer_eng': answerEng,
      'question_mm': questionMm,
      'answer_mm': answerMm,
      'page_link_label_eng': pageLinkLabelEng,
      'page_link_label_mm': pageLinkLabelMm,
      'page_link': pageLink,
    };
  }

  factory FAQ.fromMap(Map<String, dynamic> map, String id) {
    return FAQ(
      id: id,
      sn: map['sn'],
      questionEng: map['question_eng'],
      answerEng: map['answer_eng'],
      questionMm: map['question_mm'],
      answerMm: map['answer_mm'],
      pageLinkLabelEng: map['page_link_label_eng'],
      pageLinkLabelMm: map['page_link_label_mm'],
      pageLink: map['page_link'],
    );
  }

  @override
  String toString() {
    return 'FAQ{id: $id, questionEng: $questionEng,questionMm:$questionMm}';
  }
}
