BookingRangeSlider class

A widget which allows you to easily select booking/reservation ranges.

Usage example:

BookingRangeSlider(
              onChanged: (value) {
                print(value);
              },
              displayHandles: true,
              labelFrequency: TimeOfDay(hour: 1, minute: 0),
              initialTime: TimeOfDay(hour: 0, minute: 0),
              endingTime: TimeOfDay(hour: 6, minute: 0),
              values: <BookingValues>[
                BookingValues(
                  TimeOfDay(hour: 1, minute: 0),
                  TimeOfDay(hour: 2, minute: 0),
                ),
                BookingValues(
                  TimeOfDay(hour: 3, minute: 0),
                  TimeOfDay(hour: 3, minute: 30),
                ),
                BookingValues(
                  TimeOfDay(hour: 4, minute: 0),
                  TimeOfDay(hour: 5, minute: 0),
                  isAvailable: true,
                ),
                BookingValues(
                  TimeOfDay(hour: 5, minute: 30),
                  TimeOfDay(hour: 6, minute: 0),
                ),
              ],
            )
Inheritance

Constructors

BookingRangeSlider({Key? key, Color unavailableColor = _defaultColorRed, Color availableColor = _defaultColorGreen, Color selectedColor = _defaultColorSelected, bool displayHandles = true, bool displayLabels = true, bool highlightSelected = true, TextStyle labelStyle = _defaultLabelStyle, TimeOfDay labelFrequency = const TimeOfDay(hour: 4, minute: 0), TimeOfDay initialTime = const TimeOfDay(hour: 0, minute: 0), TimeOfDay endingTime = const TimeOfDay(hour: 0, minute: 0), TimeOfDay division = const TimeOfDay(hour: 0, minute: 30), required ValueChanged<BookingValues>? onChanged, required List<BookingValues> values})
const

Properties

availableColor Color
Color for displaying available/free BookingValues ranges. Defaults to green color.
final
displayHandles bool
Whether should be displayed handles at the bounds of selected BookingValues range. Defaults to true.
final
displayLabels bool
Whether should be displayed labels at top of the BookingRangeSlider slider. Defaults to true.
final
division TimeOfDay
What TimeOfDay values can be iterated for each handle drag. Defaults to 30 minutes.
final
endingTime TimeOfDay
Ending/final boundary of the left side of BookingRangeSlider. Defaults to 0h 0min.
final
hashCode int
The hash code for this object.
no setterinherited
highlightSelected bool
Whether should be highlighted the current selected BookingValues range. Defaults to true.
final
initialTime TimeOfDay
Initial/starting boundary of the left side of BookingRangeSlider. Defaults to 0h 0min.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelFrequency TimeOfDay
How often should be displayed the label above the BookingRangeSlider slider. Defaults to each 4 hours.
final
labelStyle TextStyle
The TextStyle of the label.
final
onChanged ValueChanged<BookingValues>?
Triggered when the handle position changes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedColor Color
Color for displaying the current selected BookingValues range. Defaults to orange color.
final
unavailableColor Color
Color for displaying unavailable/booked BookingValues ranges. Defaults to red color.
final
values List<BookingValues>
List of BookingValues which will fill the BookingRangeSlider by the isAvailable property of BookingValues. Not every range is needed to be filled - the rest of unfilled area will be filled with green BookingValues values by default.
final

Methods

createElement() LeafRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) RenderObject
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
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.
override
didUnmountRenderObject(covariant RenderObject renderObject) → void
A render object previously associated with this widget has been removed from the tree. The given RenderObject will be of the same type as returned by this object's createRenderObject.
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
updateRenderObject(BuildContext context, covariant _RenderBookingSlider renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited