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

no have shadow in bottom navigation bar #62850

Closed
longdratech opened this issue Aug 4, 2020 · 3 comments
Closed

no have shadow in bottom navigation bar #62850

longdratech opened this issue Aug 4, 2020 · 3 comments
Labels
in triage Presently being triaged by the triage team

Comments

@longdratech
Copy link

I can't find the shadow in Bottom navigation bar. only have elevation

@darshankawar
Copy link
Member

Hi @TranLo,
Yes, Bottom Navigation Bar has elevation property. If you want to give a shadow effect to it, you may wrap the widget with Container and use BoxDecoration method to apply shadow effect, like below:

bottomNavigationBar: Container(
        decoration: BoxDecoration(
          boxShadow: <BoxShadow>[
            BoxShadow(
                color: Colors.black54,
                blurRadius: 15.0,
                offset: Offset(0.0, 0.75)
            )
          ],
        ),
        child: BottomNavigationBar(
          items: [
            new BottomNavigationBarItem(
              icon: Icon(Icons.home),
              title: Text('Home'),
            ),
            new BottomNavigationBarItem(
              icon: Icon(Icons.mail),
              title: Text('Messages'),
            ),
            new BottomNavigationBarItem(
                icon: Icon(Icons.person),
                title: Text('Profile')
            )
          ],
        ),
      )

Screen Shot 2020-08-05 at 11 39 37 AM

@darshankawar darshankawar added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Aug 5, 2020
@longdratech
Copy link
Author

Hi @TranLo,
Yes, Bottom Navigation Bar has elevation property. If you want to give a shadow effect to it, you may wrap the widget with Container and use BoxDecoration method to apply shadow effect, like below:

bottomNavigationBar: Container(
        decoration: BoxDecoration(
          boxShadow: <BoxShadow>[
            BoxShadow(
                color: Colors.black54,
                blurRadius: 15.0,
                offset: Offset(0.0, 0.75)
            )
          ],
        ),
        child: BottomNavigationBar(
          items: [
            new BottomNavigationBarItem(
              icon: Icon(Icons.home),
              title: Text('Home'),
            ),
            new BottomNavigationBarItem(
              icon: Icon(Icons.mail),
              title: Text('Messages'),
            ),
            new BottomNavigationBarItem(
                icon: Icon(Icons.person),
                title: Text('Profile')
            )
          ],
        ),
      )

Screen Shot 2020-08-05 at 11 39 37 AM

Thanks @darshankawar . I got it

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 5, 2020
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team
Projects
None yet
Development

No branches or pull requests

2 participants