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 6bcf85cbf..31f4b3bc2 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
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:io';
+import 'dart:ui';
import 'package:core/core.dart';
import 'package:flutter/cupertino.dart';
@@ -44,7 +45,7 @@ class _HtmlContentViewState extends State {
late double actualHeight;
double minHeight = 100;
double minWidth = 300;
- final double maxHeightForAndroid = 6000;
+ late double maxHeightForAndroid;
String? _htmlData;
late WebViewController _webViewController;
bool _isLoading = true;
@@ -53,6 +54,8 @@ class _HtmlContentViewState extends State {
void initState() {
super.initState();
actualHeight = widget.heightContent;
+ maxHeightForAndroid = window.physicalSize.height;
+ log('_HtmlContentViewState::initState(): maxHeightForAndroid: $maxHeightForAndroid');
_htmlData = _generateHtmlDocument(widget.contentHtml);
}
@@ -64,7 +67,6 @@ class _HtmlContentViewState extends State {
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
- log('_HtmlContentViewState::build(): maxWidth: ${constraints.maxWidth}');
return Stack(
children: [
SizedBox(
@@ -109,7 +111,7 @@ class _HtmlContentViewState extends State {
if (scrollHeightWithBuffer > minHeight) {
setState(() {
//TODO: It hotfix for web_view crash on android device and waiting lib web_view update to fix this issue
- if(Platform.isAndroid && scrollHeightWithBuffer > maxHeightForAndroid){
+ if (Platform.isAndroid && scrollHeightWithBuffer > maxHeightForAndroid){
actualHeight = maxHeightForAndroid;
} else {
actualHeight = scrollHeightWithBuffer;