ConvexAppBar.builder constructor
const
ConvexAppBar.builder({
- Key? key,
- required DelegateBuilder itemBuilder,
- required int count,
- int? initialActiveIndex,
- bool disableDefaultTabController = false,
- GestureTapIndexCallback? onTap,
- TapNotifier? onTapNotify,
- TabController? controller,
- Color? backgroundColor,
- Color? shadowColor,
- Gradient? gradient,
- double? height,
- double? curveSize,
- double? top,
- double? elevation,
- double? cornerRadius,
- Curve curve = Curves.easeInOut,
- 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);