TDBottomTabBar constructor

TDBottomTabBar(
  1. TDBottomTabBarBasicType basicType, {
  2. Key? key,
  3. TDBottomTabBarComponentType? componentType = TDBottomTabBarComponentType.label,
  4. TDBottomTabBarOutlineType? outlineType = TDBottomTabBarOutlineType.filled,
  5. required List<TDBottomTabBarTabConfig> navigationTabs,
  6. double? barHeight = _kDefaultTabBarHeight,
  7. bool? useVerticalDivider,
  8. double? dividerHeight,
  9. double? dividerThickness,
  10. Color? dividerColor,
  11. bool? showTopBorder = true,
  12. 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);