introduction_screen icon indicating copy to clipboard operation
introduction_screen copied to clipboard

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

Open phillipshaong opened this issue 2 years ago • 0 comments

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.

phillipshaong avatar Jan 22 '24 21:01 phillipshaong