flutter_webview_plugin icon indicating copy to clipboard operation
flutter_webview_plugin copied to clipboard

Make WebViewStateChanged's navigationType nullable

Open micaelcid opened this issue 3 years ago • 13 comments

Description

After updating our app to use the latest null-safety release, we realized the onStateChanged stream stopped working in our Android devices and emulators.

After a few hours of debugging with @wescosta, we realized navigationType wasn't defined in the Map<String, dynamic> - so making it nullable resolved the issue.

Now all our WebViews are back and working like they used to.

Even the example project wasn't working before these changes. The WebviewScaffold with hidden was in a infinite "Waiting..." state.

micaelcid avatar Jun 07 '21 20:06 micaelcid

Please, take a look @charafau

micaelcid avatar Jun 09 '21 14:06 micaelcid

It is happening on iPhone also. Web view state is not changing (keeps on shouldStart)

pushpendraKh avatar Jun 11 '21 09:06 pushpendraKh

@mainteiner Hi! I'm having trouble getting onStateChanged to work in my app on Android. When do you plan to merge this pull request?

shirakiya avatar Jul 30 '21 07:07 shirakiya

Hello guys, could you please merge this PR 🙏 ?

augustorsouza avatar Aug 02 '21 12:08 augustorsouza

@charafau @slightfoot @lejard-h can you guys please take a look?

micaelcid avatar Aug 27 '21 20:08 micaelcid

@ramah @jonasfranz @themisir could you please take a look?

augustorsouza avatar Aug 31 '21 23:08 augustorsouza

@augustorsouza I don't have write permissions to the repository. I would suggest using dependency from git source until the changes are released.

themisir avatar Aug 31 '21 23:08 themisir

@micaelcid thank you so much. I spent lots of time fixing problem, and finally, find your PR.

furkeen avatar Sep 04 '21 10:09 furkeen

@augustorsouza Hello. Sorry for the delay of my response. Hope you found what you needed.

ramah avatar Sep 04 '21 13:09 ramah

Hey, @charafau. Could you please review, merge and get this PR in the next release? It seems that plenty of people wants this fix too 😢

micaelcid avatar Sep 04 '21 14:09 micaelcid

does anyone have forks with this fix and migrated to V2 embedding?

petra-bios avatar Jan 28 '22 05:01 petra-bios

I was able to make this work by overriding the dependency and using this fork created by @micaelcid

Just add it on your pubspec.yaml

dependency_overrides:   
  flutter_webview_plugin: #https://github.com/fluttercommunity/flutter_webview_plugin/pull/907
    git:
      url: https://github.com/micaelcid/flutter_webview_plugin.git
      ref: fix/webview-state-changed

Thanks @micaelcid! I hope this PR will be accepted soon!

tulioccalazans avatar Jul 27 '22 16:07 tulioccalazans

Hey folks, just letting you know:

We're not using this fork anymore, although I'll leave this PR opened as a reference, in case anyone still needs it.

We fully migrated to https://pub.dev/packages/webview_flutter after they added file upload feature to the Android platform.

micaelcid avatar May 12 '23 12:05 micaelcid