Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a70e8a011f |
@@ -111,12 +111,16 @@ class _SecureEmailWebViewState extends State<SecureEmailWebView> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Future<void> _measureHeight(String _) async {
|
Future<void> _measureHeight(String _) async {
|
||||||
final result = await _controller!.runJavaScriptReturningResult(
|
try {
|
||||||
'document.documentElement.scrollHeight',
|
final result = await _controller!.runJavaScriptReturningResult(
|
||||||
);
|
'document.documentElement.scrollHeight',
|
||||||
final h = double.tryParse(result.toString());
|
);
|
||||||
if (h != null && h > 0 && mounted) {
|
final h = double.tryParse(result.toString());
|
||||||
setState(() => _height = h);
|
if (h != null && h > 0 && mounted) {
|
||||||
|
setState(() => _height = h);
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
// WebView not ready yet; height stays at default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user