AdaptiveBottomNavigation class

A widget that displays an adaptive bottom navigation bar depending on the platform.

The icons, pages, and labels parameters must not be null. The iconSize, backgroundColor, selectedColor, unselectedColor, animationDuration, animationIndicatorCurve, animationIconCurve, indicatorDecoration, itemDecoration, bottomNavigationDecoration, height, indicatorHeight, and indicatorSpaceBottom parameters control the appearance and behavior of the bottom navigation bar.

Example usage:

AdaptiveBottomNavigation(
  icons: [Icons.home, Icons.search, Icons.person],
  labels: ['Home', 'Search', 'Profile'],
  pages: [HomePage(), SearchPage(), ProfilePage()],
  selectedColor: Colors.blue,
  unselectedColor: Colors.grey,
  backgroundColor: Colors.white,
  iconSize: 30.0,
  animationDuration: Duration(milliseconds: 300),
  animationIndicatorCurve: Curves.easeIn,
  animationIconCurve: Curves.easeOut,
  indicatorDecoration: BoxDecoration(
    color: Colors.blue,
    borderRadius: BorderRadius.circular(10),
  ),
  itemDecoration: BoxDecoration(
    border: Border(
      top: BorderSide(color: Colors.grey, width: 0.5),
    ),
  ),
  bottomNavigationDecoration: BoxDecoration(
    boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 10)],
  ),
  height: 60.0,
  indicatorHeight: 4.0,
  indicatorSpaceBottom: 2.0,
);
Inheritance

Constructors

AdaptiveBottomNavigation.new({Key? key, double iconSize = 24.0, required List<IconData> icons, required List<String> labels, required List<Widget> pages, Color selectedColor = Colors.black, Color unselectedColor = Colors.black38, Color backgroundColor = Colors.white, Duration animationDuration = const Duration(milliseconds: 300), Curve animationIndicatorCurve = Curves.easeIn, Curve animationIconCurve = Curves.easeOut, BoxDecoration? indicatorDecoration, BoxDecoration? itemDecoration, BoxDecoration? bottomNavigationDecoration, double height = 60.0, double indicatorHeight = 4.0, double indicatorSpaceBottom = 2.0})
Creates an AdaptiveBottomNavigation.
const

Properties

animationDuration Duration
final
animationIconCurve Curve
final
animationIndicatorCurve Curve
final
backgroundColor Color
final
bottomNavigationDecoration BoxDecoration?
final
controller AdaptiveBottomNavigationController
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
height double
final
icons List<IconData>
final
iconSize double
final
indicatorDecoration BoxDecoration?
final
indicatorHeight double
final
indicatorSpaceBottom double
final
itemDecoration BoxDecoration?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labels List<String>
final
pages List<Widget>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedColor Color
final
tag String?
finalinherited
unselectedColor Color
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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