微信交流群

# TabPageSelector

TabPageSelector是小圆圈指示器,个数取决于TabController,通常和TabBarView配合使用,用法如下:

Column(
  children: <Widget>[
    Container(
      height: 50,
      width: double.infinity,
      color: Colors.blue,
      alignment: Alignment.center,
      child: TabPageSelector(
        controller: _tabController,
        color: Colors.white,
        selectedColor: Colors.red,
      ),
    ),
    Expanded(
      child: TabBarView(
        controller: _tabController,
        children: <Widget>[
          Container(
            color: Colors.blue,
          ),
          Container(
            color: Colors.red,
          ),
          Container(
            color: Colors.yellow,
          ),
        ],
      ),
    ),
  ],
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

效果如下:

TabPageSelector和TabBarView使用同一个controller