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

How can we keep the bottom navigation on all pages. #41

Open
abdulwahid24 opened this issue Sep 6, 2019 · 1 comment
Open

How can we keep the bottom navigation on all pages. #41

abdulwahid24 opened this issue Sep 6, 2019 · 1 comment

Comments

@abdulwahid24
Copy link

abdulwahid24 commented Sep 6, 2019

Currently I have many pages in my app and I want to keep the bottom navigation bar as a permanent widget throughout the app.

Is there any way we can achieve this?

@jasonflaherty
Copy link

jasonflaherty commented Sep 20, 2019

You can do it like so... each page is held in a list. You might ask this question on stackoverflow for a better response more associated with Flutter UI.

  int _index = 0;
    final List<Widget> _pages = [
      SearchFilterData(),
      SpeakWidget(),
      QAWidget(),
    ];

Widget build(BuildContext context) {
    return Scaffold(
      body: _pages[_index],
      bottomNavigationBar: FancyBottomNavigation(
        tabs: [
          TabData(iconData: Icons.search,title: "Search"),
          TabData(iconData: Icons.language,title: "Speak"),
          TabData(iconData: Icons.question_answer,title: "Q&A"),
        ],
        onTabChangedListener: (position){
          setState(() {
            _index = position;
          });
        },
      ),
    );
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants