搜索插件、代码仓与 APP 分类

crystal_navigation_bar 封面
插件详情v2.0.0

crystal_navigation_bar

简洁、晶莹剔透的模糊底部导航栏,带有动态指示器,实现无缝应用导航。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
2520
喜欢数
137
Pub 分数
160

安装插件

flutter pub add crystal_navigation_bar

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Crystal Navigation Bar 是一个视觉效果出众的 Flutter 应用底部导航栏,具有简洁流畅的水晶般清晰模糊效果和动态指示器,可提升用户体验。专为跨平台应用导航设计,提供平滑动画和现代美学。该包支持 Android、iOS、Web、macOS、Windows 和 Linux,非常适合跨平台开发。通过 `flutter pub add` 即可轻松设置,无缝集成到现有项目中。其对视觉清晰度和流畅过渡的关注,使其成为注重设计与可用性的应用的理想选择。

适合场景

  • 跨平台移动和网页应用
  • 带有模糊效果的现代UI设计
  • 需要直观底部导航的应用
  • 高端用户界面
  • 基于动态指标的导航

主要特点

  • 清晰的模糊效果
  • 动态指示器动画
  • 跨平台兼容性
  • Minimal setup with pub add
  • 平滑过渡动画
  • 可自定义外观

适合对象

  • 注重设计的Flutter开发者
  • 具有高级UI/UX要求的应用程序
  • 面向多个平台的开发者
  • 注重视觉精炼的项目
  • 寻求现代导航模式的用户

使用建议

  • 可能会影响低端设备的性能
  • 模糊效果需要GPU加速
  • 超出核心功能的定制化有限
  • 最适合浅色主题界面
  • 较旧操作系统版本上可能出现渲染不一致的情况

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Crystal Bottom Navigation Bar


undefined undefined
undefined undefined undefined undefined undefined
undefined undefined

A highly flexible bottom navigation bar that allows you to tailor it to your specific needs without any constraints. Elevate your UI/UX with seamless animations, customizable appearance—including the option to incorporate blur effects—and the ability to fully personalize the interface.

Styles

Screenshot 1

Simple BottomBar

With Border

Screenshot 2

Simple BottomBar

With Badge


CRYSTAL BOTTOM NAVIGATION BAR


  • Blur navigation bar
  • Frosted navigation bar
  • Floating navigation bar
  • Rounded navigation bar
  • Modern navigation bar

Getting Started

To install, add it to your pubspec.yaml file:

dependencies:
    crystal_navigation_bar:

import 'package:crystal_navigation_bar/crystal_navigation_bar.dart';

How to use it

Use CrystalNavigationBar constructor in Your app with in Scaffold's bottomNavigationBar:

Make sure extendBody in Scaffold should be true to use Floating behavior

      extendBody: true,

if you do not want to make round navigation bar with show body behind the navbar you have to make that

      extendBody: false,
Widget build(BuildContext context) {
  return Scaffold(
    body: Center(),
    extendBody: true,//<------like this 
    bottomNavigationBar:  CrystalNavigationBar(
          currentIndex: _SelectedTab.values.indexOf(_selectedTab),
          onTap: _handleIndexChanged,
          indicatorColor: Colors.white,
          // enableFloatingNavBar: false
          items: [
            
            
          ],
        ),
  );
}

basic implementation

Widget build(BuildContext context) {
    return Scaffold(
      extendBody: true,
      body: SizedBox(
        height: MediaQuery.of(context).size.height,
        child: Image.network(
          "https://images.pexels.com/photos/1671325/pexels-photo-1671325.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
          fit: BoxFit.fitHeight,
        ),
      ),
      bottomNavigationBar: Padding(
        padding: const EdgeInsets.only(bottom: 10),
        child: CrystalNavigationBar(
          currentIndex: _SelectedTab.values.indexOf(_selectedTab),
          // indicatorColor: Colors.white,
          unselectedItemColor: Colors.white70,
          backgroundColor: Colors.black.withOpacity(0.1),
          // outlineBorderColor: Colors.black.withOpacity(0.1),
          borderWidth: 2,
          outlineBorderColor: Colors.white,
          onTap: _handleIndexChanged,
          items: [
            /// Home
            CrystalNavigationBarItem(
              icon: IconlyBold.home,
              unselectedIcon: IconlyLight.home,
              selectedColor: Colors.white,
              badge: Badge(
                label: Text(
                  "9+",
                  style: TextStyle(color: Colors.white),
                ),
              ),
            ),

            /// Favourite
            CrystalNavigationBarItem(
              icon: IconlyBold.heart,
              unselectedIcon: IconlyLight.heart,
              selectedColor: Colors.red,
            ),

            /// Add
            CrystalNavigationBarItem(
              icon: IconlyBold.plus,
              unselectedIcon: IconlyLight.plus,
              selectedColor: Colors.white,
            ),

            /// Search
            CrystalNavigationBarItem(
                icon: IconlyBold.search,
                unselectedIcon: IconlyLight.search,
                selectedColor: Colors.white),

            /// Profile
            CrystalNavigationBarItem(
              icon: IconlyBold.user_2,
              unselectedIcon: IconlyLight.user,
              selectedColor: Colors.white,
            ),
          ],
        ),
      ),
    );
  }

The constructor has 19 attributes related to the Widget:

  • items: A list of tabs to display, example Home, Profile,Search, etc
  • height: The height of CrystalNavigationBar, [Default] & [Minimum] height is 105,
  • currentIndex: The tab to display.
  • onTap:Returns the index of the tab that was tapped.
  • outlineBorderColor : Border Color of the Bottom bar.
  • borderWidth : Border Width of the Bottom bar.
  • badge : Badge to display. (to display notification count etc).
  • selectedItemColor:The color of the icon and text when the item is selected.
  • unselectedItemColor: The color of the icon and text when the item is not selected.
  • margin:A convenience field for the margin surrounding the entire widget.
  • itemPadding:The padding of each item.
  • duration: The transition duration.
  • curve: The transition curve.
  • indicatorColor:The color of the tab indicator.
  • marginR:margin for the bar to give some radius .
  • paddingR:padding for the bar to give some radius.
  • borderRadius:border radius for nav bar.
  • backgroundColor:background colors for the nav bar.
  • boxShadow: floating nav bar shadow ,it takes List of BoxShadow
  • enableFloatingNavBar: make Floating nav bar enabled.
  • enablePaddingAnimation: enable the animation on item during item change.
  • splashColor: Color of the item's Splash Color. To disable, use Colors.transparent.

iconly package is used for Icons in the demo/example

Adjust Colors of background, unselectedItemColor, selectedItemColor according to your UI for better Design.

Example Usage

See Example Code for more info.

Contributing

Every pull request is welcome.

Contributors

Imtiaz Ahmad

  • Twitter
  • GitHub
  • LinkedIn

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目