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

Implement in bottom navigation bar #65

Open
farhantandia opened this issue May 2, 2022 · 0 comments
Open

Implement in bottom navigation bar #65

farhantandia opened this issue May 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@farhantandia
Copy link

farhantandia commented May 2, 2022

Hi, first of all, thank you for a great package for ease to implement page transition between app screen navigation. I wonder how to implement the package in the bottom navigation bar with indexed stack.. this is my sample code for the navigation bar..
is this package already supported for this scenario? Thank you.

    setState(() {
      _selectedIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        // body: screens[_selectedIndex],
        body: IndexedStack(index: _selectedIndex, children: screens),
        bottomNavigationBar: Theme(
          data: ThemeData(
            splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
          ),
          child: NavigationBarTheme(
              data: NavigationBarThemeData(
                  labelTextStyle: MaterialStateProperty.all(
                      Theme.of(context).textTheme.bodyText2?.copyWith(color: Colors.blue),)),
              child: NavigationBar(
                height: 65,
                backgroundColor: Color(0XFF00112B),
                labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
                selectedIndex: _selectedIndex,
                animationDuration: Duration(milliseconds: 500),
                onDestinationSelected: (_selectedIndex) => _onItemTapped(_selectedIndex),
                destinations: const [
                  NavigationDestination(
                    icon: Icon(
                      Icons.battery_full_outlined,
                      color: Colors.white54,
                    ),
                    label: 'Dashboard',
                    selectedIcon: Icon(
                      Icons.battery_full,
                      color: Colors.blue,
                    ),
                  ),
                  NavigationDestination(
                    icon: Icon(
                      Icons.map_outlined,
                      color: Colors.white54,
                    ),
                    label: 'Ride',
                    selectedIcon: Icon(
                      Icons.map,
                      color: Colors.blue,
                    ),
                  ),
                  NavigationDestination(
                    icon: Icon(
                      Icons.library_books_outlined,
                      color: Colors.white54,
                    ),
                    label: 'Diagnostic',
                    selectedIcon: Icon(
                      Icons.library_books,
                      color: Colors.blue,
                    ),
                  ),```
@kalismeras61 kalismeras61 added the enhancement New feature or request label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants