|
| 1 | +## API |
| 2 | +### TDCalendarStyle |
| 3 | +#### 默认构造方法 |
| 4 | + |
| 5 | +| 参数 | 类型 | 默认值 | 说明 | |
| 6 | +| --- | --- | --- | --- | |
| 7 | +| decoration | | - | | |
| 8 | +| titleStyle | TextStyle? | - | header区域 [TDCalendar.title]的样式 | |
| 9 | +| titleMaxLine | int? | - | header区域 [TDCalendar.title]的行数 | |
| 10 | +| titleCloseColor | Color? | - | header区域 关闭图标的颜色 | |
| 11 | +| weekdayStyle | TextStyle? | - | header区域 周 文字样式 | |
| 12 | +| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 | |
| 13 | +| cellStyle | TextStyle? | - | 日期样式 | |
| 14 | +| centreColor | Color? | - | 日期范围内背景样式 | |
| 15 | +| cellDecoration | BoxDecoration? | - | 日期decoration | |
| 16 | +| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 | |
| 17 | +| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 | |
| 18 | + |
| 19 | + |
| 20 | +#### 工厂构造方法 |
| 21 | + |
| 22 | +| 名称 | 说明 | |
| 23 | +| --- | --- | |
| 24 | +| TDCalendarStyle.generateStyle | 生成默认样式 | |
| 25 | +| TDCalendarStyle.cellStyle | 日期样式 | |
| 26 | + |
| 27 | +``` |
| 28 | +``` |
| 29 | + ### TDCalendar |
| 30 | +#### 默认构造方法 |
| 31 | + |
| 32 | +| 参数 | 类型 | 默认值 | 说明 | |
| 33 | +| --- | --- | --- | --- | |
| 34 | +| key | | - | | |
| 35 | +| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 | |
| 36 | +| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 | |
| 37 | +| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 | |
| 38 | +| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 | |
| 39 | +| title | String? | - | 标题 | |
| 40 | +| titleWidget | Widget? | - | 标题组件 | |
| 41 | +| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择 | |
| 42 | +| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 | |
| 43 | +| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 | |
| 44 | +| cellHeight | double? | 60 | 日期高度 | |
| 45 | +| height | double? | - | 高度 | |
| 46 | +| width | double? | - | 宽度 | |
| 47 | +| style | TDCalendarStyle? | - | 自定义样式 | |
| 48 | +| onChange | void Function(List<int> value)? | - | 选中值变化时触发 | |
| 49 | +| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 | |
| 50 | +| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 | |
| 51 | +| onHeanderClick | void Function(int index, String week)? | - | 点击周时触发 | |
| 52 | + |
| 53 | +``` |
| 54 | +``` |
| 55 | + ### TDCalendarPopup |
| 56 | +#### 默认构造方法 |
| 57 | + |
| 58 | +| 参数 | 类型 | 默认值 | 说明 | |
| 59 | +| --- | --- | --- | --- | |
| 60 | +| context | BuildContext | context | 上下文 | |
| 61 | +| top | double? | - | 距离顶部的距离 | |
| 62 | +| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 | |
| 63 | +| confirmBtn | Widget? | - | 自定义确认按钮 | |
| 64 | +| visible | bool? | - | 默认是否显示日历 | |
| 65 | +| onClose | VoidCallback? | - | 关闭时触发 | |
| 66 | +| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 | |
| 67 | +| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] | |
| 68 | +| child | TDCalendar? | - | 日历控件 | |
0 commit comments