ClockWidget class

A widget that displays a digital clock made of analog clock faces.

Inheritance

Constructors

ClockWidget.clock({Key? key, double clockSize = 20.0, double? height, ClockColors colors = const ClockColors(), bool twelveHourFormat = false, bool shadow = true, double borderWidth = 2.0, double handWidth = 2.0, ClockController? controller, bool showControls = false, bool showStartButton = true, bool showPauseButton = true, bool showResetButton = true, String startButtonText = 'Start', String pauseButtonText = 'Pause', String resetButtonText = 'Reset', double? buttonWidth, double? buttonHeight, double? buttonFontSize, EdgeInsets? buttonPadding, bool showPeriodIndicator = true, bool showHours = true, bool showMinutes = true, bool showSeconds = true})
Creates a ClockWidget that displays the current time.
const
ClockWidget.static({Key? key, double clockSize = 20.0, double? height, ClockColors colors = const ClockColors(), bool twelveHourFormat = false, bool shadow = true, double borderWidth = 2.0, double handWidth = 2.0, required DateTime? staticTime, bool animateToPosition = true, bool showPeriodIndicator = true, bool showHours = true, bool showMinutes = true, bool showSeconds = true})
Creates a ClockWidget that displays a static, non-updating time.
const
ClockWidget.stopwatch({Key? key, double clockSize = 20.0, double? height, ClockColors colors = const ClockColors(), double borderWidth = 2.0, double handWidth = 2.0, required ClockController? controller, bool showControls = false, bool showStartButton = true, bool showPauseButton = true, bool showResetButton = true, String startButtonText = 'Start', String pauseButtonText = 'Pause', String resetButtonText = 'Reset', double? buttonWidth, double? buttonHeight, double? buttonFontSize, EdgeInsets? buttonPadding, bool showPeriodIndicator = true, bool showHours = true, bool showMinutes = true, bool showSeconds = true})
Creates a ClockWidget that functions as a stopwatch.
const
ClockWidget.timer({Key? key, double clockSize = 20.0, double? height, ClockColors colors = const ClockColors(), Duration? initialTimerDuration, bool shadow = true, double borderWidth = 2.0, double handWidth = 2.0, required ClockController? controller, bool showControls = false, bool showStartButton = true, bool showPauseButton = true, bool showResetButton = true, String startButtonText = 'Start', String pauseButtonText = 'Pause', String resetButtonText = 'Reset', double? buttonWidth, double? buttonHeight, double? buttonFontSize, EdgeInsets? buttonPadding, bool showPeriodIndicator = true, bool showHours = true, bool showMinutes = true, bool showSeconds = true})
Creates a ClockWidget that functions as a countdown timer.
const

Properties

animateToPosition → bool
Whether to animate the clock hands to their initial position in ClockMode.static.
final
borderWidth → double
The width of the border for each clock segment.
final
buttonFontSize → double?
The font size for the control button text.
final
buttonHeight → double?
The height of the control buttons.
final
buttonPadding → EdgeInsets?
The padding for the control buttons.
final
buttonWidth → double?
The width of the control buttons.
final
clockSize → double
The size of each individual clock segment.
final
colors → ClockColors
The color scheme for the clock.
final
controller → ClockController?
A controller for the timer and stopwatch modes.
final
handWidth → double
The width of the hands for each clock segment.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
The height of the widget. If null, it's calculated based on clockSize.
final
initialTimerDuration → Duration?
The initial duration for the timer.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mode → ClockMode
The mode of operation for the clock.
final
pauseButtonText → String
The text for the pause button.
final
resetButtonText → String
The text for the reset button.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shadow → bool
Whether to display shadows on the clock faces.
final
showControls → bool
Whether to show the control buttons (start, pause, reset).
final
showHours → bool
Whether to show the hours component of the time.
final
showMinutes → bool
Whether to show the minutes component of the time.
final
showPauseButton → bool
Whether to show the pause button.
final
showPeriodIndicator → bool
Whether to show the AM/PM period indicator when using 12-hour format.
final
showResetButton → bool
Whether to show the reset button.
final
showSeconds → bool
Whether to show the seconds component of the time.
final
showStartButton → bool
Whether to show the start button.
final
startButtonText → String
The text for the start button.
final
staticTime → DateTime?
The static time to display in ClockMode.static.
final
twelveHourFormat → bool
Whether to use 12-hour format with an AM/PM indicator.
final

Methods

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