SpotlightBottomNavigationBar constructor
SpotlightBottomNavigationBar({
- Key? key,
- required List<
SpotlightBottomNavigationBarItem> items, - ValueChanged<
int> ? onTap, - required int currentIndex,
- bool darkTheme = true,
- Color unselectedItemColor = const Color(0xff666666),
- Color selectedItemColor = const Color(0xffffffff),
- Color backgroundColor = const Color(0xff101010),
- double iconSize = 24.0,
- IconThemeData? unselectedIconTheme,
- IconThemeData? selectedIconTheme,
- Gradient? spotlightGradient,
Creates a spotlight bottom navigation bar which can be used with Scaffold's Scaffold.bottomNavigationBar argument.
The length of items
should be at least 2 and each item's icon property
must not be null.
The selectedItemColor
, unselectedItemColor
and
backgroundColor
must not be null.
The iconSize
must be non-null and non-negative.
If custom IconThemeData are used then it will override the
selectedItemColor
and unselectedItemColor
, and the custom
IconThemeData must have a non-null IconThemeData.color and
IconThemeData.size.
The selectedItemColor
will be used for the Top Bar highlighting the
active item regardless of selectedIconTheme.color
.
The spotlightGradient
parameter can be used to give a custom Gradient
for the spotlight.
Implementation
SpotlightBottomNavigationBar({
Key? key,
required this.items,
this.onTap,
required this.currentIndex,
this.darkTheme = true,
this.unselectedItemColor = const Color(0xff666666),
this.selectedItemColor = const Color(0xffffffff),
this.backgroundColor = const Color(0xff101010),
this.iconSize = 24.0,
this.unselectedIconTheme,
this.selectedIconTheme,
this.spotlightGradient,
}) : assert(items.length >= 2),
assert(0 <= currentIndex && currentIndex < items.length),
assert(iconSize >= 0.0),
assert(unselectedIconTheme == null ||
(unselectedIconTheme.color != null && unselectedIconTheme.size != null)),
assert(selectedIconTheme == null ||
(selectedIconTheme.color != null && selectedIconTheme.size != null)),
super(key: key);