Flutter plugin - CubertoBottomBar

Overview

Cuberto Bottom Bar

CubertoBottomBar widget in Flutter.

CubertoBottomBar - Default Style

CubertoBottomBar - Default Style

CubertoBottomBar - Faded Style

CubertoBottomBar - Faded Style

Getting Started

dependencies:
  ...
  cuberto_bottom_bar: ^1.1.2+3

Limitations

For now this is limited to more than 1 tab, and less than 5. So 2-4 tabs. textColor will only be applied in the case of STYLE_NORMAL. In case of STYLE_FADED_BACKGROUND the tabColor will be set as textColor,(if tabColor is not set inactiveColor will be set)

manually drawer or endDrawer has to be added and then respective drawer has to be added in CubertoBottomBar ( CubertoDrawer.NO_DRAWER for no drawer, CubertoDrawer.START_DRAWER for drawer and CubertoDrawer.END_DRAWER for endDrawer)

By default the drawer overlaps the CubertoBottomBar, for that margin: EdgeInsets.only(bottom: 60.0) has been added. (Please check with the example)

The values in onTabChangedListener: (position, title, color) (position, title and color are null at the beginning), but gets the value once the tab is clicked.

Basic Usage

Adding the widget

bottomNavigationBar: CubertoBottomBar(
        key: Key("BottomBar"),
        inactiveIconColor: inactiveColor,
        tabStyle: CubertoTabStyle.STYLE_FADED_BACKGROUND, // By default its CubertoTabStyle.STYLE_NORMAL
        selectedTab: currentPage, // By default its 0, Current page which is fetched when a tab is clickd, should be set here so as the change the tabs, and the same can be done if willing to programmatically change the tab.
        drawer: CubertoDrawer.NO_DRAWER, // By default its NO_DRAWER (Availble START_DRAWER and END_DRAWER as per where you want to how the drawer icon in Cuberto Bottom bar)
        tabs: tabs
            .map((value) => TabData(
                key: Key(value.title), 
                iconData: value.icon,
                title: value.title,
                tabColor: value.color,
                tabGradient: value.gradient))
            .toList(),
        onTabChangedListener: (position, title, color) {
          setState(() {
            currentPage = position;
            currentTitle = title;
            currentColor = color;
          });
        },
      ),

class Tabs {
  final IconData icon;
  final String title;
  final Color color;
  final Gradient gradient;

  Tabs(this.icon, this.title, this.color, this.gradient);
}

getGradient(Color color) {
  return LinearGradient(
      colors: [color.withOpacity(0.5), color.withOpacity(0.1)],
      stops: [0.0, 0.7]);
}

List<Tabs> tabs = new List();
tabs.add(Tabs(Icons.home,"Home",Colors.deepPurple,getGradient(Colors.deepPurple),));
tabs.add(Tabs(Icons.search, "Search", Colors.pink, getGradient(Colors.pink)));
tabs.add(Tabs(Icons.alarm, "Alarm", Colors.amber, getGradient(Colors.amber)));
tabs.add(Tabs(Icons.settings, "Settings", Colors.teal, getGradient(Colors.teal)));

TabData

key -> Pass a Key to set it to TabItem or else by default UniqueKey() will be set iconData -> Icon to be used for the tab title -> String to be used for the tab tabColor: -> Colors to be used for background and label when STYLE_FADED_BACKGROUND is chosen tabGradient: -> Set a gradient to the selected tab which works only with STYLE_FADED_BACKGROUND . onClick -> Optional function to be used when the circle itself is clicked, on an active tab

Attributes

Required

  • tabs -> List of TabData objects
  • onTabChangedListener -> Function to handle a tap on a tab, receives int position, String title and Color tabColor (if not set will return inactiveIconColor in both STYLE_NORMAL and STYLE_FADED_BACKGROUND)

Optional

  • key -> Unique Key to set an identity to the widget
  • selectedTab -> Defaults to 0 (initialSelection has been changed to selectedTab) Current page which is fetched when a tab is clickd, should be set here so as the change the tabs, and the same can be done if willing to programmatically change the tab.
  • inactiveIconColor -> Defaults to null, derives from Theme
  • textColor -> Defaults to Colors.white
  • barBackgroundColor -> Defaults to null, derives from Theme
  • barBorderRadius -> Default to null (Scaffold's background color must be different than barBackgroundColor)
  • tabStyle -> Defaults to CubertoTabStyle.STYLE_NORMAL
  • drawer -> Defaults to CubertoDrawer.NO_DRAWER (can be set as CubertoDrawer.START_DRAWER or CubertoDrawer.END_DRAWER as per the need for the placement of drawer icon)
  • key -> Defaults to null
  • padding -> Defaults to EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0). Modifies the inner padding of the bar.
  • barShadow -> By default, adds a shadow to the bar. Can be disabled with an empty list, or modified with the desired BoxShadow.

