Skip to content

add: attribute optional barHeight in FancyBottomNavigation #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions lib/fancy_bottom_navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@ const double ARC_HEIGHT = 70;
const double ARC_WIDTH = 90;
const double CIRCLE_OUTLINE = 10;
const double SHADOW_ALLOWANCE = 20;
const double BAR_HEIGHT = 60;

class FancyBottomNavigation extends StatefulWidget {
FancyBottomNavigation(
{@required this.tabs,
@required this.onTabChangedListener,
this.key,
this.initialSelection = 0,
this.circleColor,
this.activeIconColor,
this.inactiveIconColor,
this.textColor,
this.gradient,
this.barBackgroundColor})
{
@required this.tabs,
@required this.onTabChangedListener,
this.key,
this.initialSelection = 0,
this.circleColor,
this.activeIconColor,
this.inactiveIconColor,
this.textColor,
this.gradient,
this.barBackgroundColor,
this.barHeight = 60
})
: assert(onTabChangedListener != null),
assert(tabs != null),
assert(tabs.length > 1 && tabs.length < 5);
Expand All @@ -35,6 +37,7 @@ class FancyBottomNavigation extends StatefulWidget {
final Color textColor;
final Gradient gradient;
final Color barBackgroundColor;
final double barHeight;
final List<TabData> tabs;
final int initialSelection;

Expand Down Expand Up @@ -125,7 +128,7 @@ class FancyBottomNavigationState extends State<FancyBottomNavigation>
alignment: Alignment.bottomCenter,
children: <Widget>[
Container(
height: BAR_HEIGHT,
height: widget.barHeight,
decoration: BoxDecoration(color: barBackgroundColor, boxShadow: [
BoxShadow(color: shadowColor, offset: Offset(0, -1), blurRadius: 8)
]),
Expand Down