Skip to content

Commit b581da4

Browse files
liweijie0812autofix-ci[bot]RSS1102
authored
ci(auto-fix): 添加 site 文档同步 (#878)
* ci: 更新自动构建流程,添加文档生成步骤 * ci: 更新 Flutter 构建和测试命令 修改 Flutter 构建命令添加 --no-tree-shake-icons 参数 修正测试命令路径为 test/widget_test.dart * ci: 更新测试命令以使用扩展报告器 * ci: 允许小部件测试警告并继续生成 * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Update flutter build command in autofix.yml Removed target platform and no-tree-shake-icons option from flutter build command. * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: 阿菜 Cai <jimmyrss1102@gmail.com>
1 parent 35e1c21 commit b581da4

31 files changed

Lines changed: 547 additions & 469 deletions

File tree

.github/workflows/autofix.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ jobs:
3939
working-directory: ./tdesign-component/example
4040
run: flutter build apk -t ./lib/main.dart --release
4141

42+
- name: generate web documentation from demo code
43+
working-directory: ./tdesign-component/example
44+
run: |
45+
flutter test test/widget_test.dart --reporter expanded || {
46+
echo "⚠ Widget test completed with warnings (this is expected)"
47+
echo "Documentation should have been generated"
48+
}
49+
4250
- name: Sync README files
4351
run: node scripts/sync-readme.mjs
4452

tdesign-site/src/action-sheet/README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -887,25 +887,7 @@ Widget _buildIconListLeftActionSheet(BuildContext context) {
887887

888888

889889
## API
890-
### TDActionSheetItem
891-
#### 简介
892-
动作面板项目
893-
#### 默认构造方法
894-
895-
| 参数 | 类型 | 默认值 | 说明 |
896-
| --- | --- | --- | --- |
897-
| badge | TDBadge? | - | 角标 |
898-
| description | String? | - | 描述信息 |
899-
| disabled | bool | false | 是否禁用 |
900-
| group | String? | - | 分组,用于带描述多行滚动宫格 |
901-
| icon | Widget? | - | 图标 |
902-
| iconSize | double? | - | 图标大小 |
903-
| label | String | - | 标题 |
904-
| textStyle | TextStyle? | - | 标题样式 |
905-
906-
```
907-
```
908-
### TDActionSheet
890+
### TDActionSheet
909891
#### 简介
910892
动作面板
911893
#### 默认构造方法
@@ -942,5 +924,24 @@ Widget _buildIconListLeftActionSheet(BuildContext context) {
942924
| showGroupActionSheet | | required BuildContext context, required List<TDActionSheetItem> items, TDActionSheetAlign align, String? cancelText, bool showCancel, TDActionSheetItemCallback? onSelected, bool showOverlay, bool closeOnOverlayClick, double itemHeight, double itemMinWidth, VoidCallback? onCancel, VoidCallback? onClose, bool useSafeArea, | 显示分组类型面板 |
943925
| showListActionSheet | | required BuildContext context, required List<TDActionSheetItem> items, TDActionSheetAlign align, String? cancelText, bool showCancel, VoidCallback? onCancel, TDActionSheetItemCallback? onSelected, bool showOverlay, bool closeOnOverlayClick, VoidCallback? onClose, bool useSafeArea, | 显示列表类型面板 |
944926

927+
```
928+
```
929+
930+
### TDActionSheetItem
931+
#### 简介
932+
动作面板项目
933+
#### 默认构造方法
934+
935+
| 参数 | 类型 | 默认值 | 说明 |
936+
| --- | --- | --- | --- |
937+
| badge | TDBadge? | - | 角标 |
938+
| description | String? | - | 描述信息 |
939+
| disabled | bool | false | 是否禁用 |
940+
| group | String? | - | 分组,用于带描述多行滚动宫格 |
941+
| icon | Widget? | - | 图标 |
942+
| iconSize | double? | - | 图标大小 |
943+
| label | String | - | 标题 |
944+
| textStyle | TextStyle? | - | 标题样式 |
945+
945946

946947

tdesign-site/src/button/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,8 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
771771

772772
```
773773
```
774-
### TDButtonStyle
774+
775+
### TDButtonStyle
775776
#### 默认构造方法
776777

777778
| 参数 | 类型 | 默认值 | 说明 |

tdesign-site/src/calendar/README.md

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -821,45 +821,25 @@ Widget _buildBlock(BuildContext context) {
821821

822822

823823
## API
824-
### TDCalendar
824+
### TDCalendarPopup
825825
#### 默认构造方法
826826

827827
| 参数 | 类型 | 默认值 | 说明 |
828828
| --- | --- | --- | --- |
829-
| anchorDate | DateTime? | - | 锚点日期 |
830-
| animateTo | bool? | false | 动画滚动到指定位置 |
831-
| cellHeight | double? | 60 | 日期高度 |
832-
| cellWidget | Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)? | - | 自定义日期单元格组件 |
833-
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
834-
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
835-
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
836-
| height | double? | - | 高度 |
837-
| isTimeUnit | bool? | true | 是否显示时间单位 |
838-
| key | | - | |
839-
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
840-
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
841-
| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 |
842-
| monthTitleHeight | double? | 22 | 月标题高度 |
843-
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
844-
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
845-
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
846-
| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 |
847-
| onMonthChange | ValueChanged<DateTime>? | - | 月份变化时触发 |
848-
| pickerHeight | double? | 178 | 时间选择器List的视窗高度 |
849-
| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
850-
| style | TDCalendarStyle? | - | 自定义样式 |
851-
| timePickerModel | List<DatePickerModel>? | - | 自定义时间选择器 |
852-
| title | String? | - | 标题 |
853-
| titleWidget | Widget? | - | 标题组件 |
854-
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选;range = 区间选择 |
855-
| useSafeArea | bool? | true | 是否使用安全区域,默认true |
856-
| useTimePicker | bool? | false | 是否显示时间选择器 |
857-
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
858-
| width | double? | - | 宽度 |
829+
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
830+
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
831+
| child | TDCalendar? | - | 日历控件 |
832+
| confirmBtn | Widget? | - | 自定义确认按钮 |
833+
| context | BuildContext | context | 上下文 |
834+
| onClose | VoidCallback? | - | 关闭时触发 |
835+
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
836+
| top | double? | - | 距离顶部的距离 |
837+
| visible | bool? | - | 默认是否显示日历 |
859838

860839
```
861840
```
862-
### TDCalendarStyle
841+
842+
### TDCalendarStyle
863843
#### 默认构造方法
864844

865845
| 参数 | 类型 | 默认值 | 说明 |
@@ -886,20 +866,42 @@ Widget _buildBlock(BuildContext context) {
886866

887867
```
888868
```
889-
### TDCalendarPopup
869+
870+
### TDCalendar
890871
#### 默认构造方法
891872

892873
| 参数 | 类型 | 默认值 | 说明 |
893874
| --- | --- | --- | --- |
894-
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 |
895-
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] |
896-
| child | TDCalendar? | - | 日历控件 |
897-
| confirmBtn | Widget? | - | 自定义确认按钮 |
898-
| context | BuildContext | context | 上下文 |
899-
| onClose | VoidCallback? | - | 关闭时触发 |
900-
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 |
901-
| top | double? | - | 距离顶部的距离 |
902-
| visible | bool? | - | 默认是否显示日历 |
875+
| anchorDate | DateTime? | - | 锚点日期 |
876+
| animateTo | bool? | false | 动画滚动到指定位置 |
877+
| cellHeight | double? | 60 | 日期高度 |
878+
| cellWidget | Widget? Function(BuildContext context, TDate tdate, DateSelectType selectType)? | - | 自定义日期单元格组件 |
879+
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 |
880+
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 |
881+
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 |
882+
| height | double? | - | 高度 |
883+
| isTimeUnit | bool? | true | 是否显示时间单位 |
884+
| key | | - | |
885+
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 |
886+
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 |
887+
| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 |
888+
| monthTitleHeight | double? | 22 | 月标题高度 |
889+
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
890+
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
891+
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
892+
| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 |
893+
| onMonthChange | ValueChanged<DateTime>? | - | 月份变化时触发 |
894+
| pickerHeight | double? | 178 | 时间选择器List的视窗高度 |
895+
| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
896+
| style | TDCalendarStyle? | - | 自定义样式 |
897+
| timePickerModel | List<DatePickerModel>? | - | 自定义时间选择器 |
898+
| title | String? | - | 标题 |
899+
| titleWidget | Widget? | - | 标题组件 |
900+
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选;range = 区间选择 |
901+
| useSafeArea | bool? | true | 是否使用安全区域,默认true |
902+
| useTimePicker | bool? | false | 是否显示时间选择器 |
903+
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 |
904+
| width | double? | - | 宽度 |
903905

904906

905907

tdesign-site/src/cell/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ Widget _buildCard(BuildContext context) {
196196

197197
```
198198
```
199-
### TDCellGroup
199+
200+
### TDCellGroup
200201
#### 简介
201202
单元格组组件
202203
#### 默认构造方法
@@ -216,7 +217,8 @@ Widget _buildCard(BuildContext context) {
216217

217218
```
218219
```
219-
### TDCellStyle
220+
221+
### TDCellStyle
220222
#### 简介
221223
单元格组件样式
222224
#### 默认构造方法

tdesign-site/src/checkbox/README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,28 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
426426

427427

428428
## API
429+
### TDCheckboxGroup
430+
#### 默认构造方法
431+
432+
| 参数 | 类型 | 默认值 | 说明 |
433+
| --- | --- | --- | --- |
434+
| checkedIds | List<String>? | - | 勾选的CheckBox id列表 |
435+
| child | | - | |
436+
| contentDirection | TDContentDirection? | - | 文字相对icon的方位 |
437+
| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 |
438+
| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 |
439+
| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 |
440+
| key | | - | |
441+
| maxChecked | int? | - | 最多可以勾选多少 |
442+
| onChangeGroup | OnGroupChange? | - | 状态变化监听器 |
443+
| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 |
444+
| spacing | double? | - | CheckBoxicon和文字的距离 |
445+
| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 |
446+
| titleMaxLine | int? | - | CheckBox标题的行数 |
447+
448+
```
449+
```
450+
429451
### TDCheckbox
430452
#### 默认构造方法
431453

@@ -459,26 +481,5 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
459481
| titleFont | Font? | - | 标题字体大小 |
460482
| titleMaxLine | int? | - | 标题的行数 |
461483

462-
```
463-
```
464-
### TDCheckboxGroup
465-
#### 默认构造方法
466-
467-
| 参数 | 类型 | 默认值 | 说明 |
468-
| --- | --- | --- | --- |
469-
| checkedIds | List<String>? | - | 勾选的CheckBox id列表 |
470-
| child | | - | |
471-
| contentDirection | TDContentDirection? | - | 文字相对icon的方位 |
472-
| controller | TDCheckboxGroupController? | - | 可以通过控制器操作勾选状态 |
473-
| customContentBuilder | ContentBuilder? | - | CheckBox完全自定义内容 |
474-
| customIconBuilder | IconBuilder? | - | 自定义选择icon的样式 |
475-
| key | | - | |
476-
| maxChecked | int? | - | 最多可以勾选多少 |
477-
| onChangeGroup | OnGroupChange? | - | 状态变化监听器 |
478-
| onOverloadChecked | VoidCallback? | - | 超过最大可勾选的个数 |
479-
| spacing | double? | - | CheckBoxicon和文字的距离 |
480-
| style | TDCheckboxStyle? | - | CheckBox复选框样式:圆形或方形 |
481-
| titleMaxLine | int? | - | CheckBox标题的行数 |
482-
483484

484485

tdesign-site/src/date-time-picker/README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,19 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
331331

332332

333333
## API
334+
### TDPicker
335+
336+
#### 静态方法
337+
338+
| 名称 | 返回类型 | 参数 | 说明 |
339+
| --- | --- | --- | --- |
340+
| showDatePicker | | required null context, String? title, double? titleHeight, Color? titleDividerColor, required DatePickerCallback? onConfirm, DatePickerCallback? onCancel, DatePickerCallback? onChange, Function(int wheelIndex, int index)? onSelectedItemChanged, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, String? rightText, TextStyle? rightTextStyle, EdgeInsets? padding, double? leftPadding, double? topPadding, double? rightPadding, double? topRadius, Color? backgroundColor, Widget? customSelectWidget, bool useYear, bool useMonth, bool useDay, bool useHour, bool useMinute, bool useSecond, bool useWeekDay, List<int> dateStart, List<int>? dateEnd, List<int>? initialDate, List<int> Function(DateTypeKey key, List<int> nums)? filterItems, double pickerHeight, int pickerItemCount, bool isTimeUnit, ItemBuilderType? itemBuilder, Color? barrierColor, Duration duration, | 显示时间选择器 |
341+
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List initialData, required Map data, required int columnNum, double pickerHeight, int pickerItemCount, Widget? customSelectWidget, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, ItemBuilderType? itemBuilder, bool keepSameSelection, Color? barrierColor, Duration duration, | 显示多级联动选择器 |
342+
| showMultiPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List<List<String>> data, double pickerHeight, int pickerItemCount, List<int>? initialIndexes, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, Widget? customSelectWidget, ItemBuilderType? itemBuilder, Duration duration, Color? barrierColor, | 显示多级选择器 |
343+
344+
```
345+
```
346+
334347
### TDDatePicker
335348
#### 默认构造方法
336349

@@ -364,17 +377,5 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
364377
| topPadding | double? | - | 顶部填充 |
365378
| topRadius | double? | - | 顶部圆角 |
366379

367-
```
368-
```
369-
### TDPicker
370-
371-
#### 静态方法
372-
373-
| 名称 | 返回类型 | 参数 | 说明 |
374-
| --- | --- | --- | --- |
375-
| showDatePicker | | required null context, String? title, double? titleHeight, Color? titleDividerColor, required DatePickerCallback? onConfirm, DatePickerCallback? onCancel, DatePickerCallback? onChange, Function(int wheelIndex, int index)? onSelectedItemChanged, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, String? rightText, TextStyle? rightTextStyle, EdgeInsets? padding, double? leftPadding, double? topPadding, double? rightPadding, double? topRadius, Color? backgroundColor, Widget? customSelectWidget, bool useYear, bool useMonth, bool useDay, bool useHour, bool useMinute, bool useSecond, bool useWeekDay, List<int> dateStart, List<int>? dateEnd, List<int>? initialDate, List<int> Function(DateTypeKey key, List<int> nums)? filterItems, double pickerHeight, int pickerItemCount, bool isTimeUnit, ItemBuilderType? itemBuilder, Color? barrierColor, Duration duration, | 显示时间选择器 |
376-
| showMultiLinkedPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List initialData, required Map data, required int columnNum, double pickerHeight, int pickerItemCount, Widget? customSelectWidget, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, ItemBuilderType? itemBuilder, bool keepSameSelection, Color? barrierColor, Duration duration, | 显示多级联动选择器 |
377-
| showMultiPicker | | required null context, String? title, required MultiPickerCallback? onConfirm, MultiPickerCallback? onCancel, required List<List<String>> data, double pickerHeight, int pickerItemCount, List<int>? initialIndexes, String? rightText, String? leftText, TextStyle? leftTextStyle, TextStyle? centerTextStyle, TextStyle? rightTextStyle, double? titleHeight, double? topPadding, double? leftPadding, double? rightPadding, Color? titleDividerColor, Color? backgroundColor, double? topRadius, EdgeInsets? padding, Widget? customSelectWidget, ItemBuilderType? itemBuilder, Duration duration, Color? barrierColor, | 显示多级选择器 |
378-
379380

380381

0 commit comments

Comments
 (0)