Skip to content

Commit

Permalink
Merge branch 'rhino-bird' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWuZY authored Oct 15, 2024
2 parents 5136d40 + 5deeec6 commit 5ed7ce8
Show file tree
Hide file tree
Showing 72 changed files with 5,648 additions and 1,818 deletions.
2 changes: 1 addition & 1 deletion tdesign-component/demo_tool/all_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
# imageViewer
./bin/demo_tool generate --folder ../lib/src/components/image_viewer --name TDImageViewer,TDImageViewerWidget, --folder-name image-viewer --output ../example/assets/api/ --only-api
# progress
./bin/demo_tool generate --file ../lib/src/components/image/td_progress.dart --name TDProgress --folder-name progress --output ../example/assets/api/ --only-api
# result
# skeleton
# sticky
Expand Down Expand Up @@ -127,4 +128,3 @@




80 changes: 80 additions & 0 deletions tdesign-component/example/assets/api/skeleton_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## API
### TDSkeleton
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| animation | TDSkeletonAnimation? | null | 动画效果 |
| delay | int | 0 | 延迟显示加载时间 |
| theme | TDSkeletonTheme | TDSkeletonTheme.text | 风格 |


#### 命名构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| animation | TDSkeletonAnimation? | null | 动画效果 |
| delay | int | 0 | 延迟显示加载时间 |
| rowCol | TDSkeletonRowCol | - | 自定义行列数量、宽度高度、间距等 |

```
```
### TDSkeletonRowColStyle
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| rowSpacing | double Function(BuildContext) | (context) => TDTheme.of(context).spacer16 | 行间距 |

```
```
### TDSkeletonRowCol
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| objects | List<List<TDSkeletonRowColObj>> | - | 行列对象 |
| style | TDSkeletonRowColStyle | TDSkeletonRowColStyle() | 样式 |

```
```
### TDSkeletonRowColObjStyle
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| background | double Function(BuildContext) | (context) => TDTheme.of(context).grayColor1 | 背景颜色 |
| borderRadius | double Function(BuildContext) | (context) => TDTheme.of(context).radiusSmall | 圆角 |


#### 工厂构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| background | double Function(BuildContext) | (context) => TDTheme.of(context).grayColor1 | 背景颜色 |

```
```
### TDSkeletonRowColObj
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| width | double? | null | 宽度 |
| height | double? | 16 | 高度 |
| flex | int? | 1 | 弹性因子 |
| margin | EdgeInsets | EdgeInsets.zero | 间距 |
| style | TDSkeletonRowColObjStyle | TDSkeletonRowColObjStyle() | 样式 |


#### 工厂构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| width | double? | 48 / null | 宽度 |
| height | double? | 48 / 16 / null | 高度 |
| flex | int? | null / 1 | 弹性因子 |
| margin | EdgeInsets | EdgeInsets.zero | 间距 |
| style | TDSkeletonRowColObjStyle | TDSkeletonRowColObjStyle.circle() / TDSkeletonRowColObjStyle.rect() / TDSkeletonRowColObjStyle.text() / TDSkeletonRowColObjStyle.spacer() | 样式 |
3 changes: 2 additions & 1 deletion tdesign-component/example/assets/api/steps_api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## API

### TDStepsItemData
#### 默认构造方法

