ChartContainer class
Modern container wrapper for charts with glassmorphism and neumorphism effects.
This widget provides a consistent, professional container for all chart types with support for titles, subtitles, loading states, error states, and modern visual effects.
Features
- Title and subtitle support
- Loading state with spinner and message
- Error state with icon and message
- Glassmorphism effect (frosted glass appearance)
- Neumorphism effect (soft shadow appearance)
- Full theme support
- Accessibility support with semantic labels
- Responsive padding and spacing
Example
ChartContainer(
theme: ChartTheme.light(),
title: 'Sales Chart',
subtitle: 'Monthly revenue',
useGlassmorphism: true,
isLoading: false,
child: MyChartWidget(...),
)
See also:
- ChartTheme for theme configuration
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ChartContainer
Constructors
-
ChartContainer({Key? key, required Widget child, ChartTheme? theme, EdgeInsets? padding, String? title, String? subtitle, Widget? header, bool useGlassmorphism = false, bool useNeumorphism = false, bool isLoading = false, bool isError = false, String? errorMessage, Widget? errorWidget, List<
BoxShadow> ? boxShadow}) -
Creates a chart container.
const
Properties
-
boxShadow
→ List<
BoxShadow> ? -
final
- child → Widget
-
final
- errorMessage → String?
-
final
- errorWidget → Widget?
-
Custom widget shown when isError is true. If null, default error UI with errorMessage is used.
final
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
final
- isError → bool
-
final
- isLoading → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- padding → EdgeInsets?
-
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
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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