ScrollableTimeline class

A draggable, scrollable, Timeline showing minutes and seconds optionally synchronized with a timeStream

onDragStart : callback when the user start dragging the timeline, called with the current time value when dragging started. When in the dragging state, updates from timeStream are ignored

onDragUpdate: callback when drag position is updated

called with the selected time value during dragging onDragEnd : callback when the user stops dragging the timeline, called with the selected time value when dragging ended.

lengthSecs : the total number of seconds shown in the timeline

stepSecs : the time step to use between items in the timeline

timeStream : an optional stream of time values. when a value is received the timeline is scrolled to the received time value.

rulerOutsidePadding : outside padding of the the "|" ruler marks: top for the top ruler marks, and bottom for the bottom ruler marks

rulerInsidePadding : inside padding of the the "|" ruler marks: bottom for the top ruler marks and top for the bottom ruler marks

rulerSize : size of the top and bottom "|" ruler marks

showCursor true if the central cursor indicating the current selected time should be shown

cursorColor : color for the central cursor indicating the current selected time

activeItemTextColor : not currently used

itemTextColor : text color for minutes and seconds texts in the time line

itemExtent : width of each time mark item (with text of minutes and seconds)

showMinutes : true if both minutes and seconds should be shown in each time mark

shownSecsMultiples : number of seconds between shown seconds marks (1 by default)

backgroundColor : the background color of the timeline

nPadItems are empty items put at the beginning and end of real time items. They are needed in order to allow to scroll to very beginning time and very end time items, since the indicator is positioned in the center. the value of required pad items is <= 0.5*(widget width)/(itemExtent) the default value should be ok for all screens and platforms

Inheritance

Constructors

ScrollableTimeline({required int lengthSecs, required int stepSecs, Stream<double>? timeStream, dynamic onDragStart(double)?, dynamic onDragUpdate(double)?, bool enablePosUpdateWhileDragging = false, dynamic onVisibileTimeRangeUpdated(double)?, dynamic onDragEnd(double)?, required double height, double rulerOutsidePadding = 10, double rulerSize = 8, double rulerInsidePadding = 5, int nPadItems = 50, Color backgroundColor = Colors.white, bool showCursor = true, bool showMinutes = true, int shownSecsMultiples = 1, Color cursorColor = Colors.red, Color activeItemTextColor = Colors.blue, Color itemTextColor = Colors.grey, int itemExtent = 60})
the class constructor
const

Properties

activeItemTextColor Color
currently not used
final
backgroundColor Color
the background color of the timeline
final
cursorColor Color
color for the central cursor indicating the current selected time
final
enablePosUpdateWhileDragging bool
if true then enable update of current position according to time stream even while dragging, but only if this is not the widget that is driving the dragging
final
hashCode int
The hash code for this object.
no setterinherited
height double
the widget requested height
final
itemExtent int
width of each time mark item (with text of minutes and seconds)
final
itemTextColor Color
text color for minutes and seconds texts in the time line
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lengthSecs int
the total number of seconds shown in the timeline
final
nPadItems int
final
onDragEnd → (dynamic Function(double)?)
callback when the user stops dragging the timeline called with the selected time value when dragging ended.
final
onDragStart → (dynamic Function(double)?)
callback when the user start dragging the timeline
final
onDragUpdate → (dynamic Function(double)?)
called with the selected time value when during dragging when drag position is updated
final
onVisibileTimeRangeUpdated → (dynamic Function(double)?)
callback called when the visible time range is updated the argument is the updated timerange (in seconds)
final
rulerInsidePadding double
inside padding of the the "|" ruler marks
final
rulerOutsidePadding double
outside padding of the the "|" ruler marks
final
rulerSize double
size of the top and bottom "|" ruler marks
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCursor bool
true if the central cursor indicating the current selected time should be shown
final
showMinutes bool
true if both minutes and seconds should be shown in each time mark
final
shownSecsMultiples int
number of seconds between shown seconds marks (1 by default)
final
stepSecs int
the time step to use between items in the timeline
final
timeStream Stream<double>?
an optional stream of time values.
final

Methods

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