-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
5,648 additions
and
1,818 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,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() | 样式 | |
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
11 changes: 11 additions & 0 deletions
11
tdesign-component/example/assets/code/image._failCustom.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,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, | ||
) |
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,4 @@ | ||
const TDImage( | ||
imgUrl: 'error', | ||
type: TDImageType.roundedSquare, | ||
) |
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,6 @@ | ||
const TDImage( | ||
assetUrl: 'assets/img/image.png', | ||
width: 72, | ||
height: 72, | ||
type: TDImageType.circle, | ||
) |
89 changes: 4 additions & 85 deletions
89
tdesign-component/example/assets/code/image._imageClip.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 |
---|---|---|
@@ -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
10
tdesign-component/example/assets/code/image._imageFile.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,10 @@ | ||
Widget _imageFile(BuildContext context) { | ||
return Container( | ||
width: 72, | ||
height: 72, | ||
child: TDImage( | ||
imageFile: File('/sdcard/td/test.jpg'), | ||
type: TDImageType.fitWidth, | ||
), | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
tdesign-component/example/assets/code/image._imageFitHeight.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,4 @@ | ||
const TDImage( | ||
assetUrl: 'assets/img/image.png', | ||
type: TDImageType.fitHeight, | ||
) |
39 changes: 4 additions & 35 deletions
39
tdesign-component/example/assets/code/image._imageFitWidth.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 |
---|---|---|
@@ -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 | ||
) |
6 changes: 6 additions & 0 deletions
6
tdesign-component/example/assets/code/image._imageRoundedSquare.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,6 @@ | ||
const TDImage( | ||
assetUrl: 'assets/img/image.png', | ||
type: TDImageType.roundedSquare, | ||
width: 72, | ||
height: 72, | ||
) |
78 changes: 4 additions & 74 deletions
78
tdesign-component/example/assets/code/image._imageSquare.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 |
---|---|---|
@@ -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
6
tdesign-component/example/assets/code/image._imageStretch.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,6 @@ | ||
const TDImage( | ||
assetUrl: 'assets/img/image.png', | ||
width: 121, | ||
height: 50, | ||
type: TDImageType.stretch, | ||
) |
Oops, something went wrong.