TF-3933 Avoid load font from google
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -70,7 +70,6 @@ class EditorFullscreenDialogView extends StatelessWidget {
|
||||
Expanded(
|
||||
child: IosHtmlContentViewerWidget(
|
||||
contentHtml: content,
|
||||
useDefaultFont: true,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import 'package:core/presentation/constants/constants_ui.dart';
|
||||
import 'package:core/utils/html/html_utils.dart';
|
||||
import 'package:core/utils/html/html_template.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
@@ -34,9 +34,9 @@ class MobileEditorWidget extends StatelessWidget {
|
||||
maxHeight: PlatformInfo.isIOS ? ConstantsUI.composerHtmlContentMaxHeight : null,
|
||||
addDefaultSelectionMenuItems: false,
|
||||
initialContent: content,
|
||||
customStyleCss: HtmlUtils.customCssStyleHtmlEditor(
|
||||
customStyleCss: HtmlTemplate.mobileCustomInternalStyleCSS(
|
||||
direction: direction,
|
||||
useDefaultFont: true,
|
||||
useDefaultFontStyle: true,
|
||||
),
|
||||
onCreated: (editorApi) => onCreatedEditorAction.call(context, editorApi, content),
|
||||
onCompleted: onLoadCompletedEditorAction,
|
||||
|
||||
@@ -121,11 +121,14 @@ class _WebEditorState extends State<WebEditorWidget> {
|
||||
darkMode: false,
|
||||
cacheHTMLAssetOffline: true,
|
||||
initialText: widget.content,
|
||||
customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(
|
||||
customBodyCssStyle: HtmlUtils.customInlineBodyCssStyleHtmlEditor(
|
||||
direction: widget.direction,
|
||||
horizontalPadding: widget.horizontalPadding,
|
||||
),
|
||||
customInternalCSS: HtmlTemplate.customInternalStyleCSS,
|
||||
customInternalCSS: HtmlTemplate.webCustomInternalStyleCSS(
|
||||
useDefaultFontStyle: true,
|
||||
customScrollbar: true,
|
||||
),
|
||||
spellCheck: true,
|
||||
disableDragAndDrop: true,
|
||||
webInitialScripts: UnmodifiableListView([
|
||||
|
||||
@@ -357,7 +357,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
mailtoDelegate: controller.openMailToLink,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
contentPadding: 0,
|
||||
useDefaultFont: true,
|
||||
useDefaultFontStyle: true,
|
||||
scrollController: scrollController,
|
||||
enableQuoteToggle: isInsideThreadDetailView,
|
||||
),
|
||||
@@ -381,7 +381,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
initialWidth: bodyConstraints.maxWidth,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
contentPadding: 0,
|
||||
useDefaultFont: true,
|
||||
useDefaultFontStyle: true,
|
||||
maxHtmlContentHeight: ConstantsUI.htmlContentMaxHeight,
|
||||
onMailtoDelegateAction: controller.openMailToLink,
|
||||
onHtmlContentClippedAction: controller.onHtmlContentClippedAction,
|
||||
@@ -421,7 +421,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
initialWidth: bodyConstraints.maxWidth,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
contentPadding: 0,
|
||||
useDefaultFont: true,
|
||||
useDefaultFontStyle: true,
|
||||
onMailtoDelegateAction: controller.openMailToLink,
|
||||
keepAlive: isInsideThreadDetailView,
|
||||
enableQuoteToggle: isInsideThreadDetailView,
|
||||
|
||||
@@ -50,6 +50,7 @@ class EventBodyContentWidget extends StatelessWidget {
|
||||
return HtmlContentViewerOnWeb(
|
||||
widthContent: constraints.maxWidth,
|
||||
contentHtml: content,
|
||||
useDefaultFontStyle: true,
|
||||
mailtoDelegate: onMailtoDelegateAction,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
scrollController: scrollController,
|
||||
@@ -64,6 +65,7 @@ class EventBodyContentWidget extends StatelessWidget {
|
||||
maxHtmlContentHeight: PlatformInfo.isIOS
|
||||
? ConstantsUI.htmlContentMaxHeight
|
||||
: null,
|
||||
useDefaultFontStyle: true,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
onMailtoDelegateAction: onMailtoDelegateAction
|
||||
);
|
||||
|
||||
@@ -71,7 +71,6 @@ class EmailPreviewerDialogView extends StatelessWidget {
|
||||
Expanded(
|
||||
child: IosHtmlContentViewerWidget(
|
||||
contentHtml: emlPreviewer.content,
|
||||
useDefaultFont: true,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
onMailtoDelegateAction: onMailtoDelegateAction,
|
||||
onPreviewEMLDelegateAction: onPreviewEMLDelegateAction,
|
||||
@@ -89,7 +88,7 @@ class EmailPreviewerDialogView extends StatelessWidget {
|
||||
child: HtmlContentViewer(
|
||||
contentHtml: emlPreviewer.content,
|
||||
initialWidth: context.width,
|
||||
useDefaultFont: true,
|
||||
useDefaultFontStyle: true,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
onMailtoDelegateAction: onMailtoDelegateAction,
|
||||
onPreviewEMLDelegateAction: onPreviewEMLDelegateAction,
|
||||
|
||||
@@ -58,6 +58,7 @@ class EmailPreviewerView extends GetWidget<EmailPreviewerController> {
|
||||
widthContent: context.width,
|
||||
heightContent: context.height,
|
||||
contentHtml: emlPreviewer.content,
|
||||
useDefaultFontStyle: true,
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
onClickHyperLinkAction: controller.onClickHyperLink,
|
||||
);
|
||||
|
||||
+4
-2
@@ -1,5 +1,6 @@
|
||||
import 'package:core/presentation/constants/constants_ui.dart';
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/utils/html/html_template.dart';
|
||||
import 'package:core/utils/html/html_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -143,9 +144,10 @@ class IdentitySignatureInputFieldWidget extends StatelessWidget
|
||||
initialText: initContent.isEmpty ? null : initContent,
|
||||
disableDragAndDrop: true,
|
||||
spellCheck: true,
|
||||
customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(
|
||||
customBodyCssStyle: HtmlUtils.customInlineBodyCssStyleHtmlEditor(
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
),
|
||||
customInternalCSS: HtmlTemplate.webCustomInternalStyleCSS(),
|
||||
),
|
||||
htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions(
|
||||
toolbarType: html_editor_browser.ToolbarType.hide,
|
||||
@@ -200,7 +202,7 @@ class IdentitySignatureInputFieldWidget extends StatelessWidget
|
||||
PlatformInfo.isIOS ? ConstantsUI.composerHtmlContentMaxHeight : null,
|
||||
addDefaultSelectionMenuItems: false,
|
||||
initialContent: initialContent ?? '',
|
||||
customStyleCss: HtmlUtils.customCssStyleHtmlEditor(
|
||||
customStyleCss: HtmlTemplate.mobileCustomInternalStyleCSS(
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
),
|
||||
onCreated: (editorApi) => controller.initRichTextForMobile(
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:core/presentation/utils/keyboard_utils.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
import 'package:core/presentation/views/responsive/responsive_widget.dart';
|
||||
import 'package:core/utils/html/html_template.dart';
|
||||
import 'package:core/utils/html/html_utils.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -484,7 +485,10 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
cacheHTMLAssetOffline: true,
|
||||
initialText: controller.vacationMessageHtmlText,
|
||||
spellCheck: true,
|
||||
customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context))
|
||||
customBodyCssStyle: HtmlUtils.customInlineBodyCssStyleHtmlEditor(
|
||||
direction: AppUtils.getCurrentDirection(context),
|
||||
),
|
||||
customInternalCSS: HtmlTemplate.webCustomInternalStyleCSS(),
|
||||
),
|
||||
htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions(
|
||||
toolbarType: html_editor_browser.ToolbarType.hide,
|
||||
@@ -510,7 +514,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
||||
maxHeight: PlatformInfo.isIOS ? ConstantsUI.composerHtmlContentMaxHeight : null,
|
||||
addDefaultSelectionMenuItems: false,
|
||||
initialContent: controller.vacationMessageHtmlText ?? '',
|
||||
customStyleCss: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context)),
|
||||
customStyleCss: HtmlTemplate.mobileCustomInternalStyleCSS(direction: AppUtils.getCurrentDirection(context)),
|
||||
onCreated: (editorApi) => controller.initRichTextForMobile(context, editorApi)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user