Interacting with a WebView - getting data to/from the web page exposed in the WebView

Hi! I'm diving into a project on FlutterFlow where I'm integrating a WebView to show the user an external store (sales) site.

My goal is twofold:

  • make the user experience smoother by not just displaying the store site within the app

  • grabbing important data on how users interact within the WebView. Specifically, I am looking to track:

    • When a user adds an item to their cart

    • When they complete a purchase (i.e., finish the payment process)

What I've Tried So Far:

  • I've messed around with some WebView widgets and dug through packages that might offer a way to listen in on these kinds of user actions, but I'm hitting a wall on how to tailor these solutions to my needs.

  • The idea of injecting JavaScript to monitor these actions crossed my mind too, but I'm at a bit of a loss on how to do it right in FlutterFlow or how to funnel that data back to the app properly.

  • I've explored using the flutter_inappwebview package along with other Flutter/Dart packages that promise functionality around web views. My aim was to find a robust solution for monitoring specific user interactions within the WebView (add to a cart, completing a purchase).

My Ask to the Community:

  • Got any go-to methods or packages in FlutterFlow for keeping an eye on actions like cart adds or purchase completions in a WebView?

  • If you've managed to pull off something similar, how did you capture and move this data from the WebView to your app?

  • Any advice on injecting JavaScript into the WebView without making a mess?

  • I'd really appreciate any examples, guides, or resources you think could help me out here.

Looking to make this shopping experience as slick as possible, and any pointers you've got would be golden. Cheers for any help you can throw my way!

5
3 replies