I want to create a Page View where each subpage is a specific widget based on given data called a Lesson.
For example, Page 0 would be an "IntroPage" which has a small introduction
Page 1 would be a StepContent page which has a different layout to IntroPage.
Page 2 would be an ImageContent page which also has a different layout to the other subpages.
Page 3 would have a QuizContent page.
Obviously this isn't rigid and the content that follows from an IntroPage will vary depending on the Lesson that's to be displayed.
I need this Page View to be reusable such that I can create multiple Page Views depending on what content the user wants to see from a previous List View.
I'm stuck on understanding how to create such PageView. I understand how to build the previous List View and pass a Document by reference onto the PageView. But I don't understand how to populate the PageView with the Lesson Steps.
Normally in Flutter I'd use a Page View Builder to dynamically determine the content of each page based on the Lesson Step and an enum associated with the Lesson Step.
I hope this makes sense. Any help would be appreciated!