diff --git a/tdesign-component/example/lib/page/td_input_page.dart b/tdesign-component/example/lib/page/td_input_page.dart index a1677427f..0d3b1ba88 100644 --- a/tdesign-component/example/lib/page/td_input_page.dart +++ b/tdesign-component/example/lib/page/td_input_page.dart @@ -641,6 +641,7 @@ class _TDInputViewPageState extends State { color: TDTheme.of(context).textColorPrimary, ), maxLines: 2, + minLines: 1, ); } diff --git a/tdesign-component/lib/src/components/avatar/td_avatar.dart b/tdesign-component/lib/src/components/avatar/td_avatar.dart index 5a61b0137..bd59da21c 100644 --- a/tdesign-component/lib/src/components/avatar/td_avatar.dart +++ b/tdesign-component/lib/src/components/avatar/td_avatar.dart @@ -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; diff --git a/tdesign-component/lib/src/components/button/td_button_style.dart b/tdesign-component/lib/src/components/button/td_button_style.dart index 70c949bdd..ef103ff3d 100644 --- a/tdesign-component/lib/src/components/button/td_button_style.dart +++ b/tdesign-component/lib/src/components/button/td_button_style.dart @@ -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: @@ -152,6 +152,7 @@ class TDButtonStyle { } } + Color _getLightColor(BuildContext context, TDButtonStatus status) { switch (status) { case TDButtonStatus.defaultState: @@ -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: @@ -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; } diff --git a/tdesign-component/lib/src/components/input/td_input.dart b/tdesign-component/lib/src/components/input/td_input.dart index ec4ed5418..e492b6c50 100644 --- a/tdesign-component/lib/src/components/input/td_input.dart +++ b/tdesign-component/lib/src/components/input/td_input.dart @@ -41,6 +41,7 @@ class TDInput extends StatelessWidget { this.inputFormatters, this.inputDecoration, this.maxLines = 1, + this.minLines = 1, this.focusNode, this.controller, this.cursorColor, @@ -121,6 +122,9 @@ class TDInput extends StatelessWidget { /// 最大输入行数 final int maxLines; + /// 最小输入行数 + final int minLines; + /// 获取或者取消焦点使用 final FocusNode? focusNode; @@ -410,6 +414,7 @@ class TDInput extends StatelessWidget { inputFormatters: inputFormatters, inputDecoration: inputDecoration, maxLines: maxLines, + minLines: minLines, maxLength: maxLength, focusNode: focusNode, isCollapsed: true, @@ -646,6 +651,7 @@ class TDInput extends StatelessWidget { inputDecoration: inputDecoration, isCollapsed: true, maxLines: maxLines, + minLines: minLines, focusNode: focusNode, hintTextStyle: hintTextStyle ?? TextStyle( @@ -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), @@ -856,6 +863,7 @@ class TDInput extends StatelessWidget { inputFormatters: inputFormatters, inputDecoration: inputDecoration, maxLines: maxLines, + minLines: minLines, focusNode: focusNode, isCollapsed: true, hintTextStyle: hintTextStyle ?? diff --git a/tdesign-component/lib/src/components/navbar/td_nav_bar.dart b/tdesign-component/lib/src/components/navbar/td_nav_bar.dart index 9c5cfcf7c..b97790320 100644 --- a/tdesign-component/lib/src/components/navbar/td_nav_bar.dart +++ b/tdesign-component/lib/src/components/navbar/td_nav_bar.dart @@ -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, @@ -30,6 +31,9 @@ class TDNavBar extends StatefulWidget implements PreferredSizeWidget { this.flexibleSpace, }) : super(key: key); + /// 左边返回图标颜色 + final Color? backIconColor; + /// 左边操作项 final List? leftBarItems; @@ -139,9 +143,11 @@ class _TDNavBarState extends State { } 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); diff --git a/tdesign-component/lib/src/theme/td_colors.dart b/tdesign-component/lib/src/theme/td_colors.dart index 6c8dcdaef..391e6ed52 100644 --- a/tdesign-component/lib/src/theme/td_colors.dart +++ b/tdesign-component/lib/src/theme/td_colors.dart @@ -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; } diff --git a/tdesign-component/lib/src/theme/td_default_theme.dart b/tdesign-component/lib/src/theme/td_default_theme.dart index c69dcebf0..d92f45e22 100644 --- a/tdesign-component/lib/src/theme/td_default_theme.dart +++ b/tdesign-component/lib/src/theme/td_default_theme.dart @@ -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", @@ -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", @@ -120,7 +120,10 @@ class TDDefaultTheme { "bgColorContainer": "#ffffff", "bgColorContainerSelect": "#ffffff", "bgColorSpecialComponent": "#ffffff", - "textColorAnti": "#ffffff" + "textColorAnti": "#ffffff", + "defaultBtnBgColor": "#E8E8E8", + "defaultBtnTextColor": "#000000", + "primaryBtnTextColor": "#FFFFFF" }, "font": { "fontDisplayLarge": { @@ -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", @@ -454,7 +457,10 @@ class TDDefaultTheme { "fontGyColor2": "#99000000", "fontGyColor3": "#66000000", "fontGyColor4": "#42000000", - "textColorAnti": "#ffffff" + "textColorAnti": "#ffffff", + "defaultBtnBgColor": "#5E5E5E", + "defaultBtnTextColor": "#000000", + "primaryBtnTextColor": "#000000" }, "font": { "fontDisplayLarge": { @@ -571,7 +577,7 @@ class TDDefaultTheme { "shadow": { "shadowsBase": [ { - "color": "#0D000000", + "color": "#1A000000", "blurRadius": 10, "spreadRadius": 1, "offset": { @@ -580,7 +586,7 @@ class TDDefaultTheme { } }, { - "color": "#14000000", + "color": "#1F000000", "blurRadius": 5, "spreadRadius": 1, "offset": { @@ -589,7 +595,7 @@ class TDDefaultTheme { } }, { - "color": "#1F000000", + "color": "#29000000", "blurRadius": 4, "spreadRadius": -1, "offset": { @@ -600,7 +606,7 @@ class TDDefaultTheme { ], "shadowsMiddle": [ { - "color": "#0D000000", + "color": "#1A000000", "blurRadius": 14, "spreadRadius": 2, "offset": { @@ -609,7 +615,7 @@ class TDDefaultTheme { } }, { - "color": "#0F000000", + "color": "#1F000000", "blurRadius": 10, "spreadRadius": 1, "offset": { @@ -618,7 +624,7 @@ class TDDefaultTheme { } }, { - "color": "#1A000000", + "color": "#24000000", "blurRadius": 5, "spreadRadius": -3, "offset": { @@ -629,7 +635,7 @@ class TDDefaultTheme { ], "shadowsTop": [ { - "color": "#0D000000", + "color": "#1A000000", "blurRadius": 30, "spreadRadius": 5, "offset": { @@ -638,7 +644,7 @@ class TDDefaultTheme { } }, { - "color": "#0A000000", + "color": "#14000000", "blurRadius": 24, "spreadRadius": 2, "offset": { @@ -647,7 +653,7 @@ class TDDefaultTheme { } }, { - "color": "#14000000", + "color": "#1F000000", "blurRadius": 10, "spreadRadius": -5, "offset": { @@ -673,4 +679,4 @@ class TDDefaultTheme { } } '''; -} +} \ No newline at end of file