ConvexAppBar.builder constructor

const ConvexAppBar.builder({
  1. Key? key,
  2. required DelegateBuilder itemBuilder,
  3. required int count,
  4. int? initialActiveIndex,
  5. bool disableDefaultTabController = false,
  6. GestureTapIndexCallback? onTap,
  7. TapNotifier? onTapNotify,
  8. TabController? controller,
  9. Color? backgroundColor,
  10. Color? shadowColor,
  11. Gradient? gradient,
  12. double? height,
  13. double? curveSize,
  14. double? top,
  15. double? elevation,
  16. double? cornerRadius,
  17. Curve curve = Curves.easeInOut,
  18. ChipBuilder? chipBuilder,
})

Define a custom tab style by implement a DelegateBuilder.

ConvexAppBar(
  count: 5,
  itemBuilder: Builder(),
)

class Builder extends DelegateBuilder {
  @override
  Widget build(BuildContext context, int index, bool active) {
    return Text('TAB $index');
  }
}

Implementation

const ConvexAppBar.builder({
  Key? key,
  required this.itemBuilder,
  required this.count,
  this.initialActiveIndex,
  this.disableDefaultTabController = false,
  this.onTap,
  this.onTapNotify,
  this.controller,
  this.backgroundColor,
  this.shadowColor,
  this.gradient,
  this.height,
  this.curveSize,
  this.top,
  this.elevation,
  this.cornerRadius,
  this.curve = Curves.easeInOut,
  this.chipBuilder,
})  : assert(top == null || top <= 0, 'top should be negative'),
      assert(initialActiveIndex == null || initialActiveIndex < count,
          'initial index should < $count'),
      assert(cornerRadius == null || cornerRadius >= 0,
          'cornerRadius must >= 0'),
      super(key: key);