HorizontalView class

Horizontal scrolling calendar view.

Shows dates of the selected month horizontally with single-date selection and optional custom decorations for default, marked, and selected states.

Inheritance

Constructors

HorizontalView({Key? key, BoxDecoration? decoration, BoxDecoration? userPickedDecoration, Widget? defaultChild, Widget? userPickedChild, bool showMonthYearPicker = false, TextStyle? headerTextStyle, Color? headerIconColor, double? headerHeight, Color? monthYearPickerSelectedMonthColor, Color? monthYearPickerUnselectedMonthColor, int? monthYearPickerCrossAxisCount, double? monthYearPickerChildAspectRatio, BoxDecoration? monthYearPickerMonthItemDecoration, bool showWeekDays = true, TextStyle? dateTextStyle, TextStyle? weekDaysTextStyle, TextStyle? selectedDateTextStyle, TextStyle? selectedWeekDaysTextStyle, DateTime? endDate, DateTime? initialDate, bool autoScroll = true, MCalendarController? controller, CalendarAnimations? animations, required DateTime selectedMonth, required void onUserPicked(DateTime)})
Creates a new instance of the HorizontalView widget.
const
HorizontalView.defaults({required DateTime selectedMonth, required void onUserPicked(DateTime), bool showWeekDays = true, TextStyle? dateTextStyle, TextStyle? weekDaysTextStyle, TextStyle? selectedDateTextStyle, TextStyle? selectedWeekDaysTextStyle, DateTime? initialDate, DateTime? endDate, MCalendarController? controller, CalendarAnimations? animations})
Default factory constructor with pre-configured decorations.
factory

Properties

animations → CalendarAnimations?
Optional animation configuration. When null (the default) every update is instant.
final
autoScroll → bool
If true the view will automatically scroll to initialDate when first built.
final
controller → MCalendarController?
Optional controller to programmatically drive calendar navigation and selections.
final
dateTextStyle → TextStyle?
Text style used for the date number in non-selected cells.
final
decoration → BoxDecoration?
Decoration applied to non-selected date cells.
final
defaultChild → Widget?
Optional widget used for unselected date cells.
final
endDate → DateTime?
Optional latest selectable date. Dates after this will be unselectable.
final
hashCode → int
The hash code for this object.
no setterinherited
headerHeight → double?
Height used by the month/year picker when displayed.
final
headerIconColor → Color?
Color used for header navigation icons.
final
headerTextStyle → TextStyle?
Style applied to the header text in the month/year picker.
final
initialDate → DateTime?
Optional date to scroll to on first build (if autoScroll is true) and earliest selectable date.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
monthYearPickerChildAspectRatio → double?
Child aspect ratio used for month tiles in the picker grid.
final
monthYearPickerCrossAxisCount → int?
Number of columns used when showing months in the picker grid.
final
monthYearPickerMonthItemDecoration → BoxDecoration?
Decoration applied to each month item inside the month picker.
final
monthYearPickerSelectedMonthColor → Color?
Color used for the selected month item in the month picker.
final
monthYearPickerUnselectedMonthColor → Color?
Color used for unselected month items in the month picker.
final
onUserPicked → void Function(DateTime)
Callback fired with the picked date when tapped.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedDateTextStyle → TextStyle?
Text style used for the date number in the selected cell.
final
selectedMonth → DateTime
The month displayed in this view.
final
selectedWeekDaysTextStyle → TextStyle?
Text style used for the weekday label in the selected cell.
final
showMonthYearPicker → bool
Whether to show the month/year picker header above the list.
final
showWeekDays → bool
Whether to display the weekday labels under each date.
final
userPickedChild → Widget?
Optional widget used for the selected date cell.
final
userPickedDecoration → BoxDecoration?
Decoration applied to the currently selected date cell.
final
weekDaysTextStyle → TextStyle?
Text style used for the weekday label in non-selected cells.
final

Methods

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