Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Daniele Zecchin
    @Spyryto

    Hello. May anybody please give me a hint on this?
    I have a Flutter Web app that makes use of a JS library (rdflib.js). There's a Dart wrapper that I wrote for it. Everything works smoothly in dev mode, but when I build in release mode, the app throws an exception (Flutter red screen) when trying to access the library.

    • The library is minified in a .js file
    • In the index.html the script tag for the library comes before the dart one.

    Any help would be appreciated.
    Thank you.

    Chris O'Shea
    @TheRealWelshCJ
    @dizzyking is the .js file included in the build?
    Jacob MacDonald
    @jakemac53
    @dizzyking there are several ways this can happen unfortunately, as DDC is a lot more permissive than dart2js when it comes to js interop https://github.com/dart-lang/sdk/blob/master/pkg/js/README.md#known-limitations-and-bugs
    Some of the ones that are more common:
    • forgetting to wrap any callback you pass to JS with allowInterop
    • not having the correct number of arguments in callbacks you pass to JS
    Daniele Zecchin
    @Spyryto
    @TheRealWelshCJ : yes, it is. And it gets loaded in the browser.
    Daniele Zecchin
    @Spyryto
    @jakemac53 : there are no callbacks in the code. About the correct number of arguments... I have to verify that.
    Is there a way to get a more meaningful message than "ReferenceError: graph is not defined"?
    As I understand it, it says there's a variable called graph that is null. So I have put null checks in my code but I cannot catch the bug. Suggestions?
    Jacob MacDonald
    @jakemac53
    Maybe there is a race condition? in dart2js the timing could easily be different (typically faster) so that could be causing it?
    Daniele Zecchin
    @Spyryto
    I thought that by putting the library's <script> tag before Dart's one (in the index.html file) that would be taken care of.
    Jacob MacDonald
    @jakemac53
    depends if you are using defer or something like that
    and also the library itself might have some async initialization or something (I have no context to know though)
    Daniele Zecchin
    @Spyryto

    And it is hard to debug minified obfuscated JS code from the browser console.

    I tried putting defer on both scripts (same issue) and removing defer from the library script (same issue). Otherwise it won't even load.

    Your point about async initialization is interesting. I'll investigate the issue with some Javascript tests.
    eobhlV.md.png
    Yegor
    @yjbanov
    @lijy91 Cool! Thanks for sharing.
    LiJianying
    @lijy91
    I build a live preview widgets site based on flutter web.
    Yegor
    @yjbanov
    Previewing widgets in the browser is definitely one use-case for Flutter for web we're excited about.
    LiJianying
    @lijy91
    This site has just been created and will slowly add more widgets and examples.
    Yegor
    @yjbanov
    Looking forward to seeing all the creative ways the community will use it for codelabs, articles, playgrounds, things we never imagined.
    LiJianying
    @lijy91
    Is there an example for the flutter web to communicate with the react? I am just using nested iframes, examples and documentation. They are two projects.
    @yjbanov
    Yegor
    @yjbanov
    It's on the roadmap, but we haven't made any progress on this yet.
    LiJianying
    @lijy91
    sounds good
    Fahim Shariar Shoumik
    @sh0umik
    Wow !
    SupparerkR
    @SupparerkR
    Can anyone help me with the WebView and Pdf.
    I try to show document from google doc on my site. I don't really know how.
    Daniele Zecchin
    @Spyryto
    Maybe you can load them into another window/tab
    https://api.dartlang.org/stable/2.3.0/dart-html/Window/open.html
    Chris O'Shea
    @TheRealWelshCJ
    Is anyone aware of a good timeline widget for flutter web? Looking to have multiple timelines on a single chart, and was about to write my own but thought I would check
    Kind of like how git branches/forks/merges are represented:
    (or even the network graph on github)
    Robbie
    @BlueAquilae_twitter
    Any idea of the cause of this : AssetNotFoundException: http|lib/http.ddc.js while trying to get an http.Client
    Green Appers, Inc.
    @GreenAppers
    Skipping compiling main.dart with ddc because some of its transitive libraries have sdk dependencies that not supported on this platform:
    worked before upgrading
    Green Appers, Inc.
    @GreenAppers
    Unable to read module information for package:flutter, make sure you have a dependency on it in your pubspec.
    nothing does, though. the files it names can definitely be ruled out.
    webdev 2.0.7 worked lot better for me than 2.4.0
    may have to go back. i originally started upgrading everything because pub.dev gives you better package score.
    Green Appers, Inc.
    @GreenAppers
    nothing saying flutter in any pub deps... only flutter_web
    Green Appers, Inc.
    @GreenAppers
    i wonder if putting flutter/bin/cache/dart-sdk/bin in PATH is wrong
    seems like it could be wrong dartdevc for webdev potentially
    Green Appers, Inc.
    @GreenAppers
    if i use build_web_compilers 1.2.2 it works, but with 2.0.0 it fails. it seems to get the same error with 1.2.2 but it just goes on ignoring it. but with 2.0.0. it seems to treat it as fatal.
    i think i perhaps havent found the lib causing the problem yet re dart-lang/build#2200 and probably a similar issue as happened here flutter/flutter#32430
    i would also love for it to tell you the problem
    Green Appers, Inc.
    @GreenAppers
    Ah. Found it. An import dart:io. Didn't expect it to manifest that way.
    jld3103
    @jld3103
    Are there any docs or anything else on how the plugins for web are going to be constructed? And is there a way to help the team with them?
    xainpro
    @xainpro
    Hi all I am new to Flutter
    I have Question about how to do normal web based routing inside flutter for web for example
    Sharing links
    mywebapp.com/abc/xyz
    mywebapp.com/xxx/kkkkk
    Plus doing SEO for each page ?
    MichealReed
    @MichealReed
    @xainpro it's a good question, let me know if you do a StackOverflow post and I'll upvote it
    Yegor
    @yjbanov
    We have a HashLocationStrategy that hooks up Flutter's Navigator to the URL. There are still bugs and missing features (e.g. we don't have "go forward" functionality; we didn't bother implementing in Flutter because mobile apps don't have such a thing). You should be able to link deep into your app, as well as use the "back" button. However, in general, this remains an area of development.