All Projects → hacktons → Convex_bottom_bar

hacktons / Convex_bottom_bar

Licence: apache-2.0
A Flutter package which implements a ConvexAppBar to show a convex tab in the bottom bar. Theming supported.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Convex bottom bar

Easydropdown
💧 Fantastic dropdown in Swift
Stars: ✭ 254 (-26.38%)
Mutual labels:  navigationbar
angular-scrollspy
A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport
Stars: ✭ 34 (-90.14%)
Mutual labels:  navigationbar
IRBottomNavigationView
Floating Bottom Navigation/Tab System
Stars: ✭ 48 (-86.09%)
Mutual labels:  navigationbar
AHCategoryView
A navigation view for categories
Stars: ✭ 29 (-91.59%)
Mutual labels:  navigationbar
react-native-floating-action-bar
A React Native floating action bar.
Stars: ✭ 39 (-88.7%)
Mutual labels:  navigationbar
react-native-detect-navbar-android
React Native module that tells if android device has soft navigation bar.
Stars: ✭ 14 (-95.94%)
Mutual labels:  navigationbar
Zxnavigationbar
灵活轻量的自定义导航栏,导航栏属于控制器view,支持导航栏联动,一行代码实现【导航栏背景图片设置、导航栏渐变、折叠、修改Item大小和边距、自定义导航栏高度、全屏手势返回、pop拦截、仿系统导航栏历史堆栈】等各种效果
Stars: ✭ 230 (-33.33%)
Mutual labels:  navigationbar
Kmnavigationbartransition
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.
Stars: ✭ 3,274 (+848.99%)
Mutual labels:  navigationbar
wx-mini-navigationbar
微信小程序自定义标题栏
Stars: ✭ 20 (-94.2%)
Mutual labels:  navigationbar
WaveSideBar
Animated side bar view
Stars: ✭ 38 (-88.99%)
Mutual labels:  navigationbar
BottomNavigationBar
A light bottom navigation bar in Android supporting Tint mode.
Stars: ✭ 48 (-86.09%)
Mutual labels:  navigationbar
LLNavigationController
This is a subClass Of UINavigationController.本导航条继承UINavigationController,自定义滑动返回手势与滑动动画,同时可自定义过场动画,解决了手势共存时的冲突。在系统类的基础上进行扩展,节约性能,无任何代码耦合度,可随时集成与剥离。支持iOS7以上系统,兼容iOS11,版本稳定。
Stars: ✭ 20 (-94.2%)
Mutual labels:  navigationbar
StackBarButtonItem
🔲 StackBarButtonItem can use BarButtonItem like StackView
Stars: ✭ 55 (-84.06%)
Mutual labels:  navigationbar
RRNavigationBar
bring UINavigationBar to UIViewController.
Stars: ✭ 11 (-96.81%)
Mutual labels:  navigationbar
Wrnavigationbar
超简单!!! 一行代码设置状态栏、导航栏按钮、标题、颜色、透明度,移动等 WRNavigationBar which allows you to change NavigationBar's appearance dynamically
Stars: ✭ 2,923 (+747.25%)
Mutual labels:  navigationbar
Teaset
A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
Stars: ✭ 2,845 (+724.64%)
Mutual labels:  navigationbar
bsnav
An extended Bootstrap 4 menu with a bunch of utilities
Stars: ✭ 90 (-73.91%)
Mutual labels:  navigationbar
Eachnavigationbar
A custom navigation bar for each view controller.
Stars: ✭ 314 (-8.99%)
Mutual labels:  navigationbar
Google nav bar
A modern google style nav bar for flutter.
Stars: ✭ 290 (-15.94%)
Mutual labels:  navigationbar
Fluent-Design
Microsoft's Fluent Design with pure HTML/CSS/JS
Stars: ✭ 36 (-89.57%)
Mutual labels:  navigationbar

appBar preview

pub.dev pub.dev github coverage status likes build status license

English | 简体中文


The official BottomAppBar can only display a notch FAB with app bar, sometimes we need a convex FAB. This ConvexAppBar is inspired by BottomAppBar and NotchShape's implementation.

Online example can be found at https://appbar.codemagic.app.

convex_bottom_bar is now a Flutter Favorite package!

Here are some supported style:

fixed react badge chip
fixedCircle reactCircle flip
textIn titled tab image
button fixed corner

How to use

Typically ConvexAppBar can work with Scaffold by setup its bottomNavigationBar.

The ConvexAppBar has to two constructors, the ConvexAppBar() will use default style to simplify the tab creation.

Add this to your package's pubspec.yaml file, use the latest version Pub:

dependencies:
  convex_bottom_bar: ^latest_version
import 'package:convex_bottom_bar/convex_bottom_bar.dart';

Scaffold(
  bottomNavigationBar: ConvexAppBar(
    items: [
      TabItem(icon: Icons.home, title: 'Home'),
      TabItem(icon: Icons.map, title: 'Discovery'),
      TabItem(icon: Icons.add, title: 'Add'),
      TabItem(icon: Icons.message, title: 'Message'),
      TabItem(icon: Icons.people, title: 'Profile'),
    ],
    initialActiveIndex: 2,//optional, default as 0
    onTap: (int i) => print('click index=$i'),
  )
);

Flutter Version Support
As Flutter is developing fast. There can be breaking changes, we will trying to support the stable version and beta version through different package version.

Stable Flutter Version Package Version More
>=1.20 >=2.4.0 Since v1.20, the stable version changed the Stack api
<1.20 <=2.3.0 Support for stable version such as v1.17, v1.12 is not going to be updated

Features

  • Provide multiple internal styles
  • Ability to change the theme of AppBar
  • Provide builder API to customize new style
  • Add badge on tab menu
  • Elegant transition animation
  • Provide hook API to override some of internal styles
  • RTL support

Table of contents

Theming

The bar will use default style, you may want to theme it. Here are some supported attributes:

Attributes Description
backgroundColor AppBar background
gradient gradient will override backgroundColor
height AppBar height
color tab icon/text color
activeColor tab icon/text color when selected
curveSize size of the convex shape
top top edge of the convex shape relative to AppBar
cornerRadius draw the background with topLeft and topRight corner; Only work with fixed tab style
style style to describe the convex shape: fixed, fixedCircle, react, reactCircle, ...
chipBuilder custom badge builder, use ConvexAppBar.badge for default badge

Badge

If you need to add badge on the tab, use ConvexAppBar.badge to get it done.

badge demo

ConvexAppBar.badge({0: '99+', 1: Icons.assistant_photo, 2: Colors.redAccent},
  items: [
    TabItem(icon: Icons.home, title: 'Home'),
    TabItem(icon: Icons.map, title: 'Discovery'),
    TabItem(icon: Icons.add, title: 'Add'),
  ],
  onTap: (int i) => print('click index=$i'),
);

The badge() method accept an array of badges; The badges is map with tab items, each value of entry can be either String, IconData, Color or Widget.

Single Button

If you only need a single button, checkout the ConvexButton.

button

Scaffold(
  appBar: AppBar(title: const Text('ConvexButton Example')),
  body: Center(child: Text('count $count')),
  bottomNavigationBar: ConvexButton.fab(
    onTap: () => setState(() => count++),
  ),
);

Style Hook

Hook for internal tab style. Unlike the ConvexAppBar.builder, you may want to update the tab style without define a new tab style.

Warning:
This hook is limited, and can lead to overflow broken if the size you provide does no match with internal style.

StyleProvider(
  style: Style(),
  child: ConvexAppBar(
    initialActiveIndex: 1,
    height: 50,
    top: -30,
    curveSize: 100,
    style: TabStyle.fixedCircle,
    items: [
      TabItem(icon: Icons.link),
      TabItem(icon: Icons.import_contacts),
      TabItem(title: "2020", icon: Icons.work),
    ],
    backgroundColor: _tabBackgroundColor,
  ),
)
class Style extends StyleHook {
  @override
  double get activeIconSize => 40;

  @override
  double get activeIconMargin => 10;

  @override
  double get iconSize => 20;

  @override
  TextStyle textStyle(Color color) {
    return TextStyle(fontSize: 20, color: color);
  }
}

RTL Support

RTL is supported internally, if you define the TextDirection inside app, the AppBar should work fine. Both RTL and LTR can be configured through Directionality:

Directionality(
  textDirection: TextDirection.rtl,
  child: Scaffold(body:ConvexAppBar(/*TODO ...*/)),
)

Custom Example

If the default style does not match with your situation, try with ConvexAppBar.builder(), which allow you to custom nearly all the tab features.

Scaffold(
  bottomNavigationBar: ConvexAppBar.builder(
    count: 5,
    backgroundColor: Colors.blue,
    style: TabStyle.fixed,
    itemBuilder: Builder(),
  )
);

// user defined class
class Builder extends DelegateBuilder {
  @override
  Widget build(BuildContext context, int index, bool active) {
    return Text('TAB $index');
  }
}

Full custom example can be found at example.

FAQ

Please file feature requests and bugs at the issue tracker.

Donate

You like the package ? Buy me a coffee :)

ko-fi

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].