Theming

The bar will attempt to use your current theme out of the box, however you may want to theme it. Here are the attributes:

CubertoBottom BarTheming - STYLE_FADED_BACKGROUND

Cuberto Bottom Bar Theming - STYLE_FADED_BACKGROUND

Cuberto Bottom Bar Theming - STYLE_NORMAL

Cuberto Bottom Bar Theming - STYLE_NORMAL

Showcase

If using this package in a live app, let me know and I'll add you app here.

Inspiration

This package has been inspired by a design on dribbble by Sourabh Gupta and the faded background style from Aurelien Salomon: https://github.com/sourabhgupta811/CubertoBottomBar https://dribbble.com/shots/5925052-Google-Bottom-Bar-Navigation-Pattern https://www.instagram.com/p/BtyUbSkBlnF/

Contributing

Contributions are welcome, please submit a PR :)

Comments
  • Programmatically select tab

    Programmatically select tab

    I would lite to thanks you for this beautiful bottom tab bar.

    About my issue, the app I'm developping has somes buttons allowing to switch to others screens. And same behaviour is served by bottombar also but I need to keep all two widgets into the app (buttons and bottom bar) to ease the user experience. So when users clics on button, we need bottom bar to update it's state and reflect actual screen. So please help me by adding a way to programmatically select tab to reflect user screen change.

    Thanks !

    enhancement 
    opened by easysoft-mobility 5
  • Add key parameter to tabs

    Add key parameter to tabs

    We are using this plugin in our app, and we need to pass a key parameter to each different tab in order to create some integration tests using test_driver.

    enhancement 
    opened by Zazo032 4
  •  v1.1.0 has not been released yet?

    v1.1.0 has not been released yet?

    https://github.com/kushalmahapatro/cuberto_bottom_bar/blob/9f9231d9c0665fbb8ed291ea9305862416524e23/lib/cuberto_bottom_bar.dart#L190

    I see #6 can change barshadow, but it's still version 1.0.0 on pub.dev ?

    opened by shiyiya 4
  • Button padding

    Button padding

    This is more like an improvement than an actual issue. The buttons seems to have some padding around it: Captura

    The problem is that we can only click on the actual button, not the whole area and this makes the button more difficult to tap. Could we add this tap event to the container?

    good first issue 
    opened by erperejildo 4
  • Unable to use Highlighter_Coachmark on Cuberto_Bottom_Bar as there is no way to assign a GlobalObjectKey to the Tab in Cuberto_Bottom_Bar.

    Unable to use Highlighter_Coachmark on Cuberto_Bottom_Bar as there is no way to assign a GlobalObjectKey to the Tab in Cuberto_Bottom_Bar.

    I am using Highlighter_Coachmark for directing user on the screen. Highlighter_Coachmark requires a GlobalObjectKey assigned to the widget on which the coach mark is to displayed. As there is no way to assign a GlobalObjectKey to the 'Tabs' object which Cuberto_Bottom_Bar takes, I am unable to use coach marks. Please provide a way to assign GlobalObjectKey to the Tabs. Also, thanks for developing this beautiful bottom navigator. Its supercool.

    opened by infonotics 2
  • Compilation error on 1.1.1+1

    Compilation error on 1.1.1+1

    Error log:

    Compiler message:                                                       
    ../.pub-cache/hosted/pub.dartlang.org/cuberto_bottom_bar-1.1.1+1/lib/cuberto_bottom_bar.dart:4:8: Error: Error when reading '../.pub-cache/hosted/pub.dartlang.org/cuberto_bottom_bar-1.1.1+1/lib/internal/tab_item_new.dart': No such file or directory
    import 'package:cuberto_bottom_bar/internal/tab_item_new.dart';         
           ^                                                                
    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed. 
    
    opened by Zazo032 2
  • Plugin improvements

    Plugin improvements

    Mainly, this PR tweaks a bit the CubertoBottomBar to follow Material Design's padding, adds a SafeArea widget to properly render the widget on iOS devices with gestures enabled, and adds two new properties: padding, which overrides the new default padding; barShadow, which overrides the default shadow of the widget (fixes #3); and borderRadius, which overrides the default border radius for TabData widgets. Also, the example now uses AndroidX and updated versions of Kotlin, Gradle and Android Studio plugins. Finally, I fixed some minor analyzer issues and formatted some blocks of code to improve readability. Feel free to ask anything about the changes I made.

    [1.1.0]

    • Breaking change: Migration to AndroidX
    • Breaking change: Minor UI tweaks
    • Added padding property
    • Added barShadow property
    • Added borderRadius property to TabData
    • Added SafeArea to render correctly on iPhones with gestures
    • Fixed some analyzer issues
    • Improved some code formatting
    • Updated Kotlin and AS plugin example versions
    opened by Zazo032 1
  •  'NO_DRAWER' isn't defined for the class 'CubertoDrawer'

    'NO_DRAWER' isn't defined for the class 'CubertoDrawer'

    As commented on this issue, https://github.com/kushalmahapatro/cuberto_bottom_bar/issues/2, I'm getting this error:

    The getter 'NO_DRAWER' isn't defined for the class 'CubertoDrawer'.
    Try importing the library that defines 'NO_DRAWER', correcting the name to the name of an existing getter, or defining a getter or field named 'NO_DRAWER'.
    
    opened by erperejildo 1
  • Added barBorderRadius property

    Added barBorderRadius property

    As title says I added a simple barBorderRadius property which allows you to get a result like the one below. In the example image I wrapped the CubertoBottomBar widget in a Container with margins for a better result. Obviously the Scaffold's background color must be different than barBackgroundColor otherwise you'll se no border radius 😊

    photo5771766997749707192

    enhancement 
    opened by Nicuz 1
  • Fix compatibility with Flutter 1.22

    Fix compatibility with Flutter 1.22

    I removed a Stack widget that only had one child, and a overflow property that has been removed in latest Flutter version. Also, fixed the tests that were failing and removed TickerProviderStateMixin and RouteAware mixins that don't seem to be in use anymore.

    opened by Zazo032 0
  • onclick for each Tab

    onclick for each Tab

    I couldn't manage to get the onclick on each Tab to be working properly. And when I managed to call a Function it seemed to be triggered by every Tab.

    opened by fubbali89 0
