Custom business logic implementation

Hello,

I want to implement a Wizard that is based on dynamic list from firebase.

Each dynamic list item contains set of fields that I show within every wizard page using Listview

Wizard is implemented as PageView. It has next/previous navigation.

When user reaches last Wizard page and clicks Next, it goes to summary page.

Now, when user is redirected to the summary page, I want to do following:

Read all the data from text fields on all pages, map it with dynamic list and then save it in firebase.

Pardon if this sounds messy and complicated, let me give you an example:

Exam/Test use case:

I, as a student, run a test that consists of 3-5 random topics.

Every topic has dynamic list of questions, where the answer can be provided as a text.

So, when test is run, it queries 3-5 topics from firebase and uses that as a base for PageView.

On each PageView it fetches all the current topic questions and uses that collection as a base for ListView.

In every ListView record it also adds an Answer text field that is wrapped into component (because otherwise FF shows an error: TextField widget with the current configuration will not function properly when generated dynamically at the moment (because it is associated with a local state variable). Consider wrapping it inside of a component and then generate the component dynamically.

When student goes to the last page and clicks Next, it shows summary. At this point I want to create an instance of ExamHistory object/DataType that consists of Topics and AnsweredQuestions (AnsweredQuestion is that same as Question, but also has Answer field).

How do I do that? Perhaps there is a simple way of doing this I don't see. Thinking of somehow getting the data from all the Answer components and mapping it with Questions in Topics into ExamHistory, but unsure how to aproach it.

If it easier to do this via custom code, I am fine with it.

P.S. just to clarify: Wizard and navigation is implemented, I only need to read all the Answers, combine them with Topics and Questions, and store in DB

Please help!

2