Sanjib Sinha posted: " Photo by Afdhal N. on Unsplash We've been doing a series of articles on Scrolling Widgets. As a result, we've already written an article on PageView. However, PageView has two other constructors that are also important and demand a place in this Scrol"
We've been doing a series of articles on Scrolling Widgets. As a result, we've already written an article on PageView. However, PageView has two other constructors that are also important and demand a place in this Scrolling series.
As we've just said, PageView is just like any other Scrolling widgets, although this widget has its own pros and cons that include many amazing features. Moreover, it depends on how we'll use them.
However, PageView.builder constructor plays also a crucial role and acts differently than PageView. PageView.builder creates a scrollable list that works page by page using widgets.
When we need to show a large number of children, this PageView.builder constructor is incomparable. Moreover, the builder is called only for those children that are actually visible.
How much can we scroll?
With reference to that question, we can say PageView.builder controls that item count with the itemCount parameter. We cannot provide a null value.
As long as the indices are less than item count parameter, and greater than or equal to zero, PageView.builder constructor calls the parameter itemBuilder. We'll see that in a minute.
Before that, let's know a few other key information about PageView.builder constructor.
Before we run the code, let's understand that we have used provider package and using a data model where we've declared our current page double value equal to 0.0.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.