Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tdesign-component/example/lib/page/td_input_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ class _TDInputViewPageState extends State<TDInputViewPage> {
color: TDTheme.of(context).textColorPrimary,
),
maxLines: 2,
minLines: 1,
);
}

Expand Down
6 changes: 3 additions & 3 deletions tdesign-component/lib/src/components/avatar/td_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class TDAvatar extends StatelessWidget {
double width;
switch (size) {
case TDAvatarSize.large:
width = 64;
width = 48;
break;
case TDAvatarSize.medium:
width = 48;
width = 36;
break;
case TDAvatarSize.small:
width = 40;
width = 24;
break;
}
return avatarSize ?? width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TDButtonStyle {
BuildContext context, TDButtonTheme? theme, TDButtonStatus status) {
switch (theme) {
case TDButtonTheme.primary:
textColor = TDTheme.of(context).textColorAnti;
textColor = TDTheme.of(context).primaryBtnTextColor;
backgroundColor = _getBrandColor(context, status);
break;
case TDButtonTheme.danger:
Expand Down Expand Up @@ -152,6 +152,7 @@ class TDButtonStyle {
}
}


Color _getLightColor(BuildContext context, TDButtonStatus status) {
switch (status) {
case TDButtonStatus.defaultState:
Expand All @@ -176,7 +177,7 @@ class TDButtonStyle {
Color _getDefaultBgColor(BuildContext context, TDButtonStatus status) {
switch (status) {
case TDButtonStatus.defaultState:
return TDTheme.of(context).bgColorComponent;
return TDTheme.of(context).defaultBtnBgColor;
case TDButtonStatus.active:
return TDTheme.of(context).bgColorComponentHover;
case TDButtonStatus.disable:
Expand All @@ -188,7 +189,7 @@ class TDButtonStyle {
switch (status) {
case TDButtonStatus.defaultState:
case TDButtonStatus.active:
return TDTheme.of(context).textColorPrimary;
return TDTheme.of(context).defaultBtnTextColor;
case TDButtonStatus.disable:
return TDTheme.of(context).textDisabledColor;
}
Expand Down
8 changes: 8 additions & 0 deletions tdesign-component/lib/src/components/input/td_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class TDInput extends StatelessWidget {
this.inputFormatters,
this.inputDecoration,
this.maxLines = 1,
this.minLines = 1,
this.focusNode,
this.controller,
this.cursorColor,
Expand Down Expand Up @@ -121,6 +122,9 @@ class TDInput extends StatelessWidget {
/// 最大输入行数
final int maxLines;

/// 最小输入行数
final int minLines;

/// 获取或者取消焦点使用
final FocusNode? focusNode;

Expand Down Expand Up @@ -410,6 +414,7 @@ class TDInput extends StatelessWidget {
inputFormatters: inputFormatters,
inputDecoration: inputDecoration,
maxLines: maxLines,
minLines: minLines,
maxLength: maxLength,
focusNode: focusNode,
isCollapsed: true,
Expand Down Expand Up @@ -646,6 +651,7 @@ class TDInput extends StatelessWidget {
inputDecoration: inputDecoration,
isCollapsed: true,
maxLines: maxLines,
minLines: minLines,
focusNode: focusNode,
hintTextStyle: hintTextStyle ??
TextStyle(
Expand Down Expand Up @@ -770,6 +776,7 @@ class TDInput extends StatelessWidget {
[LengthLimitingTextInputFormatter(maxLength)],
inputDecoration: inputDecoration,
maxLines: maxLines,
minLines: minLines,
focusNode: focusNode,
hintTextStyle: hintTextStyle ??
TextStyle(color: TDTheme.of(context).textColorPlaceholder),
Expand Down Expand Up @@ -856,6 +863,7 @@ class TDInput extends StatelessWidget {
inputFormatters: inputFormatters,
inputDecoration: inputDecoration,
maxLines: maxLines,
minLines: minLines,
focusNode: focusNode,
isCollapsed: true,
hintTextStyle: hintTextStyle ??
Expand Down
6 changes: 6 additions & 0 deletions tdesign-component/lib/src/components/navbar/td_nav_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TDNavBar extends StatefulWidget implements PreferredSizeWidget {
this.titleWidget,
this.title,
this.titleColor,
this.backIconColor,
this.titleFont,
this.titleFontFamily,
this.titleFontWeight = FontWeight.w500,
Expand All @@ -30,6 +31,9 @@ class TDNavBar extends StatefulWidget implements PreferredSizeWidget {
this.flexibleSpace,
}) : super(key: key);

/// 左边返回图标颜色
final Color? backIconColor;

/// 左边操作项
final List<TDNavBarItem>? leftBarItems;

Expand Down Expand Up @@ -139,9 +143,11 @@ class _TDNavBarState extends State<TDNavBar> {
}

Widget get backButton {
var iconColor = widget.backIconColor ?? TDTheme.of(context).textColorPrimary;
return TDNavBarItem(
icon: TDIcons.chevron_left,
iconSize: 28.0,
iconColor: iconColor,
action: () {
widget.onBack?.call();
Navigator.maybePop(context);
Expand Down
11 changes: 11 additions & 0 deletions tdesign-component/lib/src/theme/td_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,15 @@ extension TDColors on TDThemeData {
Color get textColorBrand => colorMap['textColorBrand'] ?? brandNormalColor;

Color get textColorLink => colorMap['textColorLink'] ?? brandNormalColor;

/// DefaultTheme 按钮专用颜色--------------------------------------------

/// 默认按钮背景色:日间模式深色(#E8E8E8),暗黑模式更亮(#5E5E5E)
Color get defaultBtnBgColor => colorMap['defaultBtnBgColor'] ?? grayColor3;

/// 默认按钮文字色:日间模式白色,暗黑模式黑色
Color get defaultBtnTextColor => colorMap['defaultBtnTextColor'] ?? fontGyColor1;

/// Primary 按钮文字色:日间模式白色,暗黑模式黑色
Color get primaryBtnTextColor => colorMap['primaryBtnTextColor'] ?? whiteColor1;
}
74 changes: 40 additions & 34 deletions tdesign-component/lib/src/theme/td_default_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ class TDDefaultTheme {
"componentBorderColor": "grayColor4"
},
"color": {
"brandColor1": "#f2f3ff",
"brandColor2": "#d9e1ff",
"brandColor3": "#b5c7ff",
"brandColor4": "#8eabff",
"brandColor5": "#618dff",
"brandColor6": "#366ef4",
"brandColor7": "#0052d9",
"brandColor8": "#003cab",
"brandColor9": "#002a7c",
"brandColor10": "#001a57",
"brandColor1": "#F5F5F5",
"brandColor2": "#E0E0E0",
"brandColor3": "#BDBDBD",
"brandColor4": "#9E9E9E",
"brandColor5": "#757575",
"brandColor6": "#616161",
"brandColor7": "#1A1A1A",
"brandColor8": "#000000",
"brandColor9": "#1A1A1A",
"brandColor10": "#000000",
"warningColor1": "#fff1e9",
"warningColor2": "#ffd9c2",
"warningColor3": "#ffb98c",
Expand Down Expand Up @@ -95,8 +95,8 @@ class TDDefaultTheme {
"successColor8": "#005334",
"successColor9": "#003b23",
"successColor10": "#002515",
"grayColor1": "#f3f3f3",
"grayColor2": "#eeeeee",
"grayColor1": "#FFFFFF",
"grayColor2": "#FAFAFA",
"grayColor3": "#e8e8e8",
"grayColor4": "#dddddd",
"grayColor5": "#c6c6c6",
Expand All @@ -120,7 +120,10 @@ class TDDefaultTheme {
"bgColorContainer": "#ffffff",
"bgColorContainerSelect": "#ffffff",
"bgColorSpecialComponent": "#ffffff",
"textColorAnti": "#ffffff"
"textColorAnti": "#ffffff",
"defaultBtnBgColor": "#E8E8E8",
"defaultBtnTextColor": "#000000",
"primaryBtnTextColor": "#FFFFFF"
},
"font": {
"fontDisplayLarge": {
Expand Down Expand Up @@ -392,16 +395,16 @@ class TDDefaultTheme {
"componentBorderColor": "grayColor9"
},
"color": {
"brandColor1": "#1b2f51",
"brandColor2": "#173463",
"brandColor3": "#143975",
"brandColor4": "#103d88",
"brandColor5": "#0d429a",
"brandColor6": "#054bbe",
"brandColor7": "#2667d4",
"brandColor8": "#4582e6",
"brandColor9": "#699ef5",
"brandColor10": "#96bbf8",
"brandColor1": "#1A1A1A",
"brandColor2": "#2A2A2A",
"brandColor3": "#3A3A3A",
"brandColor4": "#4A4A4A",
"brandColor5": "#6A6A6A",
"brandColor6": "#8A8A8A",
"brandColor7": "#A0A0A0",
"brandColor8": "#B0B0B0",
"brandColor9": "#CFCFCF",
"brandColor10": "#E5E5E5",
"warningColor1": "#4f2a1d",
"warningColor2": "#582f21",
"warningColor3": "#733c23",
Expand Down Expand Up @@ -454,7 +457,10 @@ class TDDefaultTheme {
"fontGyColor2": "#99000000",
"fontGyColor3": "#66000000",
"fontGyColor4": "#42000000",
"textColorAnti": "#ffffff"
"textColorAnti": "#ffffff",
"defaultBtnBgColor": "#5E5E5E",
"defaultBtnTextColor": "#000000",
"primaryBtnTextColor": "#000000"
},
"font": {
"fontDisplayLarge": {
Expand Down Expand Up @@ -571,7 +577,7 @@ class TDDefaultTheme {
"shadow": {
"shadowsBase": [
{
"color": "#0D000000",
"color": "#1A000000",
"blurRadius": 10,
"spreadRadius": 1,
"offset": {
Expand All @@ -580,7 +586,7 @@ class TDDefaultTheme {
}
},
{
"color": "#14000000",
"color": "#1F000000",
"blurRadius": 5,
"spreadRadius": 1,
"offset": {
Expand All @@ -589,7 +595,7 @@ class TDDefaultTheme {
}
},
{
"color": "#1F000000",
"color": "#29000000",
"blurRadius": 4,
"spreadRadius": -1,
"offset": {
Expand All @@ -600,7 +606,7 @@ class TDDefaultTheme {
],
"shadowsMiddle": [
{
"color": "#0D000000",
"color": "#1A000000",
"blurRadius": 14,
"spreadRadius": 2,
"offset": {
Expand All @@ -609,7 +615,7 @@ class TDDefaultTheme {
}
},
{
"color": "#0F000000",
"color": "#1F000000",
"blurRadius": 10,
"spreadRadius": 1,
"offset": {
Expand All @@ -618,7 +624,7 @@ class TDDefaultTheme {
}
},
{
"color": "#1A000000",
"color": "#24000000",
"blurRadius": 5,
"spreadRadius": -3,
"offset": {
Expand All @@ -629,7 +635,7 @@ class TDDefaultTheme {
],
"shadowsTop": [
{
"color": "#0D000000",
"color": "#1A000000",
"blurRadius": 30,
"spreadRadius": 5,
"offset": {
Expand All @@ -638,7 +644,7 @@ class TDDefaultTheme {
}
},
{
"color": "#0A000000",
"color": "#14000000",
"blurRadius": 24,
"spreadRadius": 2,
"offset": {
Expand All @@ -647,7 +653,7 @@ class TDDefaultTheme {
}
},
{
"color": "#14000000",
"color": "#1F000000",
"blurRadius": 10,
"spreadRadius": -5,
"offset": {
Expand All @@ -673,4 +679,4 @@ class TDDefaultTheme {
}
}
''';
}
}
Loading