CustomThermometer class

Fully customizable thermometer widget

Usage:

CustomThermometer(
  temperature: 25.0,
  mercuryColor: Colors.red,
  showBorder: true,
  borderColor: Colors.black,
  showFahrenheit: true,
  showCelsius: true,
)
Inheritance

Constructors

CustomThermometer({Key? key, required double temperature, Color? mercuryColor, Gradient? mercuryGradient, Color? bulbColor, Gradient? bulbGradient, Color tubeColor = Colors.white, Gradient? tubeGradient, bool showBorder = true, Color borderColor = Colors.white, double borderWidth = 2.0, bool showFahrenheit = true, bool showCelsius = true, Color scaleColor = Colors.grey, double scaleTextSize = 11, double height = 380, double width = 50, double bulbSize = 70, Duration animationDuration = const Duration(milliseconds: 500), Curve animationCurve = Curves.easeOut})
const

Properties

animationCurve → Curve
Animation curve for mercury movement
final
animationDuration → Duration
Duration of mercury rise/fall animation
final
borderColor → Color
Color of the border
final
borderWidth → double
Width of the border
final
bulbColor → Color?
Solid color for bulb. Ignored if bulbGradient is provided
final
bulbGradient → Gradient?
Gradient for bulb. Overrides bulbColor if provided
final
bulbSize → double
Size of the bulb at the bottom
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Height of the thermometer tube
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mercuryColor → Color?
Solid color for mercury/liquid. Ignored if mercuryGradient is provided
final
mercuryGradient → Gradient?
Gradient for mercury/liquid. Overrides mercuryColor if provided
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaleColor → Color
Color of scale markings and numbers
final
scaleTextSize → double
Font size of scale numbers
final
showBorder → bool
Whether to show border around tube and bulb
final
showCelsius → bool
Whether to show Celsius scale on the right
final
showFahrenheit → bool
Whether to show Fahrenheit scale on the left
final
temperature → double
Temperature value in Celsius (range: -30 to 60)
final
tubeColor → Color
Background color of the tube
final
tubeGradient → Gradient?
Gradient for tube background. Overrides tubeColor if provided
final
width → double
Width of the thermometer tube
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