TF-105 [BUG] Fix one line message is not displayed well
This commit is contained in:
@@ -137,6 +137,8 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
crossPlatform: InAppWebViewOptions(
|
crossPlatform: InAppWebViewOptions(
|
||||||
useShouldOverrideUrlLoading: true,
|
useShouldOverrideUrlLoading: true,
|
||||||
verticalScrollBarEnabled: false,
|
verticalScrollBarEnabled: false,
|
||||||
|
disableVerticalScroll: true,
|
||||||
|
transparentBackground: true,
|
||||||
),
|
),
|
||||||
android: AndroidInAppWebViewOptions(
|
android: AndroidInAppWebViewOptions(
|
||||||
useHybridComposition: true,
|
useHybridComposition: true,
|
||||||
@@ -144,6 +146,7 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
ios: IOSInAppWebViewOptions(
|
ios: IOSInAppWebViewOptions(
|
||||||
allowsInlineMediaPlayback: true,
|
allowsInlineMediaPlayback: true,
|
||||||
enableViewportScale: true,
|
enableViewportScale: true,
|
||||||
|
allowsLinkPreview: false
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
onLoadStart: (controller, uri) {
|
onLoadStart: (controller, uri) {
|
||||||
@@ -157,8 +160,9 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
if (scrollHeight != null) {
|
if (scrollHeight != null) {
|
||||||
final scrollWidth = (await controller.evaluateJavascript(source: 'document.body.scrollWidth'));
|
final scrollWidth = (await controller.evaluateJavascript(source: 'document.body.scrollWidth'));
|
||||||
final size = MediaQuery.of(context).size;
|
final size = MediaQuery.of(context).size;
|
||||||
if (scrollWidth > size.width) {
|
final containerWidth = size.width - 60.0;
|
||||||
var scale = (size.width / scrollWidth);
|
if (scrollWidth > containerWidth) {
|
||||||
|
var scale = (containerWidth / scrollWidth);
|
||||||
if (scale < 0.2) {
|
if (scale < 0.2) {
|
||||||
scale = 0.2;
|
scale = 0.2;
|
||||||
}
|
}
|
||||||
@@ -166,7 +170,7 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
scrollHeight = (scrollHeight * scale).ceil();
|
scrollHeight = (scrollHeight * scale).ceil();
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_webViewContentHeight = double.tryParse('${scrollHeight + 10.0}');
|
_webViewContentHeight = double.tryParse('${scrollHeight + 24}');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user