Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
phillipshaong opened this issue Jan 22, 2024 · 0 comments
Open

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

phillipshaong opened this issue Jan 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@phillipshaong
Copy link

phillipshaong commented Jan 22, 2024

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 phillipshaong added the bug Something isn't working label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant