flutter webview keyboard cannot show up - flutter

I tried to integrate the webview, in the flutter app. After adding the code in the example, the page loads normally, but when I click on the input box in the page, no soft keyboard pops up,

This problem only happens on Android and it is a known issue here. https://github.com/flutter/flutter/issues/19718.
If your app does not need the webview to be on the same screen with other Flutter widgets, I recommend this webview library from the Flutter community. There is no keyboard issue here. https://pub.dartlang.org/packages/flutter_webview_plugin

I have tried multiple things but finally i have fixed it through scaffold, now my keyboard is opening.
just wrap your WebView inside Scaffold widget and apply following property inside scaffold.
resizeToAvoidBottomInset: false,

I know it's late but changing the webview version to v3.0.0 actually solved the issue for me.

This one can use for now. Hope flutter team fix it soon.
You need to open your android project in Android Studio to view all dependencies and in the webview_flutter
To fix most recent version of code, besides import
import android.app.Activity;
import io.flutter.app.FlutterApplication;
Change:
webView = new InputAwareWebView(context, containerView);
To:
Context activityContext = context;
Context appContext = context.getApplicationContext();
if (appContext instanceof FlutterApplication) {
Activity currentActivity = ((FlutterApplication) appContext).getCurrentActivity();
if (currentActivity != null) {
activityContext = currentActivity;
}
}
webView = new InputAwareWebView(activityContext, containerView);
Original answer here: #ryanhz https://github.com/flutter/flutter/issues/25767#issuecomment-588603862

Related

ImageCache is reset to zero when I open iOS plugin by MethodChannel

I am trying to use iOS image picker plugin in my Flutter using MethodChannel.
But I found that if I open and close the image picker(My Image Picker button), ImageCache is reset to zero.
So NetworkImage gets loading again like it has never been downloaded before.
On the other hand, Flutter's image picker(Flutter Image Picker button) doesn't reset ImageCache to zero so it is fine.
Why is this happening? Did I miss something?
I have tried overriding ImageCache size like below but the problem is not solved:
overriding image cache in Flutter
Please help me...
my app home tab
my app image tab
flutter image picker
I recommend to use flutter package to make developer easier to code and even the package also use MethodChannel, inside code is also coded pretty well such as error handler etc. It is also works for IOS and Android, which is this is the function of Flutter that make developer easier to deploy IOS and Android apps.
You can explore more about this:
https://pub.dev/packages/image_picker
https://pub.dev/packages/cached_network_image/example

Tap Jacking protection for Flutter apps

I have seen that there wont be any way of providing Tap jacking for flutter apps but I came across this
saying,
It is possible to globally disable all touches when obscured by setting this property on the root view in your MainActivity (Kotlin code Sample):
val view = findViewById<View>(android.R.id.content).rootView
view.filterTouchesWhenObscured = true
Any suggestions how to convert the above code in dart Language for Flutter App
There's no solution for this yet by the flutter community.
It's still an open issue on flutter's gh https://github.com/flutter/flutter/issues/40422

How to tap to copy html text in flutter app

My developer is building an educational app for me and we kind of have a problem. I want to know how to tap a word or phrase on the screen to show copy, highlight, web search like the image below. The app was built with flutter and the code is in dart. This feature is really needed. Will appreciate if someone can help with a plugin or just a way to do this.
If you are using webview package you have a gestureRecognizers property in webview widget, just add this line:
WebViewPlus(
gestureRecognizers: {}..add(Factory<LongPressGestureRecognizer>(() =>
LongPressGestureRecognizer())),...)
Flutter has selectable text for that
If he is using webview, maybe this could help?
How to enable text selection modal(copy/paste/select) in flutter webview?
They is a package for copy and paste text in the flutter.
FlutterClipboard.copy(item.code).then((value) {})
package link
Well I got your problem.
There is a possible solution. Here you are doing is sending data from server in html format and displayed it using html_viwer. But there is no functionality I found to select and copy so far.
The possible solution is send string data from server and use SelectableText() to show the text and you will be able to select and copy your text.
There's a solution for this, just use SelectableHtml widget instead of only Html

How to hide the the navigationbar that present in pdf viewer plugin flutter

I need to hide the navigation bar that present default in the pdfviewer plugin flutter.I used to change the value of showNavigation value to false but it doesn't work .I use the plugin flutter_plugin_pdf_viewer:any here is my code:
Containe( width:130,
height:130,
margin:EdgeInsets.all(20.0),
child:PDFViewer(document:doc2,
showNavigation : false,/*here is my issue ,when i set like this it shows nothing in the UI*/ ),)
This plugin solves this issue please check the below link
https://github.com/lohanidamodar/pdf_viewer/pull/2
Use this plugin
advance_pdf_viewer: any
I have solved this issue by changing source code of this plugin. for hiding navigation tool bar in the pdf viewer plugin use this plugin for viewing only single page from pdf :)
https://github.com/SmilingDeveloper/newpdf_viewer.git

RE:Create a button which when pressed it replaces an existing object on the screen to another object in Smartface App Studio?

After seeing #catherinelagoon's post I also having difficulty in quite understand how to replace an object using a button so is it possible to create a button which when pressed it replaces an existing object on the screen to another object in Smartface App Studio?
I tried using the answer provided in the post however I couldn't understand it much due to I'm a beginner in using Smartface App Studio and coding itself.
Thankyou and sorry for any inconvienience
After you create an image you should add it to a Page so it can show on that page. So here is a simple code for creating and showing an image on the page.
var image = new SMF.UI.Image({
visible: false
});
Pages.Page1.add(image);
function Page1_TextButton1_OnPressed(e) {
image.visible = true;
}