I'm developing application with Flutter and webview_flutter package.
With default configuration I'm getting a white box at bottom of screen.
When I put this code to Scaffold:
resizeToAvoidBottomInset: true
it's disappear:
But in that case Webview not auto resizing when virtual keyboard openned.
If i don't use "resizeToAvoidBottomInset: true" it resizing but white box in the first picture appears.
Is there an another way to clear that white box?
My code:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter/services.dart';
class WebViewExample extends StatefulWidget {
@override
_WebViewExampleState createState() => _WebViewExampleState();
}
class _WebViewExampleState extends State<WebViewExample> {
final Completer<WebViewController> _controller =
Completer<WebViewController>();
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([]);
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: null,
body: Builder(builder: (BuildContext context) {
return WebView(
userAgent: "random",
initialUrl: 'https://www.2harf.com',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
onPageStarted: (String url) {
print('Page started loading: $url');
},
onPageFinished: (String url) {
print('Page finished loading: $url');
},
gestureNavigationEnabled: false,
);
})
);
}