GaugeIndicator class

A beautiful and customizable gauge indicator widget.

This widget displays a gauge/speedometer-style progress indicator with extensive customization options.

Example usage:

GaugeIndicator(
  value: 0.75,
  size: 200,
  strokeWidth: 20,
  valueColor: Colors.blue,
  backgroundColor: Colors.grey.shade300,
  showValue: true,
)
Inheritance

Constructors

GaugeIndicator({Key? key, double value = 0.0, double size = 200.0, double strokeWidth = 15.0, Color valueColor = Colors.blue, Color backgroundColor = const Color(0xFFE0E0E0), Gradient? gradient, double startAngle = 135.0, double sweepAngle = 270.0, bool showValue = true, GaugeLabelPosition labelPosition = GaugeLabelPosition.center, String valueFormatter(double value)?, TextStyle? valueTextStyle, Widget? center, bool animation = false, Duration animationDuration = const Duration(milliseconds: 500), Curve animationCurve = Curves.easeInOut, GaugeStyle gaugeStyle = GaugeStyle.simple, int tickCount = 10, double tickLength = 8.0, Color? tickColor, List<GaugeSegment>? segments, List<GaugeRange>? ranges, bool showNeedle = false, Color needleColor = Colors.red, double needleLength = 0.8, bool showMinMax = false, String? minLabel, String? maxLabel, TextStyle? minMaxTextStyle, Widget? title, Widget? subtitle, StrokeCap strokeCap = StrokeCap.round, VoidCallback? onAnimationEnd})
Creates a gauge indicator widget.
const

Properties

animation bool
Whether to animate value changes.
final
animationCurve Curve
The curve for the animation.
final
animationDuration Duration
The duration of the animation.
final
backgroundColor Color
The background color of the gauge arc.
final
center Widget?
Optional widget to display in the center.
final
gaugeStyle GaugeStyle
The style of the gauge.
final
gradient Gradient?
Optional gradient for the value arc.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelPosition GaugeLabelPosition
The position of the value label.
final
maxLabel String?
The maximum value label.
final
minLabel String?
The minimum value label.
final
minMaxTextStyle TextStyle?
The text style for min/max labels.
final
needleColor Color
The color of the needle.
final
needleLength double
The length of the needle (as a fraction of radius).
final
onAnimationEnd VoidCallback?
Callback when animation completes.
final
ranges List<GaugeRange>?
Ranges for coloring different value ranges.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
segments List<GaugeSegment>?
Segments for segmented gauge style.
final
showMinMax bool
Whether to show the min and max labels.
final
showNeedle bool
Whether to show a needle pointer.
final
showValue bool
Whether to show the value as text.
final
size double
The size of the gauge (width and height).
final
startAngle double
The starting angle in degrees (0 = right, 90 = bottom, 180 = left, 270 = top).
final
strokeCap StrokeCap
The stroke cap style.
final
strokeWidth double
The width of the gauge arc stroke.
final
subtitle Widget?
Optional subtitle widget below the gauge.
final
sweepAngle double
The sweep angle in degrees.
final
tickColor Color?
The color of tick marks.
final
tickCount int
Number of tick marks (for ticked style).
final
tickLength double
The length of tick marks.
final
title Widget?
Optional title widget above the gauge.
final
value double
The current value between 0.0 and 1.0.
final
valueColor Color
The color of the value indicator.
final
valueFormatter String Function(double value)?
Custom format function for the value label.
final
valueTextStyle TextStyle?
The text style for the value label.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<GaugeIndicator>
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