PyramidChartWidget class
A pyramid chart widget displaying hierarchical data in a pyramid shape.
Each segment represents a category, with the largest at the bottom and smallest at the top, creating a pyramid visualization. Useful for displaying hierarchical data such as population distribution or sales funnels.
Features
- Hierarchical data visualization
- Interactive segment tapping with visual border highlighting
- Gradient fills
- Smooth animations
- Full theme support
Example
PyramidChartWidget(
data: [
PieData(label: 'Level 1', value: 100, color: Colors.blue),
PieData(label: 'Level 2', value: 75, color: Colors.green),
PieData(label: 'Level 3', value: 50, color: Colors.orange),
PieData(label: 'Level 4', value: 25, color: Colors.red),
],
theme: ChartTheme.light(),
title: 'Sales Funnel',
onSegmentTap: (segment, segmentIndex, position) {
// Handle segment tap
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PyramidChartWidget
Constructors
-
PyramidChartWidget({Key? key, required List<
PieData> data, ChartTheme? theme, String? title, String? subtitle, bool useGlassmorphism = false, bool useNeumorphism = false, PieSegmentCallback? onSegmentTap, bool isLoading = false, bool isError = false, String? errorMessage})
Properties
-
data
→ List<
PieData> -
final
- errorMessage → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
final
- isLoading → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onSegmentTap → PieSegmentCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subtitle → String?
-
final
- theme → ChartTheme?
-
final
- title → String?
-
final
- useGlassmorphism → bool
-
final
- useNeumorphism → bool
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PyramidChartWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited