没有 Appbar 的选项卡

问题描述 投票:0回答:0

我正在寻找有关在我的 flutter 应用程序中创建选项卡指示器的帮助。具体来说,我想创建一个指示器,该指示器在选择一个选项卡时越过选项卡 - 例如,如果我选择选项卡3,则指示器应越过前两个选项卡。有没有办法做到这一点?像下面-

Please see here to find what I want

我试过了。标签和内容都很好,我没有得到我想要的指标。我得到的-

代码:

DefaultTabController(
              length: 5, // length of tabs
              initialIndex: 0,
              child: Column(
                  crossAxisAlignment: CrossAxisAlignment.stretch,
                  children: [
                    Padding(
                      padding: const EdgeInsets.only(top: 5),
                      child: Container(
                        child: TabBar(
                          isScrollable: true,
                          labelColor: Color(0xff5f2dea),
                          labelPadding: EdgeInsets.only(left: 8, right: 5),
                          indicatorColor: Color(0xff5f2dea),
                          indicatorPadding: EdgeInsets.only(left: 8, right: 5),
                          unselectedLabelColor: Colors.black,
                          tabs: [
                            Tab(),
                            Tab(),
                           Tab(),
                            Tab(),
                            Tab(),
 ],
                        ),
                      ),
                        Padding(
                      padding: const EdgeInsets.only(left: 10, right: 10),
                      child: Container(
                        height: 1250,
                        decoration: const BoxDecoration(
                            border: Border(
                                top: BorderSide(
                                    color: Color(0xffababab), width: 0.4))),
                        child: TabBarView(children: [

                          Container(),
                          Container(),
                          Container(),
                          Container(),
                          Container(),
                ]),
                      ),
                  ),



flutter dart tabs
© www.soinside.com 2019 - 2024. All rights reserved.