Skip to content

Commit b401d57

Browse files
authored
Merge pull request Tencent#424 from Tencent/release/0.1.8
Release/0.1.8
2 parents 81a2773 + a6dfe7e commit b401d57

65 files changed

Lines changed: 832 additions & 243 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tdesign-component/CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## 🌈 0.1.8 `2024-12-26`
2+
### 🚀 Features
3+
- `TDUpload`: Added Upload component @Luozf12345 ([#405](https://github.com/Tencent/tdesign-flutter/pull/405))
4+
- `SearchBar`: Added keyboard action type @ccXxx1aoBai ([#366](https://github.com/Tencent/tdesign-flutter/pull/366))
5+
- `Cell`: CellGroup added style control parameters: cardBorderRadius (card mode border radius), cardPadding (card mode padding), titlePadding (title padding) @hkaikai ([#409](https://github.com/Tencent/tdesign-flutter/pull/409))
6+
- `DropdownMenu`: Added decorator configuration: decoration, which can customize menu color and border @hkaikai ([#408](https://github.com/Tencent/tdesign-flutter/pull/408))
7+
- `ImageViewer`: Supports displaying image titles @ccXxx1aoBai ([#411](https://github.com/Tencent/tdesign-flutter/pull/411))
8+
- `Calendar`: Added monthTitleBuilder parameter @hkaikai ([#419](https://github.com/Tencent/tdesign-flutter/pull/419))
9+
- `Calendar`: Added pickerHeight, pickerItemCount parameters to control the height of the time selection component @hkaikai ([#421](https://github.com/Tencent/tdesign-flutter/pull/421))
10+
- `Toast`: Supports customizing the overlay background color @ccXxx1aoBai ([#423](https://github.com/Tencent/tdesign-flutter/pull/423))
11+
- `Rate`: Supports disabled parameter @hkaikai ([#357](https://github.com/Tencent/tdesign-flutter/pull/357))
12+
- `Calendar`: Modified CalendarBuilder return value to Widget @Luozf12345 ([#396](https://github.com/Tencent/tdesign-flutter/pull/396))
13+
- `SearchBar`: Added read-only attribute and click event @shizhe2018 ([#393](https://github.com/Tencent/tdesign-flutter/pull/393))
14+
- `Dialog`: TDDialogButtonOptions added font size attribute @shizhe2018 ([#381](https://github.com/Tencent/tdesign-flutter/pull/381))
15+
- `DateTimePicker`: Added time unit display attribute @shizhe2018 ([#383](https://github.com/Tencent/tdesign-flutter/pull/383))
16+
- `Input`: Added additionInfo left and right display position @shizhe2018 ([#401](https://github.com/Tencent/tdesign-flutter/pull/401))
17+
18+
### 🐞 Bug Fixes
19+
- `NoticeBar`: Fixed the issue of abnormal text display on the web @ccXxx1aoBai ([#351](https://github.com/Tencent/tdesign-flutter/pull/351))
20+
- `Rate`: Fixed the issue where the onChange event was not triggered when clicking the tooltip in half selection @hkaikai ([#361](https://github.com/Tencent/tdesign-flutter/pull/361))
21+
- `Calendar`: Fixed the issue of inaccurate scroll position due to inconsistent number of rows in the month date @hkaikai ([#363](https://github.com/Tencent/tdesign-flutter/pull/363))
22+
- `Calendar`: Optimized the issue of rendering lag caused by too large min and max @hkaikai ([#363](https://github.com/Tencent/tdesign-flutter/pull/363))
23+
- `Input`: Fixed the issue where the dividing line and content were not aligned when setting contentPadding @epoll-j ([#365](https://github.com/Tencent/tdesign-flutter/pull/365))
24+
- `Table`: Fixed the issue of overflow when setting the width of fixed columns @ccXxx1aoBai ([#370](https://github.com/Tencent/tdesign-flutter/pull/370))
25+
- `Popup`: Fixed the issue of delay in closing when clicking on the overlay @hkaikai ([#380](https://github.com/Tencent/tdesign-flutter/pull/380))
26+
- `Cascader`: Added the function of clicking to select the first layer @shizhe2018 ([#355](https://github.com/Tencent/tdesign-flutter/pull/355))
27+
- `DateTimePicker`: Added restrictions on hours, minutes, and seconds @shizhe2018 ([#362](https://github.com/Tencent/tdesign-flutter/pull/362))
28+
- `Textarea`: Optimized the update of word limit changes @shizhe2018 ([#385](https://github.com/Tencent/tdesign-flutter/pull/385))
29+
- `TabBar`: Fixed the issue where labelStyle and unselectedLabelStyle did not take effect @shizhe2018 ([#399](https://github.com/Tencent/tdesign-flutter/pull/399))
30+
- `Picker`: Fixed the issue of unable to select color when sliding in multi-layer pop-up @shizhe2018 ([#413](https://github.com/Tencent/tdesign-flutter/pull/413))
31+
- `SearchBar`: Fixed the issue of SearchBar jittering at the default position when focusing, and the cursor not being centered @Luozf12345 ([#417](https://github.com/Tencent/tdesign-flutter/pull/417))
32+
- `Dialog`: Modified Dialog to only pass contentWidget, no need to pass title and content @Luozf12345 ([#418](https://github.com/Tencent/tdesign-flutter/pull/418))
33+
- `TDBottomTabBar`: Fixed the issue of bottom overflow by 2.5 pixels in iconText mode @epoll-j ([#422](https://github.com/Tencent/tdesign-flutter/pull/422))
34+
35+
### 🚧 Others
36+
- Adapted to FlutterSdk3.25, the minimum supported version has been adjusted to 3.16.0 @shizhe2018 ([#378](https://github.com/Tencent/tdesign-flutter/pull/378))
37+
- Modified Example English version copy @shizhe2018 ([#382](https://github.com/Tencent/tdesign-flutter/pull/382))
38+
- Upgraded flutter_slidable version @Luozf12345 ([#407](https://github.com/Tencent/tdesign-flutter/pull/407))
39+
- Added component search function to demo @Luozf12345 ([#410](https://github.com/Tencent/tdesign-flutter/pull/410))
40+
- Updated Icons @Luozf12345 ([#420](https://github.com/Tencent/tdesign-flutter/pull/420))
41+
142
## 🌈 0.1.7 `2024-10-16`
243
### 🚀 Features
344
- `TDNoticeBar`: Added noticeBar component @ccXxx1aoBai ([#162](https://github.com/Tencent/tdesign-flutter/pull/162))

tdesign-component/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ TDesign Flutter depends on the following component libraries. We appreciate the
6363

6464
[flutter_easyrefresh](https://pub-web.flutter-io.cn/packages/easy_refresh)
6565

66-
[flutter_swiper](https://pub-web.flutter-io.cn/packages/flutter_swiper)
66+
[flutter_swiper](https://pub-web.flutter-io.cn/packages/flutter_swiper)
67+
68+
[flutter_slidable](https://pub-web.flutter-io.cn/packages/flutter_slidable)
69+
70+
[image_picker](https://pub-web.flutter-io.cn/packages/image_picker)

tdesign-component/example/assets/api/calendar_api.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@
4848
| onChange | void Function(List<int> value)? | - | 选中值变化时触发 |
4949
| onCellClick | void Function(int value, DateSelectType type, TDate tdate)? | - | 点击日期时触发 |
5050
| onCellLongPress | void Function(int value, DateSelectType type, TDate tdate)? | - | 长安日期时触发 |
51-
| onHeanderClick | void Function(int index, String week)? | - | 点击周时触发 |
51+
| onHeaderClick | void Function(int index, String week)? | - | 点击周时触发 |
5252
| useTimePicker | bool? | false | 是否显示时间选择器 |
5353
| timePickerModel | List<DatePickerModel>? | - | 自定义时间选择器 |
54+
| monthTitleHeight | double? | 22 | 月标题高度 |
55+
| monthTitleBuilder | Widget Function(BuildContext context, DateTime monthDate)? | - | 月标题构建器 |
56+
| pickerHeight | double? | 178 | 时间选择器List的视窗高度 |
57+
| pickerItemCount | int? | 3 | 选择器List视窗中item个数,pickerHeight / pickerItemCount即item高度 |
58+
| isTimeUnit | bool? | true | 是否显示时间单位 |
5459

5560
```
5661
```

tdesign-component/example/assets/api/image-viewer_api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
| closeBtn | bool? | - | 是否展示关闭按钮 |
99
| deleteBtn | bool? | - | 是否显示删除操作 |
1010
| images | List<dynamic> | - | 图片数组 |
11+
| labels | List<String>? | - | 图片描述 |
1112
| showIndex | bool? | - | 是否显示页码 |
1213
| defaultIndex | int? | - | 默认预览图片所在的下标 |
1314
| onIndexChange | OnIndexChange? | - | 预览图片切换回调 |
@@ -25,4 +26,4 @@
2526

2627
| 名称 | 返回类型 | 参数 | 说明 |
2728
| --- | --- | --- | --- |
28-
| showImageViewer | | required BuildContext context, required List<dynamic> images, bool? closeBtn, bool? deleteBtn, bool? showIndex, int? defaultIndex, double? width, double? height, OnIndexChange? onIndexChange, OnClose? onClose, OnDelete? onDelete, OnLongPress? onLongPress, | 显示图片预览 |
29+
| showImageViewer | | required BuildContext context, required List<dynamic> images, List<String>? labels, bool? closeBtn, bool? deleteBtn, bool? showIndex, int? defaultIndex, double? width, double? height, OnIndexChange? onIndexChange, OnClose? onClose, OnDelete? onDelete, OnLongPress? onLongPress, | 显示图片预览 |

tdesign-component/example/assets/api/side-bar_api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@
3333
| style | TDSideBarStyle | TDSideBarStyle.normal | 样式 |
3434
| loading | bool? | - | 加载效果 |
3535
| loadingWidget | Widget? | - | 自定义加载动画 |
36+
| selectedBgColor | Color? | - | 选择的背景颜色 |
37+
| unSelectedBgColor | Color? | - | 未选择的背景颜色 |

tdesign-component/example/assets/api/tabs_api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
| dividerHeight | double | 0.5 | 分割线高度,小于等于0则不展示分割线 |
5151
| selectedBgColor | Color? | - | 被选中背景色,只有outlineType为capsule时有效 |
5252
| unSelectedBgColor | Color? | - | 未选中背景色,只有outlineType为capsule时有效 |
53+
| tabAlignment | | - | |
5354

5455
```
5556
```

tdesign-component/example/assets/api/toast_api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
| 名称 | 返回类型 | 参数 | 说明 |
77
| --- | --- | --- | --- |
8-
| showText | | required String? text, required BuildContext context, Duration duration, int? maxLines, BoxConstraints? constraints, bool? preventTap, | 普通文本Toast |
9-
| showIconText | | required String? text, IconData? icon, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, | 带图标的Toast |
10-
| showSuccess | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, | 成功提示Toast |
11-
| showWarning | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, | 警告Toast |
12-
| showFail | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, | 失败提示Toast |
13-
| showLoading | | required BuildContext context, String? text, Duration duration, bool? preventTap, | 带文案的加载Toast |
14-
| showLoadingWithoutText | | required BuildContext context, String? text, Duration duration, bool? preventTap, | 不带文案的加载Toast |
8+
| showText | | required String? text, required BuildContext context, Duration duration, int? maxLines, BoxConstraints? constraints, bool? preventTap, Color? backgroundColor, | 普通文本Toast |
9+
| showIconText | | required String? text, IconData? icon, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, | 带图标的Toast |
10+
| showSuccess | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, | 成功提示Toast |
11+
| showWarning | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, | 警告Toast |
12+
| showFail | | required String? text, IconTextDirection direction, required BuildContext context, Duration duration, bool? preventTap, Color? backgroundColor, | 失败提示Toast |
13+
| showLoading | | required BuildContext context, String? text, Duration duration, bool? preventTap, Color? backgroundColor, | 带文案的加载Toast |
14+
| showLoadingWithoutText | | required BuildContext context, String? text, Duration duration, bool? preventTap, Color? backgroundColor, | 不带文案的加载Toast |
1515
| dismissLoading | | | 关闭加载Toast |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Widget _iconTextTypeTabBarOverflow(BuildContext context) {
3+
final selectedIcon = Icon(
4+
TDIcons.app,
5+
color: TDTheme.of(context).brandNormalColor,
6+
);
7+
final unSelectedIcon = Icon(
8+
TDIcons.app,
9+
color: TDTheme.of(context).brandNormalColor,
10+
);
11+
return TDBottomTabBar(TDBottomTabBarBasicType.iconText, useVerticalDivider: false, navigationTabs: [
12+
TDBottomTabBarTabConfig(
13+
tabText: '标签',
14+
selectedIcon: selectedIcon,
15+
unselectedIcon: unSelectedIcon,
16+
onTap: () {
17+
onTapTab(context, '标签1');
18+
},
19+
),
20+
TDBottomTabBarTabConfig(
21+
tabText: '标签',
22+
selectedIcon: selectedIcon,
23+
unselectedIcon: unSelectedIcon,
24+
onTap: () {
25+
onTapTab(context, '标签2');
26+
},
27+
),
28+
TDBottomTabBarTabConfig(
29+
tabText: '标签',
30+
selectedIcon: selectedIcon,
31+
unselectedIcon: unSelectedIcon,
32+
onTap: () {
33+
onTapTab(context, '标签3');
34+
},
35+
),
36+
]);
37+
}

tdesign-component/example/assets/code/calendar._buildSimple.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Widget _buildSimple(BuildContext context) {
9898
value: value,
9999
height: size.height * 0.92,
100100
useTimePicker: true,
101+
// pickerHeight: 100,
102+
// pickerItemCount: 2,
101103
onCellClick: (value, type, tdate) {
102104
print('onCellClick:$value');
103105
},

tdesign-component/example/assets/code/icon._showAllIcons.txt

Lines changed: 96 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,110 @@
33
return Container(
44
color: Colors.white,
55
alignment: Alignment.center,
6-
child: Wrap(
6+
child: Column(
77
children: [
88
Container(
9-
child: TDButton(text: showBorder? '隐藏边框':'显示边框',
9+
padding: const EdgeInsets.only(left: 16),
10+
alignment: Alignment.topLeft,
11+
child: const Wrap(
12+
children: [
13+
TDText('筛选Icon请前往TDesign官网(长按网址可复制):'),
14+
SelectableText('https://tdesign.tencent.com/vue/components/icon')
15+
],
16+
),
17+
),
18+
TDSearchBar(
19+
action: '搜索',
20+
onActionClick: (text) {
21+
setState(() {
22+
iconList = [];
23+
isLoading = true;
24+
});
25+
Future.delayed(const Duration(milliseconds: 30), () {
26+
var list = [];
27+
TDIcons.all.forEach((key, value) {
28+
if (value.name.contains(text)) {
29+
list.add(value);
30+
}
31+
});
32+
setState(() {
33+
iconList = list;
34+
isLoading = false;
35+
});
36+
});
37+
},
38+
onClearClick: (_) {
39+
setState(() {
40+
iconList = TDIcons.all.values;
41+
});
42+
},
43+
),
44+
Container(
45+
child: TDButton(
46+
text: showBorder ? '隐藏边框' : '显示边框',
1047
shape: TDButtonShape.filled,
11-
onTap: (){
48+
onTap: () {
1249
setState(() {
1350
showBorder = !showBorder;
1451
});
15-
},),
52+
},
53+
),
1654
margin: const EdgeInsets.only(bottom: 16),
1755
),
18-
for (var iconData in TDIcons.all.values) SizedBox(
19-
height: 100,
20-
width: 175,
21-
22-
child: Column(
23-
children: [
24-
Container(
25-
color: showBorder ? TDTheme.of(context).brandDisabledColor : Colors.transparent,
26-
child: Icon(iconData),
27-
),
28-
TDText(iconData.name)
29-
],
30-
),
31-
)
56+
Builder(builder: (context) {
57+
if (iconList.isEmpty) {
58+
return Container(
59+
height: 300,
60+
alignment: Alignment.center,
61+
child: isLoading ? const TDText('加载中...') : const TDText('暂无内容'),
62+
);
63+
}
64+
return SizedBox(
65+
height: MediaQuery.of(context).size.height - 150,
66+
child: ListView.builder(
67+
itemCount: (iconList.length + 1) ~/ 2,
68+
itemBuilder: (context,index){
69+
var index1 = index ~/ 2;
70+
var index2 = index1 + 1;
71+
var iconData1 = iconList.elementAt(index1);
72+
var iconData2;
73+
if(iconList.length > index2){
74+
iconData2 = iconList.elementAt(index2);
75+
}
76+
return Row(
77+
children: [
78+
SizedBox(
79+
height: 100,
80+
width: 175,
81+
child: Column(
82+
children: [
83+
Container(
84+
color: showBorder ? TDTheme.of(context).brandDisabledColor : Colors.transparent,
85+
child: Icon(iconData1),
86+
),
87+
TDText(iconData1.name)
88+
],
89+
),
90+
),
91+
if (iconData2 != null)
92+
SizedBox(
93+
height: 100,
94+
width: 175,
95+
child: Column(
96+
children: [
97+
Container(
98+
color: showBorder ? TDTheme.of(context).brandDisabledColor : Colors.transparent,
99+
child: Icon(iconData2),
100+
),
101+
TDText(iconData2.name)
102+
],
103+
),
104+
)
105+
],
106+
);
107+
}),
108+
);
109+
})
32110
],
33111
),
34112
);

0 commit comments

Comments
 (0)