简体   繁体   中英

Preload page content in TabBarView

I am currently using a TabBarView to display a long list of images (think picture gallery or manga reader).

It seems that each image is only loaded when I start swiping to the new page, ie when the edge of the new page becomes visible.

In an Android ViewPager we had setOffscreenPageLimit to be able to pre-create pages that are still off screen.

Is there a similar functionality in TabBarView or would I have to implement the preloading at a lower level, eg prefetching the images and caching them locally?

Bonus question: Is TabBarView even the correct widget for this use case or is there a more light weight alternative (considering I do not want simple scrolling but swiping and self-centering pages).

I don't think we currently have built-in support for preloading tabs in TabBarView . You could add it yourself, or using createLocalImageConfiguration and NetworkImage.resolve , you could cause images to be cached.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM