简体   繁体   中英

What is the difference between `TabBarView` and `PageView` in Flutter?

What is the difference between TabBarView and PageView in Flutter?

I want to implement like this. And I know both can do.

在此处输入图像描述

From flutter-examples

  • TabBarView is the widget used to each page with different functionalty that are split with tab. TabBarView link with TabController. ie Like WhatsApp have tabs with three different functionality page like Chats, Status, Calls.

  • PageView is link with PageController. You can use for Slider, carousel purpose.

Each page have different UI and functionality use TabBarView. If same ui and functionalty all page data only differ then you can go with PageView

TabBarView for

在此输入图像描述

PageView for

在此输入图像描述

If each page has a different UI then use TabBarView. If each page has the same UI and only the data differs, then you can use PageView. Obviously if the UI is different then the functionality is different.

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