Giter Club home page Giter Club logo

Comments (12)

MaskyS avatar MaskyS commented on August 24, 2024

CC @lejard-h

from flutter_webview_plugin.

 avatar commented on August 24, 2024

I have exactly the same requirement.

i need to load a react app that is stored locally. Its actually some very complex JS that i cant rewrite in Dart. It does CRDT stuff.

Once loaded i need to call certain public exported JavaScript functions. Wondering if i can use EvalJavascript Dart call.
I also need to receive calls from inside the Webview to Dart - not sure how to do that, other than polling which is pretty bad and will kill battery.

from flutter_webview_plugin.

eugenio-tesio avatar eugenio-tesio commented on August 24, 2024

I need to open a PDF file. I was thinking of doing it with a WebView. Would this be possible?

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

@eugenio-tesio I tried that out, it wouldn't work unless if you feed a gdoc url to the method as such:
("http://docs.google.com/gview?embedded=true&url=" + pdfURL). But isn't very suitable for mobile, the gdocs site has additional icons which ruin the UI. Besides that my app also needs to work offline. So my workaround has been to convert the PDFs to HTML first.

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

I found this today, we may be able to do this, but will require changes to the plugin. See https://flutter.io/assets-and-images/#sharing-assets-with-the-underlying-platform. Another way that can work is to pass a url like "file:///data/data/com.provider.package/file_name.html" but you will need the exact file path of the HTML. I didn't manage to do this though because my assets are inside the assets folder of my project, and those are not placed in any kind of permanent directory.

from flutter_webview_plugin.

lejard-h avatar lejard-h commented on August 24, 2024

duplicate of #23

I am closing this one since we already discussed about solution in the previous one

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

@lejard-h that solution isn't working well for me it seems. I'm getting this: (17795): Unrecognized GLES max version string in extensions:
E/flutter (17795): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (17795): Invalid argument(s): String contains invalid characters.
E/flutter (17795): #0 _UnicodeSubsetEncoder.convert (dart:convert/ascii.dart:97:9)
E/flutter (17795): #1 AsciiCodec.encode (dart:convert/ascii.dart:47:46)
E/flutter (17795): #2 new UriData.fromString (dart:core/uri.dart:3197:44)
E/flutter (17795): #3 new Uri.dataFromString (dart:core/uri.dart:304:24)
E/flutter (17795): #4 _MyHomePageState.getUri. (file:///home/maskys/webview_test/lib/main.dart:57:21)

the widget webview remains white

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

I think that is triggering because my html file contains quote characters?

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

isn't the quote characters, must be something else.. Possible all the special characters in the file or the square brackets.

from flutter_webview_plugin.

MaskyS avatar MaskyS commented on August 24, 2024

@lejard-h Please reopen, the solution in #23 doesn't seem to be able to work for this use case. I will need to load various files which all contain image assets, special characters like © and other symbols. The easiest way imho is if we can figure out how to use the "file:///" syntax to load files from the project's asset folder.

from flutter_webview_plugin.

Kleak avatar Kleak commented on August 24, 2024

if you launch a web server you should not have problem
here is an example https://github.com/Jaguar-dart/jaguar_flutter_asset

from flutter_webview_plugin.

lejard-h avatar lejard-h commented on August 24, 2024

@MaskyS

even if the solution don't work for you, it is the same issue, please continue the conversation on the other one and try the solution of @Kleak describe in the article mention in the other issue

from flutter_webview_plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.