Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
Activar una función de JavaScript en un WebView en Flutter

Tengo una página web que cargo en un WebViw en flutter y esa página web tiene una función javascript que quiero ejecutar con un parámetro de flutter.

Escribí esto debajo, y parece que está ejecutando bien la función de alert , pero cuando trato de ejecutar la función que está definida en el javascript de la página web, dice que no está definida. ¿Por qué podría ser esto? Además, ¿ve algún otro error en mi código que me pueda estar faltando, a pesar de que funciona?

 class WebViewPageState extends State<WebViewPage> { final String url; final String title; WebViewPageState(this.url, this.title); final Completer<WebViewController> _controller = Completer<WebViewController>(); late WebViewController _mycontroller; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(this.title), ), body: Column(children: [ Expanded( child: WebView( initialUrl: this.url, javascriptMode: JavascriptMode.unrestricted, onWebViewCreated: (WebViewController webviewcontroller) { _controller.complete(_mycontroller = webviewcontroller); }, onPageFinished: (url){ print("Ok we loaded page"); setState(() { _mycontroller.runJavascriptReturningResult('alert("Hello, World!")'); }); }, )) ])); } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!