enter image description here
please when I select from my dropdown it displays the following error: getSelectedText on inactive InputConnection & getTextAfterCursor on inactive InputConnection problem on flutter
It happens to me as well because of another function running in background of same context. But if it doesn't gives you an error then that's ok(as in my case).
But if it gives error you just check if two or more function or build running simultaneously.
OR
Share the full code here (your code has only a portion of it)so we can check it.
Related
1
Error:
I/TextInputPlugin(22952): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper(22952): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(22952): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(22952): getTextAfterCursor on inactive InputConnection
Is anyone how to solve this?
use a TextEditingController() to store the value in the textfield controller.
and then call the text value using theController.text .
this error is due to the keyboard being manually closed, it causes a rebuild.
make sure you're doing this in a stateful widget.
check this image for a guide.
TextEditingController
when i am trying to navigate screen i am getting this error
Error is this
consider canceling any active work during "dispose" or using the "mounted"
on line 81 write if(mounted){ //your code }
i suspect the issue is with the widget being already disposed, look at the line before this
flutter (11689): Consider canceling
in your log, it says the widget was already unmounted and you're trying to access the context,
also consider using this instead of timer (which i also suspect is causing an issue)
await Future.delayed(Duration(seconds:3))
then navigating
While changing keyboard type from TextInputType.text to TextInputType.phone inside Form receiving this error:
W/IInputConnectionWrapper(13712): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(13712): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(13712): getTextAfterCursor on inactive InputConnection
The widget is StatefulWidget
I don't think you can call them errors (or at least not breaking errors because they won't crash the app)
This long and still open issue on github addresses the problem and there seem to be no way to stop these warnings (until now) that are being caused by clearing the TextField
I just upgraded flutter and right after the upgrade I am getting quite a bunch of logs in the console, which don't make sense to me, tried to surf the internet for such sort of errors but apparently there don't seem to be any traces of these kind of errors: For a start, you guys can help me in trying to understand these and how to go about this because it is getting to be quite hard to debug: I must also mention though that the they don't stop the app from running:
I/HwPhoneWindow(25343): updateLayoutParamsColor false mSpecialSet=true, mForcedNavigationBarColor=true, navigationBarColor=ff6451fe, mNavBarShow=true, mIsFloating=false
I/HwPhoneWindow(25343): updateLayoutParamsColor false mSpecialSet=true, mForcedNavigationBarColor=true, navigationBarColor=ff6451fe, mNavBarShow=true, mIsFloating=false
V/InputMethodManager(25343): Reporting focus gain, without startInput
V/InputMethodManager(25343): Reporting focus gain, without startInput
Similarly whenever I get the following when I touch anywhere on the screen:
W/HiTouch_PressGestureDetector(25343): Touch pointer move a lot. The moving distance of X is:2.0, limit is:51The moving distance of Y is:69.0, limit is:51
Below log also just appears am currently not sure of what is triggering this yet:
W/InputMethodManager(25343): startInputReason = 8
W/IInputConnectionWrapper(25343): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(25343): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(25343): requestCursorAnchorInfo on inactive InputConnection
D/ZrHung.AppEyeUiProbe(25343): stop checker.
W/libEGL (25343): EGLNativeWindowType 0x755f41b010 disconnect failed
D/ViewRootImpl[MainActivity](25343): surface should not be released
D/FlutterView(25343): Detaching from a FlutterEngine:
io.flutter.embedding.engine.FlutterEngine#486f178
W/InputMethodManager(25343): startInputReason = 3
W/IInputConnectionWrapper(25343): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(25343): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(25343): requestCursorAnchorInfo on inactive InputConnection
W/libEGL (25343): EGLNativeWindowType 0x75660d7010 disconnect failed
V/ActivityThread(25343): Handle window ActivityRecord{d450bd5 token=android.os.BinderProxy#c9b5ecf{com.example.cmed/com.example.cmed.MainActivity}} visibility: false
D/ZrHung.AppEyeUiProbe(25343): Current Activity:false
D/ZrHung.AppEyeUiProbe(25343): not watching, wait.
E/ (25343): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]
As I'd earlier stated in the comments, there is an issue with flutter v1.12.13+hotfix.8. The issue is currently not resolved yet but you can work around the problem as of now by downgrading:
run:
flutter version v1.12.13+hotfix.7
This is because hotfix.8 is missing log filters
I have a webview with a credit card entry form (with standard <input type="text" /> fields). In different versions of Android I get different keyboards. Kit-Kat seems to not show Prev / Next keys when inside the form.
On the web side, do I have any influence over this?
If not, what
should I recommend to the developer for the Android side?
Example without Prev / Next:
Same webview, with Prev / Next:
You can control the keyboard from the WebView, but as other answers suggest it may not work with every keyboard ever made. Despite that, I typically find most mainstream keyboards have implemented the behaviour I want.
The WebView has a method called onCreateInputConnection. You can hook into this method and add (and/or remove) flags to the inputType and/or imeOptions. There are many flags available to you.
Check out the EditorInfo options, in particular IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS. See usage below (which removes the prev/next flags from the keyboard options):
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
outAttrs.imeOptions = outAttrs.imeOptions & ~EditorInfo.IME_FLAG_NAVIGATE_NEXT &
~EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
return inputConnection;
}
Another thing you could try is to hide the entire suggestions bar using the InputType flags TYPE_TEXT_FLAG_NO_SUGGESTIONS. See example below (which adds the "no suggestions" flag to the input type):
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
outAttrs.inputType = outAttrs.inputType | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return inputConnection;
}
There are many other flags available to have a play with to customise the IME directly from the WebView. Refer the developer to the linked pages and you should hopefully be able to achieve the behaviour you are after on most keyboards.
You do have some minimal control, but not that much. The type of the control (passowrd, numeric, text) will be sent to the soft keyboard and used to change how things are displayed. However, the choices the keyboard makes based on those options are keyboard specific- the Google keyboard reacts differently than Swype, which reacts differently than Swiftkey, which reacts differently than the Samsung keyboard, etc. You can't really count on a specific behavior.
Tried on Android Studio 3.0 (SDK API 26), the answer https://stackoverflow.com/a/23462658/3286489 crashes. After search further found this working.
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = new BaseInputConnection(this, true);
outAttrs.imeOptions = outAttrs.imeOptions & ~EditorInfo.IME_FLAG_NAVIGATE_NEXT &
~EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
return inputConnection;
}
And
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = new BaseInputConnection(this, true);
outAttrs.inputType = outAttrs.inputType | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return inputConnection;
}