StatCard class
A modern, customizable stat card widget with icon, title, and value
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- StatCard
Constructors
- StatCard.new({Key? key, required String title, required String value, required IconData icon, Color? iconColor, Color? backgroundColor, TextStyle? titleStyle, TextStyle? valueStyle, BoxDecoration? decoration, EdgeInsetsGeometry padding = const EdgeInsets.all(16.0), Widget? trailing, double borderRadius = 12.0, double elevation = 2.0, VoidCallback? onTap, Widget titleBuilder(BuildContext context, String title)?, Widget iconBuilder(BuildContext context, IconData icon, Color? color)?})
-
Creates a StatCard widget
const
Properties
- backgroundColor → Color?
-
The background color of the card
final
- borderRadius → double
-
Border radius for the card
final
- decoration → BoxDecoration?
-
The decoration for the card
final
- elevation → double
-
The elevation of the card
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
The icon to be displayed in the card
final
- iconBuilder → Widget Function(BuildContext context, IconData icon, Color? color)?
-
Custom builder for the icon
final
- iconColor → Color?
-
The color of the icon
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → VoidCallback?
-
Callback function when the card is tapped
final
- padding → EdgeInsetsGeometry
-
The padding for the card contents
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
The title to be displayed in the card
final
- titleBuilder → Widget Function(BuildContext context, String title)?
-
Custom builder for the title
final
- titleStyle → TextStyle?
-
The text style for the title
final
- trailing → Widget?
-
Optional trailing widget (e.g., badge or arrow)
final
- value → String
-
The value to be displayed in the card
final
- valueStyle → TextStyle?
-
The text style for the value
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