-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
152 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import '../../common/module.dart'; | ||
|
||
typedef FaqQuestionBuilder = FaqQuestion Function(BuildContext context); | ||
|
||
class FaqSection { | ||
FaqSection({required this.title, required this.questions}); | ||
|
||
final String Function(BuildContext context) title; | ||
final List<FaqQuestionBuilder> questions; | ||
} | ||
|
||
abstract class FaqQuestion { | ||
const FaqQuestion({ | ||
required this.question, | ||
required this.answer, | ||
}); | ||
|
||
final String question; | ||
final dynamic answer; | ||
} | ||
|
||
class FaqTextAnswerQuestion extends FaqQuestion { | ||
const FaqTextAnswerQuestion({ | ||
required super.question, | ||
required String super.answer, | ||
}); | ||
} | ||
|
||
class FaqWidgetAnswerQuestion extends FaqQuestion { | ||
const FaqWidgetAnswerQuestion({ | ||
required super.question, | ||
required Widget super.answer, | ||
}); | ||
} | ||
|
||
final faqContent = <FaqSection>[ | ||
FaqSection( | ||
title: (context) => context.l10n.faq_section_title_pgx, | ||
questions: [ | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_pgx_what, | ||
answer: context.l10n.faq_answer_pgx_what, | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_pgx_why, | ||
answer: context.l10n.faq_answer_pgx_why, | ||
), | ||
(context) => FaqWidgetAnswerQuestion( | ||
question: context.l10n.faq_question_genetics_info, | ||
answer: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text(context.l10n.faq_answer_genetics_info), | ||
SizedBox(height: PharMeTheme.smallSpace * 0.5), | ||
Hyperlink( | ||
text: geneticInformationUrl.toString(), | ||
onTap: openFurtherGeneticInformation, | ||
), | ||
], | ||
), | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_which_medications, | ||
answer: context.l10n.faq_answer_which_medications, | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_family, | ||
answer: context.l10n.faq_answer_family, | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_share, | ||
answer: context.l10n.faq_answer_share, | ||
), | ||
], | ||
), | ||
FaqSection( | ||
title: (context) => context.l10n.faq_section_title_pharme, | ||
questions: [ | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_pharme_function, | ||
answer: context.l10n.faq_answer_pharme_function, | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_pharme_hcp, | ||
answer: context.l10n.faq_answer_pharme_hcp, | ||
), | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_pharme_data_source, | ||
answer: context.l10n.faq_answer_pharme_data_source, | ||
), | ||
], | ||
), | ||
FaqSection( | ||
title: (context) => context.l10n.faq_section_title_security, | ||
questions: [ | ||
(context) => FaqTextAnswerQuestion( | ||
question: context.l10n.faq_question_data_security, | ||
answer: context.l10n.faq_answer_data_security, | ||
), | ||
], | ||
), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters