TimeLabels class

Displays time labels for the calendar timeline.

Shows hourly time markers that can be customized with different styles and highlights the current hour if specified. Supports custom time label formatting through a builder function.

Features:

  • Configurable time range (start and end hours)
  • Current hour highlighting
  • Custom time label formatting
  • Support for 12-hour or 24-hour time formats
  • Responsive layout
  • Theme-aware styling
  • Automatic height calculation
  • Flexible positioning
  • Two display modes: hour-only and hour-with-half
Inheritance

Constructors

TimeLabels({Key? key, int startHour = 0, int endHour = 24, bool highlightCurrentHour = false, String customTimeLabelBuilder(DateTime)?, TextStyle? style, TimeLabelType? type = TimeLabelType.hourOnly})
Creates time labels for the calendar timeline.
const

Properties

customTimeLabelBuilder String Function(DateTime)?
Optional custom builder for time labels
final
endHour int
Last hour to display (0-23)
final
hashCode int
The hash code for this object.
no setterinherited
highlightCurrentHour bool
Whether to highlight the current hour (if viewing today)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startHour int
First hour to display (0-23)
final
style TextStyle?
Optional custom style for time labels
final
type TimeLabelType?
Type of time label display
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