jb3rndt / PersistentBottomNavBarV2

A highly customizable persistent bottom navigation bar for Flutter
https://pub.dev/packages/persistent_bottom_nav_bar_v2
BSD 3-Clause "New" or "Revised" License
47 stars 48 forks source link

Add an optional persistent custom widget above the navigation bar #144

Closed emagnier closed 2 months ago

emagnier commented 3 months ago

This PR proposes adding a persistentTopWidget option, which allows inserting a custom widget above the persistent bottom nav bar.

For my needs, this feature would be useful for integrating an audio player that remains persistent (like the bottom nav) when it is active.

Thank you 🙏

https://github.com/jb3rndt/PersistentBottomNavBarV2/assets/1045997/dcd5808a-c43c-4130-8513-7bd6281877b8

jb3rndt commented 2 months ago

Hi, I see the use case, but I think this functionality can be achieved without modifying the package. With a custom navigation bar (which could include one of the predefined styles) this should be equally achievable. This code should produce the same output as what you describe:

return PersistentTabView(
  ...
  navBarBuilder: (config) => Column(
    children: [
      Container(child: Text("Persistent Custom Widget above NavBar")),
      Style1BottomNavBar(
        navBarConfig: config,
      ),
    ],
  ),
);

Or am I missing somthing here?

emagnier commented 2 months ago

Indeed, since the v5 of this component, adding this feature is no longer necessary. I simply did a rebase of an old version without delving too much further... Thanks for your comment!