All Projects → watery-desert → water_drop_nav_bar

watery-desert / water_drop_nav_bar

Licence: BSD-3-Clause license
flutter navigation bar with water drop effect.

Programming Languages

dart
5743 projects
swift
15916 projects

Projects that are alternatives of or similar to water drop nav bar

Interactive-Add-Button-Layout
Custom Layout with interactive add button to impove your UI and UX .
Stars: ✭ 20 (-31.03%)
Mutual labels:  flutter-package
sliding panel
A Flutter slidable widget that provides an easy to use configuration. Highly customisable. Just as you want it!
Stars: ✭ 88 (+203.45%)
Mutual labels:  flutter-package
anim search bar
A flutter package that has an animated search bar with loads of customization
Stars: ✭ 28 (-3.45%)
Mutual labels:  flutter-package
change app package name
Change App Package Name with single command. It makes the process very easy and fast.
Stars: ✭ 72 (+148.28%)
Mutual labels:  flutter-package
sweetalert
sweetalert for flutter
Stars: ✭ 52 (+79.31%)
Mutual labels:  flutter-package
file manager
FileManager is a wonderful widget that allows you to manage files and folders, pick files and folders, and do a lot more. Designed to feel like part of the Flutter framework.
Stars: ✭ 38 (+31.03%)
Mutual labels:  flutter-package
survey kit
Flutter library to create beautiful surveys (aligned with ResearchKit on iOS)
Stars: ✭ 68 (+134.48%)
Mutual labels:  flutter-package
flutter feather icons
Flutter package for Feather Icons
Stars: ✭ 33 (+13.79%)
Mutual labels:  flutter-package
flutter-rehberi
Flutter için Türkçe ve İngilizce kaynakların toplandığı rehber
Stars: ✭ 730 (+2417.24%)
Mutual labels:  flutter-package
bouncing widget
A widget that enables you to add a bouncing animation on a widget.
Stars: ✭ 34 (+17.24%)
Mutual labels:  flutter-package
getx snippets extension
An extension to accelerate the process of developing applications with flutter, aimed at everyone using the GetX package.
Stars: ✭ 142 (+389.66%)
Mutual labels:  flutter-package
dartssh2
SSH and SFTP client written in pure Dart, aiming to be feature-rich as well as easy to use.
Stars: ✭ 63 (+117.24%)
Mutual labels:  flutter-package
CustomSwitch
Custom Switch package created in Flutter
Stars: ✭ 56 (+93.1%)
Mutual labels:  flutter-package
shimmer animation
This shimmer animation widget can help you bring simple yet beautiful skeleton loaders to your flutter app with ease.
Stars: ✭ 29 (+0%)
Mutual labels:  flutter-package
nepali date picker
Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support. Supports both Android and ios.
Stars: ✭ 30 (+3.45%)
Mutual labels:  flutter-package
juxtapose
A flutter widget for comparing two stacked widgets by dragging a slider thumb to reveal either sides of the slider horizontally or vertically.
Stars: ✭ 75 (+158.62%)
Mutual labels:  flutter-package
IQPlayer
Simple video player with subtitle for flutter.
Stars: ✭ 16 (-44.83%)
Mutual labels:  flutter-package
lang table
lang_table is a dart plugin to generate string files from a source. Use a table to manage all multi-language resources. Inspired by fetch-mobile-localization-from-airtable
Stars: ✭ 17 (-41.38%)
Mutual labels:  flutter-package
reactive state
An easy to understand reactive state management solution for Flutter.
Stars: ✭ 19 (-34.48%)
Mutual labels:  flutter-package
flutter-devicelocale
A Flutter package to read and return the set device locales
Stars: ✭ 45 (+55.17%)
Mutual labels:  flutter-package

Water Drop Nav Bar

YouTube Badge Instagram Badge Twitter Badge Discord Badge Patreon Badge BMC Badge pub package


Design Credit & screen recording

Animated Tabbar by Cuberto

How to use?

Installation

Add water_drop_nav_bar: to your pubspec.yaml dependencies then run flutter pub get

 dependencies:
  water_drop_nav_bar:

Import

Add this line to import the package.

import 'package:water_drop_nav_bar/water_drop_nav_bar.dart';

Add WaterDropNavBar() as bottomNavigationBar of Scaffold() and body would be PageView() with NeverScrollableScrollPhysics() don't try to upate the seleted index from onPageChanged or will see some weird behaviour. Insted of PageView() You can use Stack() or AnimatedSwitcher for custom page transition animation.

