CalendarView class

日历组件 包括月视图,周视图、日期单选、日期范围选等功能。 1、点击不同月份日期,自动切换到最新选中日期所在月份。 2、日历组件支持时间范围展示,仅展示范围内的日历视图,范围外日期置灰不可点击。日期范围边界后不可再翻页。

Inheritance

Constructors

CalendarView({Key? key, SelectMode selectMode = SelectMode.single, DisplayMode displayMode = DisplayMode.month, List<String>? weekNames, bool showControllerBar = true, DateTime? initStartSelectedDate, DateTime? initEndSelectedDate, DateTime? initDisplayDate, CalendarDateChange? dateChange, CalendarRangeDateChange? rangeDateChange, DateTime? minDate, DateTime? maxDate})
CalendarView.range({Key? key, DisplayMode displayMode = DisplayMode.month, List<String>? weekNames, bool showControllerBar = true, DateTime? initStartSelectedDate, DateTime? initEndSelectedDate, DateTime? initDisplayDate, required CalendarRangeDateChange? rangeDateChange, DateTime? minDate, DateTime? maxDate})
选择时间-时间范围选择
CalendarView.single({Key? key, DisplayMode displayMode = DisplayMode.month, List<String>? weekNames, bool showControllerBar = true, DateTime? initStartSelectedDate, DateTime? initEndSelectedDate, DateTime? initDisplayDate, required CalendarDateChange? dateChange, DateTime? minDate, DateTime? maxDate})
选择时间-单选构造 仅能选择一个日期

Properties

dateChange CalendarDateChange?
single 类型选择日期回调
final
displayMode DisplayMode
展示模式, Week, Month
final
hashCode int
The hash code for this object.
no setterinherited
initDisplayDate DateTime?
初始展示月份
final
initEndSelectedDate DateTime?
日历日期初始选中最大值
final
initStartSelectedDate DateTime?
日历日期初始选中最小值
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxDate DateTime?
日历日期选择范围最大值
final
minDate DateTime?
日历日期选择范围最小值
final
rangeDateChange CalendarRangeDateChange?
range 类型选择日期回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectMode SelectMode
选择模式, 单选, 范围选择
final
showControllerBar bool
是否展示顶部控制按钮
final
weekNames List<String>?
自定义星期的名称
final

Methods

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