Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Amit Katz
    I want to know if it's possible to have URL parameters with flutter web
    Let's say I have a forum and I want to view a post by a URL
    This post has an ID
    So I want to go like /post/postID or even /post?id=<ID>
    Is it possible to achieve using flutter web?
    So if I go to my web browser and go to the URL http://localhost:8080/post?id=1234 in the Flutter code I will be able to take that ID argument in the post endpoint
    jow blew
    "webdev serve " does not work for me. I have to use instead "flutter pub run build_runner serve".
    takes ages to build
    Hi, since I can do flutter config --enable-web now, do anyone know any available online doc talking about the best pratice to manage a flutter project for both mobile and web? It seems I still need to have two different versions of pubspec.yaml and remove all the packages which are not supported by the web. so any best practise? Maybe I just move all the common packages out to be a single lib package. So end up three dart packages. one for common class, one for mobile and one for web. Is this a good design? Thanks a lot.
    OK. I was wrong about two diff versions of pubspec.yaml. I didn’t find the right procedure to do it. Flutter team hides this deeply. After following the right procedure, it turns out it has to be a completely diffrerent project/package due to flutter create —web . did something I am unsure. So, the question still applies. Should I create three projects (packages)? One for common, one for mobile and one for web? Is this best practise? I haven’t tried it if that way will work or not.
    Can i get location
    On flutter web?
    Randal L. Schwartz
    Yes, anything in dart:html is available to you.
    window.location sorry
    Sorry in meant geolocation
    I cant implement it
    Randal L. Schwartz
    what prevents you?
    @juanjoserodrigolazaro ?
    @RandalSchwartz works for flutter web?
    Randal L. Schwartz
    likely not… requires mobile hardware.
    you won’t find any solution that works in a desktop browser for geolocation
    at best, you can turn the local IP address into a guessed address.
    but this may be wrong because of VPNs and NAT’ed addresses.
    so what’s your actual goal?
    I wanted lo get the latitud and longitud for getting near people
    Randal L. Schwartz
    Yeah, desktops don’t provide that. The best you can do is reverse-geo the IP address, and that’s not reliable.
    not sure if that works via dart:html or not....
    @wstrange working i found documentation at dart html you cant get lat and long with navigator. It has some exceptions like chrome that is only with https!
    So you cant test on yout localhost
    Hi everybody!
    Any one knows how to focus next TextFormField when user type TAB/ENTER keys on desktop keyboard, using any web navigator (Safari/Chrome/etc)? I am trying using FocusNode with no success.
    @QubiSmartLocks I'm also trying to figure this out right now, will let you know if I found a way to do it.
    @QubiSmartLocks Figured it out, just wrap your TextField/TextFormField in a RawKeyboardListener like below.
         focusNode: FocusNode(),
         onKey: (event) {
              if (event.runtimeType == RawKeyDownEvent && (event.logicalKey.keyId == 54)) {
                   print("ENTER Key pressed");
                   //Do something
         child: TextFormField()),
    I have to add to this, that it does somehow screw up your FocusNode of your be warned depending on your usecase.
    Dima Rostopira
    Does anyone know how to preserve firebase auth when using firebase run? I have to reauth on every launch, it's annoying
    @Sekaiichi4_gitlab my problem is not to get ENTER key presses, as you wrote, is keyId 54 (Digit 6???) and TAB key, keyId "Digit 2" (don't ask). My real problem is to focus next node. When I put node.nextFocus(); it jumps twice! Try it: Put 3+ TextFormField with all focusNode assigned... then, when ENTER key pressed, just go next... it jumps twice!
    Hi, guys! I'm writing front for new project on flutter_web.
    Is there good way to rewrite url when using onGenerateRoute+MaterialPageRoute?
    There is workaround that i found so far: pass path param to page widget and do manual rewrite in initState:
    window.history.replaceState(null, widget.title, widget.path);
    But it isn't so great way, not very convenient, but mainly case of such scenario:
    "/#/" -> "/" -> press button -> "/profile" -> press "Back" browser button -> "/#/" (not "/")
    UPD. This is slightly better, but still hope to find "out of the box" way to do it
    window.history.replaceState(null, widget.title, '/#'+widget.path);
    @QubiSmartLocks To be honest I have the same problem, even when you don't use the nextfocus() but instead manually request focus on the focus fields it skips. But I believe that it only happens because the next RawKeyboardListener is also active, so when you press ENTER, the next field also corresponds to that keypress. I wonder if there is a way to disable a RawKeyboardListener when it's focus node isn't focussed.
    @QubiSmartLocks One solution is to have a boolean value "canEnter" check to see if you can focus on the next TextFormField, and have it go false as soon as the user presses ENTER. After which you can allow the user to only press Enter again by putting the boolean back on true only with OnChanged() of the TextFormField.
    @yjbanov If I embed a flutter web project into an iframe, its Navigator won't work. Have you ever encountered such a problem?
    any one try lottie in flutter?
           child: LottieView.fromFile(
              filePath: "assets/animation_books.json",
              autoPlay: true,
              loop: true,
              onViewCreated: onViewCreatedFile,
    dont know why cant work
    @Erinziyi I didn't have success with that package, but I used (though it doesn't have iOS support yet)

    Anyone here who has experience with the Dart version of Chartjs?

    I am trying to create a chart that will scale my data based on its time,

    var xAx = charts.ChartXAxe(
        display: true,
        barThickness: 2,
        type: 'time',
        time: charts.TimeScale(
          parser: "HH:mm:ss",
          unit: 'hour',
          unitStepSize: 1,
          //round: 'hour', // this will round the data.
          tooltipFormat: "HH:mm:ss",
          displayFormats: charts.TimeDisplayFormat(hour: 'HH:mm:ss'),

    putting this xAxis configuration inside of my ChartConfiguration

    var config = charts.ChartConfiguration(
        type: 'line',
        data: data,
        options: charts.ChartOptions(
          responsive: true,
              charts.ChartScales<charts.TickOptions>(xAxes: [xAx], yAxes: [yAx]),

    This, however, crashes without any error messages.

    @Erinziyi OK, I got it working. What problem are you seeing?
    Ist it possible to run a flutter web application inside a certain div within a website ?
    for example, i have a site made with bootstrap and i want to include a flutter application under the navbar, so it will fit inside my website