diff --git a/core/lib/presentation/extensions/color_extension.dart b/core/lib/presentation/extensions/color_extension.dart index e99e62270..9304e58e9 100644 --- a/core/lib/presentation/extensions/color_extension.dart +++ b/core/lib/presentation/extensions/color_extension.dart @@ -93,7 +93,6 @@ extension AppColor on Color { static const colorDividerEmailView = Color(0xFFD7D8D9); static const colorButton = Color(0xFF959DAD); static const colorTime = Color(0xFF92A1B4); - static const colorEmailAddressPrefix = Color(0xFF9AA7B6); static const colorEmailAddressTag = Color(0xFFF4F4F4); static const colorLineLeftEmailView = Color(0x2999A2AD); static const colorShadowComposer = Color(0x1F000000); @@ -258,6 +257,7 @@ extension AppColor on Color { static const gray424244 = Color(0xFF424244); static const lightGrayF4F4F4 = Color(0xFFF4F4F4); static const gray959DAD = Color(0xFF959DAD); + static const gray9AA7B6 = Color(0xFF9AA7B6); static const redFF3347 = Color(0xFFFF3347); static const gray686E76 = Color(0xFF686E76); static const lightGrayEBEDF0 = Color(0xFFEBEDF0); diff --git a/core/lib/presentation/utils/theme_utils.dart b/core/lib/presentation/utils/theme_utils.dart index fb2d93337..ad685fcfc 100644 --- a/core/lib/presentation/utils/theme_utils.dart +++ b/core/lib/presentation/utils/theme_utils.dart @@ -142,6 +142,14 @@ class ThemeUtils { backgroundColor: backgroundColor, ); + static TextStyle textStyleBodySmallHeadline = defaultTextStyleInterFont.copyWith( + fontWeight: FontWeight.w600, + letterSpacing: -0.13, + fontSize: 13, + height: 16 / 13, + color: Colors.black, + ); + static TextStyle textStyleHeadingH6({ Color? color, FontWeight? fontWeight, diff --git a/core/lib/presentation/views/html_viewer/html_content_viewer_on_web_widget.dart b/core/lib/presentation/views/html_viewer/html_content_viewer_on_web_widget.dart index 2c23c6959..13db0016a 100644 --- a/core/lib/presentation/views/html_viewer/html_content_viewer_on_web_widget.dart +++ b/core/lib/presentation/views/html_viewer/html_content_viewer_on_web_widget.dart @@ -23,6 +23,7 @@ class HtmlContentViewerOnWeb extends StatefulWidget { final TextDirection? direction; final double? contentPadding; final bool useDefaultFontStyle; + final double fontSize; /// Handler for mailto: links final OnMailtoClicked? mailtoDelegate; @@ -60,6 +61,7 @@ class HtmlContentViewerOnWeb extends StatefulWidget { this.keepAlive = false, this.disableScrolling = false, this.autoAdjustHeight = false, + this.fontSize = 14, this.htmlContentMinHeight = ConstantsUI.htmlContentMinHeight, this.htmlContentMinWidth = ConstantsUI.htmlContentMinWidth, this.offsetHtmlContentHeight = ConstantsUI.htmlContentOffsetHeight, @@ -406,6 +408,7 @@ class _HtmlContentViewerOnWebState extends State direction: widget.direction, contentPadding: widget.contentPadding, useDefaultFontStyle: widget.useDefaultFontStyle, + fontSize: widget.fontSize, ); return htmlTemplate; diff --git a/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart b/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart index 4a5773cdd..d7d474cd1 100644 --- a/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart +++ b/core/lib/presentation/views/html_viewer/html_content_viewer_widget.dart @@ -30,6 +30,7 @@ class HtmlContentViewer extends StatefulWidget { final bool keepWidthWhileLoading; final double? contentPadding; final bool useDefaultFontStyle; + final double fontSize; final double? maxHtmlContentHeight; final double htmlContentMinHeight; final double offsetHtmlContentHeight; @@ -58,6 +59,7 @@ class HtmlContentViewer extends StatefulWidget { this.contentPadding, this.useDefaultFontStyle = false, this.disableScrolling = false, + this.fontSize = 16, this.maxViewHeight, this.maxHtmlContentHeight, this.onLoadWidthHtmlViewer, @@ -151,6 +153,7 @@ class HtmlContentViewState extends State with AutomaticKeepAl styleCSS: combinedCss, contentPadding: widget.contentPadding, useDefaultFontStyle: widget.useDefaultFontStyle, + fontSize: widget.fontSize, ); } diff --git a/core/lib/presentation/views/html_viewer/ios_html_content_viewer_widget.dart b/core/lib/presentation/views/html_viewer/ios_html_content_viewer_widget.dart index 126c4ed1a..4a456cafb 100644 --- a/core/lib/presentation/views/html_viewer/ios_html_content_viewer_widget.dart +++ b/core/lib/presentation/views/html_viewer/ios_html_content_viewer_widget.dart @@ -54,6 +54,7 @@ class _IosHtmlContentViewerWidgetState extends State direction: widget.direction, javaScripts: HtmlInteraction.scriptsHandleLazyLoadingBackgroundImage, useDefaultFontStyle: widget.useDefaultFontStyle, + fontSize: 16, )); } diff --git a/core/lib/presentation/views/image/avatar_builder.dart b/core/lib/presentation/views/image/avatar_builder.dart index 7ebd5298c..7e0b91f86 100644 --- a/core/lib/presentation/views/image/avatar_builder.dart +++ b/core/lib/presentation/views/image/avatar_builder.dart @@ -18,6 +18,7 @@ class AvatarBuilder { List? _avatarColors; List? _boxShadows; TextStyle? _textStyle; + EdgeInsetsGeometry? _padding; void key(Key key) { _key = key; @@ -55,6 +56,10 @@ class AvatarBuilder { _textStyle = textStyle; } + void addPadding(EdgeInsetsGeometry? padding) { + _padding = padding; + } + void addOnTapActionClick(OnTapAvatarActionClick onTapAvatarActionClick) { _onTapAvatarActionClick = onTapAvatarActionClick; } @@ -64,7 +69,7 @@ class AvatarBuilder { } Widget build() { - return InkWell( + final bodyWidget = InkWell( onTap: _onTapAvatarActionClick, onTapDown: (detail) { if (_onTapAvatarActionWithPositionClick != null && _context != null) { @@ -102,5 +107,11 @@ class AvatarBuilder { ) ), ); + + if (_padding != null) { + return Padding(padding: _padding!, child: bodyWidget); + } else { + return bodyWidget; + } } } \ No newline at end of file diff --git a/core/lib/utils/html/html_template.dart b/core/lib/utils/html/html_template.dart index 1c37fdc6b..fd1da0ebb 100644 --- a/core/lib/utils/html/html_template.dart +++ b/core/lib/utils/html/html_template.dart @@ -103,12 +103,11 @@ class HtmlTemplate { } '''; - static const String defaultFontStyle = ''' - div, p, span, th, td, tr, ul, ol, li, a, button { + static String defaultFontStyle({double fontSize = 14}) => ''' + body { font-weight: 400; - font-size: 16px; - line-height: 24px; - letter-spacing: -0.01em; /* -1% */ + font-size: ${fontSize}px; + font-style: normal; } p { diff --git a/core/lib/utils/html/html_utils.dart b/core/lib/utils/html/html_utils.dart index 546b04fef..65e166903 100644 --- a/core/lib/utils/html/html_utils.dart +++ b/core/lib/utils/html/html_utils.dart @@ -123,6 +123,7 @@ class HtmlUtils { String? javaScripts, bool hideScrollBar = true, bool useDefaultFontStyle = false, + double fontSize = 14, TextDirection? direction, double? contentPadding, }) { @@ -135,7 +136,7 @@ class HtmlUtils {