Skip to content

Bug: Dot Indicator's index follows Flutter's TabBar index #208

@phillipshaong

Description

@phillipshaong

Describe the bug
If you put in a TabBar as a child of the PageViewModel, then whenever an action is used to switch the TabBar tab, it also switches the index of the dot indicator (and any associated widgets of the IntroductionScreen, like the next/back button)

To Reproduce

class IntroScreenWithTabBar extends StatelessWidget {
  const IntroScreenWithTabBar({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: IntroductionScreen(
      showDoneButton: false,
      showNextButton: false,
      pages: [
        PageViewModel(
          title: "Title 1",
          bodyWidget: DefaultTabController(
            length: 3,
            child: Column(
              children: [
                TabBar(
                  tabs: [
                    Tab(icon: Icon(Icons.directions_car)),
                    Tab(icon: Icon(Icons.directions_transit)),
                    Tab(icon: Icon(Icons.directions_bike)),
                  ],
                ),
                SizedBox(
                  height: 600,
                  child: TabBarView(
                    children: [
                      Icon(Icons.directions_car),
                      Icon(Icons.directions_transit),
                      Icon(Icons.directions_bike),
                    ],
                  ),
                )
              ],
            ),
          ),
        ),
        PageViewModel(title: "Title 2", body: "Body 2"),
        PageViewModel(title: "Title 3", body: "Body 3")
      ],
    ));
  }
}

Expected behavior
The index of the TabBar should be separate from the Introduction Screen and its associated Dot Indicator.

Screenshots
image

image

image

Smartphone (please complete the following information):

  • Device: iPhone 15: Simulator
  • OS: iOS 17.0
  • Version: 3.1.12

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions