TDBottomTabBar constructor
TDBottomTabBar(
- TDBottomTabBarBasicType basicType, {
- Key? key,
- TDBottomTabBarComponentType? componentType = TDBottomTabBarComponentType.label,
- TDBottomTabBarOutlineType? outlineType = TDBottomTabBarOutlineType.filled,
- double? barHeight = _kDefaultTabBarHeight,
- bool? useVerticalDivider,
- double? dividerHeight,
- double? dividerThickness,
- Color? dividerColor,
- bool? showTopBorder = true,
- BorderSide? topBorder,
Implementation
TDBottomTabBar(
this.basicType, {
Key? key,
this.componentType = TDBottomTabBarComponentType.label,
this.outlineType = TDBottomTabBarOutlineType.filled,
required this.navigationTabs,
this.barHeight = _kDefaultTabBarHeight,
this.useVerticalDivider,
this.dividerHeight,
this.dividerThickness,
this.dividerColor,
this.showTopBorder = true,
this.topBorder,
}) : assert(() {
if (navigationTabs.isEmpty) {
throw FlutterError(
'[TDBottomTabBar] please set at least one tab!');
}
if (basicType == TDBottomTabBarBasicType.text) {
for (final item in navigationTabs) {
if (item.tabText == null) {
throw FlutterError(
'[TDBottomTabBar] type is TDBottomBarType.text, but not set text.');
}
}
}
if (basicType == TDBottomTabBarBasicType.icon) {
for (final item in navigationTabs) {
if (item.iconTypeConfig == null) {
throw FlutterError(
'[TDBottomTabBar] type is TDBottomBarType.icon,'
'but has no iconTypeConfig instance.');
}
}
}
if (basicType == TDBottomTabBarBasicType.iconText) {
for (final item in navigationTabs) {
if (item.iconTextTypeConfig == null) {
throw FlutterError(
'[TDBottomTabBar] type is TDBottomBarType.iconText,'
'but has no iconTextConfig instance.');
}
}
}
return true;
}()),
super(key: key);