From a282c8b281361c7f181ad5aa1e1bf0aa64be92a7 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 12 Oct 2021 00:47:14 +0700 Subject: [PATCH] TF-105 [BUG] Fix one line message is not displayed well --- .../views/html_viewer/html_content_viewer_widget.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 74973d8aa..aa791477b 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 @@ -137,6 +137,8 @@ class _HtmlContentViewState extends State { crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, verticalScrollBarEnabled: false, + disableVerticalScroll: true, + transparentBackground: true, ), android: AndroidInAppWebViewOptions( useHybridComposition: true, @@ -144,6 +146,7 @@ class _HtmlContentViewState extends State { ios: IOSInAppWebViewOptions( allowsInlineMediaPlayback: true, enableViewportScale: true, + allowsLinkPreview: false ) ), onLoadStart: (controller, uri) { @@ -157,8 +160,9 @@ class _HtmlContentViewState extends State { if (scrollHeight != null) { final scrollWidth = (await controller.evaluateJavascript(source: 'document.body.scrollWidth')); final size = MediaQuery.of(context).size; - if (scrollWidth > size.width) { - var scale = (size.width / scrollWidth); + final containerWidth = size.width - 60.0; + if (scrollWidth > containerWidth) { + var scale = (containerWidth / scrollWidth); if (scale < 0.2) { scale = 0.2; } @@ -166,7 +170,7 @@ class _HtmlContentViewState extends State { scrollHeight = (scrollHeight * scale).ceil(); } setState(() { - _webViewContentHeight = double.tryParse('${scrollHeight + 10.0}'); + _webViewContentHeight = double.tryParse('${scrollHeight + 24}'); }); }