Skip to content

Commit a28a6bf

Browse files
committed
update docs
1 parent 72e01f5 commit a28a6bf

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ You can choose between different NavbarTypes using the `NavbarDecoration.navbarT
147147

148148
![Material3 Navbar](https://github.com/maheshmnj/navbar_router/assets/31410839/027adf4f-d527-4dc5-ac22-8fe321734977)
149149

150+
### NavbarType.floating
151+
152+
![Floating Navbar](https://github.com/maheshmnj/navbar_router/assets/31410839/b735a016-703a-4fc9-be4a-a8e924a7c645)
153+
150154
## Hide or show bottomNavigationBar
151155

152156
You can hide or show bottom navigationBar with a single line of code from anywhere in the widget tree. This allows you to handle useCases like scroll down to hide the navbar or hide the navbar on opening the drawer.
@@ -155,9 +159,9 @@ You can hide or show bottom navigationBar with a single line of code from anywhe
155159
NavbarNotifier.hideBottomNavBar = true;
156160
```
157161

158-
| Hide/show navbar on scroll | Hide/show navbar on drawer open/close |
159-
| :---------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: |
160-
| ![](https://miro.medium.com/max/800/1*NaYdY1FfsPFCNBdx3wg_og.gif) | <img src="https://user-images.githubusercontent.com/31410839/173987446-c8c79bb0-d24c-46c1-bc4a-582508a4e187.gif" width ="200"> |
162+
| Hide/show navbar on scroll | Hide/show navbar on drawer open/close | Consistent behavior across all Navbars
163+
| :-----------------------------: | :------------------------------: | :------------------------------: |
164+
| ![](https://miro.medium.com/max/800/1*NaYdY1FfsPFCNBdx3wg_og.gif) | <img src="https://user-images.githubusercontent.com/31410839/173987446-c8c79bb0-d24c-46c1-bc4a-582508a4e187.gif" width ="200"> | ![ezgif com-video-to-gif](https://github.com/maheshmnj/navbar_router/assets/31410839/4e30d2a6-63c7-427c-953b-f800d1b68fad)
161165

162166
## Show Snackbar
163167

docs/assets/navbar-type4.gif

1.39 MB
Loading

docs/types.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ NavbarRouter supports three types of Navbar as of today `standard` which is basi
1717
The height of each Navbar can be accessed through the constants `kM3NavbarHeight`
1818
`kStandardNavbarHeight` and `kNotchedNavbarHeight` respectively.
1919

20+
#### Floating Navbar
21+
22+
![Floating Navbar](/assets/navbar-type4.gif)
23+
2024
### Decorating the Navbar
2125

22-
The `NavbarDecoration` class is used to customize the standard Navbar, the `NotchedDecoration` class is used to customize the notched Navbar and the `M3NavbarDecoration` class is used to customize the material3 Navbar.
26+
- `NavbarDecoration` for Standard Navbar
27+
- `NotchedDecoration` for Notched Navbar
28+
- `M3NavbarDecoration` for Material3 Navbar
29+
- `FloatingNavbarDecoration` for Floating Navbar

lib/src/animated_navbar.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
189189
theme.colorScheme.surface,
190190
elevation: widget.decoration!.elevation,
191191
height: widget.decoration!.height,
192+
selectedIconColor: widget.decoration!.selectedIconColor ??
193+
Theme.of(context).colorScheme.primary,
194+
unselectedIconColor: widget.decoration!.unselectedIconColor ??
195+
Theme.of(context).colorScheme.onSurface,
192196
selectedIconTheme: widget.decoration!.selectedIconTheme ??
193197
theme.iconTheme
194198
.copyWith(color: theme.colorScheme.onSecondaryContainer),
@@ -234,7 +238,8 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
234238
theme.colorScheme.surface,
235239
elevation: widget.decoration!.elevation,
236240
height: widget.decoration!.height,
237-
selectedIconColor: widget.decoration!.selectedIconColor,
241+
selectedIconColor: widget.decoration!.selectedIconColor ??
242+
theme.colorScheme.primary,
238243
unselectedIconColor: widget.decoration!.unselectedIconColor,
239244
selectedIconTheme: widget.decoration!.selectedIconTheme ??
240245
theme.iconTheme.copyWith(color: theme.colorScheme.primary),

0 commit comments

Comments
 (0)