The keyboard automatically opens when I click on a input box, but when I press okay or elsewhere, the keyboard does not automatically close. How can I hide soft keyboard on losing focus?
class _ExampleState extends State<Example> {
@override
Widget build(BuildContext context) {
return WillPopScope(
child: Scaffold(
body: Builder(builder: (BuildContext context) {
return WebView(
initialUrl: 'https://google.com',
javascriptMode: JavascriptMode.unrestricted,
);
}),
),
);
}
}
I added the code block below to my code, but it didn't work. Webview remained on the white screen.
@override
void initState() {
super.initState();
// Enable hybrid composition.
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}