HideableBottomBar class
HideableBottomBar is a customizable and hideable bottom navigation bar widget for Flutter. It allows for dynamic updates and a sleek, animated UI. The widget supports custom child items and styling options, including color, size, and animations.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HideableBottomBar
Constructors
-
HideableBottomBar.new({Key? key, required double bottomPosition, required List<
HideableBottomNavigationItem> children, required dynamic onSelected(HideableBottomNavigationItem), required int selectedIndex, Color backgroundColor = Colors.white, Widget? bottomBarWidget, double cornerRadius = 16.0, Curve? curve, Duration duration = const Duration(milliseconds: 300), double height = 60, double margin = 16, dynamic onIndexChanged(int)?, EdgeInsetsGeometry? padding, Color selectedColor = Colors.black, TextStyle selectedItemTextStyle = const TextStyle(fontSize: 16, color: Colors.white), List<BoxShadow> shadow = const [BoxShadow(color: Colors.grey, blurRadius: 16)], bool showTooltips = false, Color unselectedColor = Colors.white}) -
Default constructor.
const
Properties
- backgroundColor → Color
-
Sets the background color of the bottom bar.
Default: Colors.white
final
- bottomBarWidget → Widget?
-
Allows you to provide a custom widget to use as the bottom bar. If null, a default bottom bar will be used.
Default: null
final
- bottomPosition → double
-
Controls the vertical position of the bottom bar relative to the bottom of the screen.
Required parameter.
final
-
children
→ List<
HideableBottomNavigationItem> -
List of navigation items displayed in the bottom bar.
Required parameter.
final
- cornerRadius → double
-
Specifies the corner radius for the bottom bar and the selected item.
This allows customization of the widget’s rounded edges.
Default: 16.0
final
- curve → Curve?
-
Specifies the animation curve for the bottom bar’s appearance and disappearance.
Default: Curves.linear
final
- duration → Duration
-
Determines the duration of the animation when the bottom bar is shown or hidden.
Default: Duration(milliseconds: 300)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Sets the height of the bottom bar.
Default: 60.0
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → double
-
Sets the horizontal margin for the bottom bar.
Default: 16.0
final
- onIndexChanged → dynamic Function(int)?
-
A callback that is triggered whenever the selected index changes.
This allows external state management for the navigation bar.
Default: null
final
- onSelected → dynamic Function(HideableBottomNavigationItem)
-
Callback function triggered when a navigation item is selected. It returns the selected HideableBottomNavigationItem.
Required parameter.
final
- padding → EdgeInsetsGeometry?
-
Defines the padding around the bottom bar.
Default: EdgeInsets.symmetric(horizontal: 16.0)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedColor → Color
-
Sets the background color for the selected navigation item.
Default: Colors.black
final
- selectedIndex → int
-
Specifies the currently selected index of the bottom navigation items.
Required parameter.
final
- selectedItemTextStyle → TextStyle
-
Configures the text style for the selected item’s label.
TextStyle(fontSize: 16, color: Colors.white)
final
-
shadow
→ List<
BoxShadow> -
Provides a shadow effect for the bottom bar container.
Default:
BoxShadow(color: Colors.grey, blurRadius: 16)
final - showTooltips → bool
-
Determines whether tooltips should be displayed when hovering or long-pressing on navigation items.
Default: false
final
- unselectedColor → Color
-
Sets the color for unselected navigation items.
Default: Colors.white
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< HideableBottomBar> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited