TDCalendar class

日历组件

Inheritance

Constructors

TDCalendar({Key? key, int? firstDayOfWeek = 0, CalendarFormat? format, int? maxDate, int? minDate, String? title, Widget? titleWidget, CalendarType? type = CalendarType.single, List<int>? value, String? displayFormat = 'year month', double? cellHeight = 60, double? height, double? width, TDCalendarStyle? style, void onChange(List<int> value)?, void onCellClick(int value, DateSelectType type, TDate tdate)?, void onCellLongPress(int value, DateSelectType type, TDate tdate)?, void onHeaderClick(int index, String week)?, bool? useSafeArea = true, bool? useTimePicker = false, List<DatePickerModel>? timePickerModel, double? monthTitleHeight = 22, Widget monthTitleBuilder(BuildContext context, DateTime monthDate)?, double? pickerHeight = 178, int? pickerItemCount = 3, bool? isTimeUnit = true, bool? animateTo = false, Widget? cellWidget(BuildContext context, TDate tdate, DateSelectType selectType)?, ValueChanged<DateTime>? onMonthChange, DateTime? anchorDate})
const

Properties

anchorDate DateTime?
锚点日期
final
animateTo bool?
动画滚动到指定位置
final
cellHeight double?
日期高度
final
cellWidget Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)?
自定义日期单元格组件
final
displayFormat String?
年月显示格式,year表示年,month表示月,如year month表示年在前、月在后、中间隔一个空格
final
firstDayOfWeek int?
第一天从星期几开始,默认 0 = 周日
final
format CalendarFormat?
用于格式化日期的函数,可定义日期前后的显示内容和日期样式
final
hashCode int
The hash code for this object.
no setterinherited
height double?
高度
final
isTimeUnit bool?
是否显示时间单位
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxDate int?
最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后
final
minDate int?
最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天
final
monthTitleBuilder Widget Function(BuildContext context, DateTime monthDate)?
月标题构建器
final
monthTitleHeight double?
月标题高度
final
onCellClick → void Function(int value, DateSelectType type, TDate tdate)?
点击日期时触发
final
onCellLongPress → void Function(int value, DateSelectType type, TDate tdate)?
长安日期时触发
final
onChange → void Function(List<int> value)?
选中值变化时触发
final
onHeaderClick → void Function(int index, String week)?
点击周时触发
final
onMonthChange ValueChanged<DateTime>?
月份变化时触发
final
pickerHeight double?
时间选择器List的视窗高度
final
pickerItemCount int?
选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TDCalendarStyle?
自定义样式
final
timePickerModel List<DatePickerModel>?
自定义时间选择器
final
title String?
标题
final
titleWidget Widget?
标题组件
final
type CalendarType?
日历的选择类型,single = 单选;multiple = 多选;range = 区间选择
final
useSafeArea bool?
是否使用安全区域,默认true
final
useTimePicker bool?
是否显示时间选择器
final
value List<int>?
当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1
final
width double?
宽度
final

Methods

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