lucianoiam/flutter-webapp

Handle web inputs

azkdev opened this issue ยท 6 comments

Hi there, thank you for your work on this extended plugin =)
Do you have some thinks about how to handle web inputs? I mean that when we try to focus web inputs, there is not triggering keyboard on android =(
Can be this solved or not yet ?
Thanks for help again, and sorry for my English ๐Ÿ‘

Hi, thanks for reporting the issue. You are right, text input is broken on Android. Seems the underlying cause is a limitation in Flutter's PlatformView. flutter-webapp relies on webview_flutter, which in turn relies on PlatformView. Here are some interesting links on the topic:

flutter/flutter#25436
flutter/flutter#19718
flutter/engine#5845

Temporary workarounds:

  • Fork Flutter and remove WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE from shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java . Keyboard pops up, but disappears immediately. Probably no trivial solution on the native side.

  • Switch webview to https://github.com/fluttercommunity/flutter_webview_plugin . This plugin is reported to play nice with text input, but it won't allow the app to display a flutter view on top of web content.

I created a new branch https://github.com/iamluciano/flutter-webapp/tree/altwebview that implements workaround #2, give it a try.

@iamluciano fantastic job =)
thank you a lot for your contribution! =)

it's a free template to use ?
i mean, i can build my own hybrid web - android app using your template? =)
thank you again =)

Yes sure go ahead, I released this under a permissive Apache license. If you ever launch a public app to the stores, let me know so I add it to the project's portfolio :)

Thank you,
of course when i will publish my app on Play Market and App Store i can give you both links =)

maybe do you have a skype account or are u using slack ? =)

I am not a huge fan of managing multiple online services, you can reach me at my personal email lucianito@gmail.com

I'm closing this ticket =)
Thank you a lot =)