Expand All @@ -24,4 +25,4 @@
| status | TDStepsStatus | TDStepsStatus.success | 步骤条状态 |
| simple | bool | false | 步骤条simple模式 |
| readOnly | bool | false | 步骤条readOnly模式 |
| verticalSelect | bool | false | 步骤条垂直自定义步骤条选择模式 |
| verticalSelect | bool | false | 步骤条垂直自定义步骤条选择模式 |
2 changes: 2 additions & 0 deletions tdesign-component/example/assets/api/switch_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
| trackOffColor | Color? | - | 关闭时轨道颜色 |
| thumbContentOnColor | Color? | - | 开启时ThumbView的颜色 |
| thumbContentOffColor | Color? | - | 关闭时ThumbView的颜色 |
| thumbContentOnFont | TextStyle? | - | 开启时ThumbView的字体样式 |
| thumbContentOffFont | TextStyle? | - | 关闭时ThumbView的字体样式 |
| onChanged | OnSwitchChanged? | - | 改变事件 |
| openText | String? | - | 打开文案 |
| closeText | String? | - | 关闭文案 |
11 changes: 11 additions & 0 deletions tdesign-component/example/assets/code/image._failCustom.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const TDImage(
imgUrl: 'error',
errorWidget: TDText(
'加载失败',
forceVerticalCenter: true,
font: TDTheme.of(context).fontBodyExtraSmall,
fontWeight: FontWeight.w500,
textColor: TDTheme.of(context).fontGyColor3,
),
type: TDImageType.roundedSquare,
)
4 changes: 4 additions & 0 deletions tdesign-component/example/assets/code/image._failDefault.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const TDImage(
imgUrl: 'error',
type: TDImageType.roundedSquare,
)
6 changes: 6 additions & 0 deletions tdesign-component/example/assets/code/image._imageCircle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const TDImage(
assetUrl: 'assets/img/image.png',
width: 72,
height: 72,
type: TDImageType.circle,
)
89 changes: 4 additions & 85 deletions tdesign-component/example/assets/code/image._imageClip.txt
Original file line number Diff line number Diff line change
@@ -1,85 +1,4 @@

Widget _imageClip(BuildContext context) {

return Row(
children: [
const SizedBox(
width: 16,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'裁剪',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.clip,
),
],
),
const SizedBox(
width: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'适应高',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
Container(
width: 89,
height: 72,
color: Colors.black,
child: const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.fitHeight,
),
),
],
),
const SizedBox(
width: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'拉伸',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
Container(
color: Colors.black,
width: 121,
height: 72,
child: Stack(
alignment: Alignment.center,
children: const [
TDImage(
assetUrl: 'assets/img/image.png',
width: 121,
height: 50,
type: TDImageType.stretch,
),
],
),
),
],
)
],
);
}
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.clip,
)
10 changes: 10 additions & 0 deletions tdesign-component/example/assets/code/image._imageFile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Widget _imageFile(BuildContext context) {
return Container(
width: 72,
height: 72,
child: TDImage(
imageFile: File('/sdcard/td/test.jpg'),
type: TDImageType.fitWidth,
),
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.fitHeight,
)
39 changes: 4 additions & 35 deletions tdesign-component/example/assets/code/image._imageFitWidth.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@

Widget _imageFitWidth(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 24),
child: Row(
children: [
const SizedBox(
width: 16,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'适应宽',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
Container(
width: 72,
height: 89,
color: Colors.black,
child: const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.fitWidth,
),
),
],
),
],
),
);
}
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.fitWidth
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.roundedSquare,
width: 72,
height: 72,
)
78 changes: 4 additions & 74 deletions tdesign-component/example/assets/code/image._imageSquare.txt
Original file line number Diff line number Diff line change
@@ -1,74 +1,4 @@

Widget _imageSquare(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 24),
child: Row(
children: [
const SizedBox(
width: 16,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'方形',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.square,
),
],
),
const SizedBox(
width: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'圆角方形',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.roundedSquare,
width: 72,
height: 72,
),
],
),
const SizedBox(
width: 24,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: TDText(
'圆形',
font: TDTheme.of(context).fontBodyMedium,
textColor: TDTheme.of(context).fontGyColor2.withOpacity(0.6),
),
),
const TDImage(
assetUrl: 'assets/img/image.png',
width: 72,
height: 72,
type: TDImageType.circle,
),
],
)
],
),
);
}
const TDImage(
assetUrl: 'assets/img/image.png',
type: TDImageType.square,
)
6 changes: 6 additions & 0 deletions tdesign-component/example/assets/code/image._imageStretch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const TDImage(
assetUrl: 'assets/img/image.png',
width: 121,
height: 50,
type: TDImageType.stretch,
)
Loading

0 comments on commit 5ed7ce8

Please sign in to comment.