Owner
Kushal Mahapatro
Definitely Not a Bot, Tech Enthusiastic, Android Developer, Designer, Getting Hands on Experience in Flutter, Love for creating the best UI/UX.
Kushal Mahapatro
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform spe

Gillian 33 Dec 18, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022
Boris Gautier 1 Jan 31, 2022
A Side Menu plugin for flutter and compatible with liquid ui for flutter

Liquid Shrink Side Menu A Side Menu plugin for flutter and compatible with liquid ui Side Menu Types There are 8 configuration of Liquid shrink side m

Raj Singh 18 Nov 24, 2022
FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Alibaba 6.3k Dec 30, 2022
Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable.

Flutter Counter (iOS & Android) Description Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create i

Salmaan Ahmed 15 Sep 18, 2022
Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

null 97 Dec 14, 2021
Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

flutter_ffmpeg FFmpeg plugin for Flutter. Supports iOS and Android. Not maintained anymore, superseded by FFmpegKit. See FlutterFFmpeg to FFmpegKit Mi

Taner Şener 635 Dec 22, 2022
Rave flutter - A Flutter plugin for Flutterwaves's rave.

Rave Flutter A robust Flutter plugin for accepting payment on Rave with Card Nigerian Bank Account ACH Payments Mobile money Francophone Africa Mpesa

Wilberforce Uwadiegwu 30 Oct 6, 2022
A flutter plugin to add login with facebook in your flutter app

Features Login on iOS, Android and Web. Express login on Android. Granted and declined permissions. User information, picture profile and more. Provid

Darwin Morocho 157 Jan 6, 2023
Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Introduction FlutterBluePlus is a bluetooth plugin for Flutter, a new app SDK to

null 141 Dec 22, 2022
This is a Flutter plugin that takes a JSON string and converts it onto a customizable Flutter Widget.

Colored JSON Convert JSON string into customizable widget. Getting Started ColoredJson is a stateless widget that produces a structured view of JSON s

null 4 May 20, 2022
Flutter plugin to manage home screen widget within flutter app.

Flutter App Widget App Widget / Home Screen widget plugin for flutter app Usage Please see app_widget subdirectory for the usage documentation. Plafor

Alexander Dischberg 6 Dec 16, 2022
Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Divyanshu Shekhar 39 Sep 26, 2022
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 91 Dec 19, 2022
Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.

Agora UI Kit for Flutter Instantly integrate Agora video calling or video streaming into your Flutter application. Getting started Requirements An Ago

Agora.io Community 106 Dec 16, 2022