FunnelChart.defaultStyle constructor
FunnelChart.defaultStyle({})
漏斗图默认Bruno风格的命名构造函数,layerCount不能大于defaultLayerColors.length。
Implementation
FunnelChart.defaultStyle({
Key? key,
required this.layerCount,
required this.markerCount,
required MarkerBuilder builder,
this.maxLayerWidth = 200,
this.minLayerWidth = 0,
this.layerHeight = 40,
this.layerMargin = 0,
this.childOffset = Offset.zero,
}) : this.layerPainter = BrnDefaultFunnelLayerPainter(),
this.shape = FunnelShape.leftAndRight,
this.alignment = MarkerAlignment.right,
assert(layerCount <= defaultLayerColors.length && layerCount >= 0),
assert(maxLayerWidth >= minLayerWidth),
assert(layerCount - markerCount == 0 || layerCount - markerCount == 1),
super(
key: key,
children: () {
List<Widget> children = [];
for (int i = 0; i < markerCount; i++) {
children.add(builder(i));
}
return children;
}());