API Reference

barItems → List<BarItem>

  • List of bar items that shows horizontally, Minimum 2 and maximum 4 items.
    required

onItemSelected → OnButtonPressCallback

  • Callback When individual barItem is pressed.
    required

selectedIndex → int

  • Current selected index of the bar item.
    required

backgroundColor → Color

  • Background Color of the bar.
    optional [Colors.white]

waterDropColor → Color

  • Color of water drop which is also the active icon color.
    optional [Color(0xFF5B75F0)]

inactiveIconColor → Color

  • Inactive icon color by default it will use water drop color.
    optional [waterDropColor]

iconSize → double

  • Each active & inactive icon size, default value is 28 don't make it too big or small.
    optional [28]

bottomPadding → double

  • Additional padding at the bottom of the bar. If nothing is provided the it will use [MediaQuery.of(context).padding.bottom] value.
    optional

Do and don't

  • Don't make icon size too big.
  • Use complementary filled and outlined icons for best result.
  • backgroundColor and waterDropColor of WaterDropNavBar() and Scaffold()'s backgroundColor (or whatever widget you are using) must be different (see the example app) This will visualize that the water drop is hanging from the top.

Short example

 return Scaffold(
     
      body: PageView(
      physics: NeverScrollableScrollPhysics(),       
      controller: pageController,
       ...
      ),
      bottomNavigationBar: WaterDropNavBar(
        backgroundColor: Colors.white,
        onItemSelected: (index) {
          setState(() {
            selectedIndex = index;
          });
          pageController.animateToPage(selectedIndex,
              duration: const Duration(milliseconds: 400),
              curve: Curves.easeOutQuad);
        },
        selectedIndex: selectedIndex,
        barItems: [
          BarItem(
            filledIcon: Icons.bookmark_rounded,
            outlinedIcon: Icons.bookmark_border_rounded,
          ),
          BarItem(
              filledIcon: Icons.favorite_rounded,
              outlinedIcon: Icons.favorite_border_rounded),
        ],
      ),
    );

Issues ❗️

Android


Some android phones might have black navigation bar, this looks ugly. It's recommended to wrap Scaffold with AnnotatedRegion<SystemUiOverlayStyle> to change that black navigation bar color to WaterDropNavBar backgroundColor. Check the example app. Like this 👇

return AnnotatedRegion<SystemUiOverlayStyle>(
     value: const SystemUiOverlayStyle(
       //this color must be equal to the WaterDropNavBar backgroundColor
       systemNavigationBarColor: Colors.white, 
       systemNavigationBarIconBrightness: Brightness.dark,
     ),
     child: Scaffold(
       body: // code here
     )
);

result 👇


You can additionally provide some bottomPadding to add padding at the bottom of the bar, I think 8 is enough.

iPhone

iPhones without swipe home gesture might have such issue where icons are pushed to the bottom. Provide some bottomPadding. I added 8 padding here.

result 👇

Now you might ask how do you know which phone is using swipe home gesture?

Well, you can check bottom padding (using MediaQuery.of(context).padding.bottom) and if it's less than 34 or something then provide some bottom padding. Definitely try running different simulators and see.

FAQ

  • How do I change the height?

The height must be constant because the animation is in vertical direction. According to me 60 is perfect. But if you think needs to be reduced then please create an issue with a screenshot. I will see if I can do something.

  • How do I add drop shadow?

Wrap WaterDropNavBar with DecoratedBox or Container and pass BoxDecoration to decoration property. BoxDecoration takes list of boxShadow there you can pass your drop shadow.

DecoratedBox(
    decoration: BoxDecoration(
      boxShadow: [
        BoxShadow(
            color: Colors.black.withOpacity(0.2),
            offset: Offset(0, 4),
            blurRadius: 8.0)
      ],
    ),
    child: WaterDropNavBar()
)
  • How do I change the corner radius of the navigation bar?

Wrap WaterDropNavBar with ClipRRect and pass BorderRadius to borderRadius property.

  ClipRRect(
      borderRadius: const BorderRadius.vertical(
        top: Radius.circular(16),
      ),
      child: WaterDropNavBar(
    )                

All flutter packages

Sliding Clipped Nav Bar
Water Drop Nav Bar
Swipeable Tile
Loading Animation Widget


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].