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