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

278
Views
No puedo usar java script en flutter

Mi código JavaScript no funciona. Quiero hacer una aplicación WebView a través de flutter. pero quiero eliminar algunas secciones o personalizar algunas propiedades usando JavaScript en flutter. También eliminé el encabezado y el pie de página, pero no puedo personalizar el relleno del contenedor del sitio web usando JavaScript. No funciona.

Aquí está el código:

 import 'package:flutter/material.dart'; import 'package:flutter_application_1/progress1.dart'; import 'package:webview_flutter/webview_flutter.dart'; void main() { runApp(MaterialApp( title: "Webview App", home: Scaffold( appBar: AppBar( title: Text("University Of Global Village"), centerTitle: true, ), body: MyApp(), ), )); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Container( child: WebViewState(), ); } } class WebViewState extends StatefulWidget { const WebViewState({Key? key}) : super(key: key); @override State<WebViewState> createState() => _WebViewStateState(); } class _WebViewStateState extends State<WebViewState> { int position = 1; @override WebViewController? controller; Widget build(BuildContext context) { return Scaffold( body: Container( child: IndexedStack( index: position, children: [ WebView( initialUrl: "https://ugv.edu.bd/notice", javascriptMode: JavascriptMode.unrestricted, onPageStarted: (Value) { setState(() { position = 1; }); }, onPageFinished: (value) { setState(() { position = 0; controller?.evaluateJavascript( "document.getElementsByClassName('header')[0].style.display ='none'"); controller?.evaluateJavascript( "document.getElementsByClassName('inner-header')[0].style.display ='none'"); controller?.evaluateJavascript( "document.getElementsByClassName('footer')[0].style.display ='none'"); controller?.evaluateJavascript( "document.getElementsByClassName('container')[0].style.padding-top ='20px !important'"); }); }, onWebViewCreated: (controller) { this.controller = controller; }, ), Container( child: Center( child: CircularProgressIndicator(), ), ) ], ), ), ); } }

Sitio web: https://ugv.edu.bd/notice

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

"padding-top" no es correcto.

Tu codigo;

 "document.getElementsByClassName('container')[0].style.padding-top ='20px !important'");

Debes cambiar así;

 "document.getElementsByClassName('container')[0].style.paddingTop ='20px !important'");

Puede obtener más información sobre padding-top en w3

about 4 years ago · Juan Pablo Isaza Report
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!