-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/TDSlider_fix
- Loading branch information
Showing
86 changed files
with
6,347 additions
and
1,935 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## API | ||
### TDCalendarStyle | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| decoration | | - | | | ||
| titleStyle | TextStyle? | - | header区域 [TDCalendar.title]的样式 | | ||
| titleMaxLine | int? | - | header区域 [TDCalendar.title]的行数 | | ||
| titleCloseColor | Color? | - | header区域 关闭图标的颜色 | | ||
| weekdayStyle | TextStyle? | - | header区域 周 文字样式 | | ||
| monthTitleStyle | TextStyle? | - | body区域 年月文字样式 | | ||
| cellStyle | TextStyle? | - | 日期样式 | | ||
| centreColor | Color? | - | 日期范围内背景样式 | | ||
| cellDecoration | BoxDecoration? | - | 日期decoration | | ||
| cellPrefixStyle | TextStyle? | - | 日期前面的字符串的样式 | | ||
| cellSuffixStyle | TextStyle? | - | 日期后面的字符串的样式 | | ||
|
||
|
||
#### 工厂构造方法 | ||
|
||
| 名称 | 说明 | | ||
| --- | --- | | ||
| TDCalendarStyle.generateStyle | 生成默认样式 | | ||
| TDCalendarStyle.cellStyle | 日期样式 | | ||
|
||
``` | ||
``` | ||
### TDCalendar | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| key | | - | | | ||
| firstDayOfWeek | int? | 0 | 第一天从星期几开始,默认 0 = 周日 | | ||
| format | CalendarFormat? | - | 用于格式化日期的函数,可定义日期前后的显示内容和日期样式 | | ||
| maxDate | int? | - | 最大可选的日期(fromMillisecondsSinceEpoch),不传则默认半年后 | | ||
| minDate | int? | - | 最小可选的日期(fromMillisecondsSinceEpoch),不传则默认今天 | | ||
| title | String? | - | 标题 | | ||
| titleWidget | Widget? | - | 标题组件 | | ||
| type | CalendarType? | CalendarType.single | 日历的选择类型,single = 单选;multiple = 多选; range = 区间选择 | | ||
| value | List<int>? | - | 当前选择的日期(fromMillisecondsSinceEpoch),不传则默认今天,当 type = single 时数组长度为1 | | ||
| displayFormat | String? | 'year month' | 年月显示格式,`year`表示年,`month`表示月,如`year month`表示年在前、月在后、中间隔一个空格 | | ||
| cellHeight | double? | 60 | 日期高度 | | ||
| height | double? | - | 高度 | | ||
| width | double? | - | 宽度 | | ||
| style | TDCalendarStyle? | - | 自定义样式 | | ||
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 | | ||
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 | | ||
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 | | ||
| onHeanderClick | void Function(int index, String week)? | - | 点击周时触发 | | ||
|
||
``` | ||
``` | ||
### TDCalendarPopup | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| context | BuildContext | context | 上下文 | | ||
| top | double? | - | 距离顶部的距离 | | ||
| autoClose | bool? | true | 自动关闭;在点击关闭按钮、确认按钮、遮罩层时自动关闭 | | ||
| confirmBtn | Widget? | - | 自定义确认按钮 | | ||
| visible | bool? | - | 默认是否显示日历 | | ||
| onClose | VoidCallback? | - | 关闭时触发 | | ||
| onConfirm | void Function(List<int> value)? | - | 点击确认按钮时触发 | | ||
| builder | CalendarBuilder? | - | 控件构建器,优先级高于[child] | | ||
| child | TDCalendar? | - | 日历控件 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## API | ||
### TDIndexes | ||
#### 简介 | ||
索引 | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| key | | - | | | ||
| indexList | List<String>? | - | 索引字符列表。不传默认 A-Z | | ||
| indexListMaxHeight | double? | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) | | ||
| sticky | bool? | true | 锚点是否吸顶 | | ||
| stickyOffset | double? | 0 | 锚点吸顶时与顶部的距离 | | ||
| capsuleTheme | bool? | false | 锚点是否为胶囊式样式 | | ||
| reverse | bool? | false | 反方向滚动置顶 | | ||
| scrollController | ScrollController? | - | 滚动控制器 | | ||
| onChange | void Function(String index)? | - | 索引发生变更时触发事件 | | ||
| onSelect | void Function(String index)? | - | 点击侧边栏时触发事件 | | ||
| builderContent | Widget? Function(BuildContext context, String index) | - | 内容自定义构建 | | ||
| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 锚点自定义构建 | | ||
| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 | | ||
|
||
``` | ||
``` | ||
### TDIndexesList | ||
#### 简介 | ||
索引 | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| key | | - | | | ||
| indexList | List<String> | - | 索引字符列表。不传默认 A-Z | | ||
| indexListMaxHeight | double | 0.8 | 索引列表最大高度(父容器高度的百分比,默认0.8) | | ||
| activeIndex | ValueNotifier<String> | - | 选中索引 | | ||
| onSelect | void Function(String index, bool isUp) | - | 点击侧边栏时触发事件 | | ||
| builderIndex | Widget Function(BuildContext context, String index, bool isActive)? | - | 索引文本自定义构建,包括索引激活左侧提示 | | ||
|
||
``` | ||
``` | ||
### TDIndexesAnchor | ||
#### 简介 | ||
索引锚点 | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| key | | - | | | ||
| sticky | bool | - | 索引是否吸顶 | | ||
| text | String | - | 锚点文本 | | ||
| capsuleTheme | bool | - | 是否为胶囊式样式 | | ||
| builderAnchor | Widget? Function(BuildContext context, String index, bool isPinnedToTop)? | - | 索引锚点构建 | | ||
| activeIndex | ValueNotifier<String> | - | 选中索引 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## API | ||
### TDNoticeBar | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| key | | - | | | ||
| context | dynamic | - | 文本内容 | | ||
| style | TDNoticeBarStyle? | - | 公告栏样式 | | ||
| left | Widget? | - | 左侧内容(自定义左侧内容,优先级高于prefixIcon) | | ||
| right | Widget? | - | 侧内容(自定义右侧内容,优先级高于suffixIcon) | | ||
| marquee | bool? | false | 跑马灯效果 | | ||
| speed | double? | 50 | 滚动速度 | | ||
| interval | int? | 3000 | 步进滚动间隔时间(毫秒) | | ||
| direction | Axis? | Axis.horizontal | 滚动方向 | | ||
| theme | TDNoticeBarThemez? | TDNoticeBarThemez.info | 主题 | | ||
| prefixIcon | IconData? | - | 左侧图标 | | ||
| suffixIcon | IconData? | - | 右侧图标 | | ||
| onTap | ValueChanged<dynamic>? | - | 点击事件 | | ||
|
||
``` | ||
``` | ||
### TDNoticeBarStyle | ||
#### 默认构造方法 | ||
|
||
| 参数 | 类型 | 默认值 | 说明 | | ||
| --- | --- | --- | --- | | ||
| context | BuildContext? | - | 上下文 | | ||
| backgroundColor | Color? | - | 公告栏的背景色 | | ||
| leftIconColor | Color? | - | 公告栏左侧图标的颜色 | | ||
| rightIconColor | Color? | - | 公告栏右侧图标的颜色 | | ||
| padding | EdgeInsetsGeometry? | EdgeInsets.only(top: 13, bottom: 13, left: 16, right: 12) | 公告栏的内边距 | | ||
| textStyle | TextStyle? | TextStyle(color: TDTheme.of(context).fontGyColor1, fontSize: 16, height: 1) | 公告栏内容的文本样式 | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tdesign-component/example/assets/code/search._buildFocusSearchBarWithAction.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Widget _buildFocusSearchBarWithAction(BuildContext context) { | ||
return TDSearchBar( | ||
placeHolder: '搜索预设文案', | ||
action: '搜索', | ||
needCancel: true, | ||
controller: inputController, | ||
onActionClick: () { | ||
showGeneralDialog( | ||
context: context, | ||
pageBuilder: (BuildContext buildContext, Animation<double> animation, | ||
Animation<double> secondaryAnimation) { | ||
return TDConfirmDialog( | ||
content: inputController.text.isNotEmpty | ||
? '搜索关键词:${inputController.text}' | ||
: '搜索关键词为空', | ||
); | ||
}, | ||
); | ||
}, | ||
); | ||
} |
Oops, something went wrong.