Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Emmanuel Belair
    @e-belair
    When I execute the pipeline I get the following error:
    Failed to run Chrome: Chrome failed with exit code 1.
    Standard output:
    [0108/112750.661550:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
    Jacob MacDonald
    @jakemac53
    this sounds like gitlab-ci question I would go through their support channels
    Emmanuel Belair
    @e-belair
    Ok I was just wondering if anyone already had this error though
    Also I wonder if it's possible to add chrome options to build_runner
    so I could pass --no-sandbox as recommended in the error message
    Jacob MacDonald
    @jakemac53
    The test package is what actually opens chrome, i think it does support that but I don't know exactly how
    Emmanuel Belair
    @e-belair
    Thanks @jakemac53 I'll take a look on this!
    the headless mode to false should resolve the issue I guess
    Emmanuel Belair
    @e-belair
    \o/
    override_platforms:
      chrome:
        settings:
          arguments: --no-sandbox
    Emmanuel Belair
    @e-belair
    Any update about coverage support?
    When I run pub run build_runner test --delete-conflicting-outputs -- -p chrome --coverage coverage it creates a coverage directory but it's blank after the tests
    Jacob MacDonald
    @jakemac53
    only supported on the vm
    Emmanuel Belair
    @e-belair
    ok thanks
    Zufar Muhamadeev
    @muzuro
    Hey guys, question about build_runner. When you running pub run build_runner serve it serves the web and test directories. Is it possible to exlcude test directory?(run only web).
    Zufar Muhamadeev
    @muzuro
    @e-belair We created new docker image with dart and chrome and used it as image in gitlab job. Here is details: https://stackoverflow.com/questions/59677177/how-to-execute-angular-dart-test-in-chrome-in-gitlab-ci
    Emmanuel Belair
    @e-belair
    @muzuro Great thanks! I'll take a look
    Jacob MacDonald
    @jakemac53

    @muzuro you can pass a directory name after the serve command so pub run build_runner serve web.

    In general I would recommend using webdev for web development though - its meant to replace the serve command in build_runner and eventually we want to delete the serve command from build_runner so its just a pure build system.

    Zufar Muhamadeev
    @muzuro
    @jakemac53 actually my command is little longer: pub run build_runner serve --define "build_web_compilers|entrypoint=compiler=dartdevc" --hostname=0.0.0.0 web:57254, so I am specifing port only for web. But it fails when it trying to compile test folder. I have windows issue with relative import import '../../utils.dart'; on my windows environment, thats why I am trying to exclude test from compilation.
    Jacob MacDonald
    @jakemac53
    So in this case the test dir won't be compiled, but it is still looked at when we are determining the module structure for your package, which is a global step for the whole package. That is probably what is complaining for you.
    if you never want to compile that dir with build_runner you can exclude it entirely using a build.yaml file, something like this:
    targets:
      $default:
        sources:
          - lib/**
          - web/**
          - pubspec.*
    that basically overrides what the default sources would be that are included for the build, see https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-include-additional-sources-in-my-build
    Zufar Muhamadeev
    @muzuro
    Thanks Jacob, that works!
    Jacob MacDonald
    @jakemac53
    :+1:
    ray911911
    @ray911911
    Hello, I’m using Android Studio for dart but I don’t have a Mac to test. I’m new to the language but I would like to know. Must I conduct a test on Mac or is it one code that I can deploy to Mac later after coding with less fear that my code might contain major errors.
    richardcatlin
    @richardcatlin
    Is there a pattern or best practice for writing a Flutter & Flutter_web application using firestore? Flutter depends on cloud_firestore where Flutter_web depends on firebase. Can I set a flag in pubspec.yaml for conditional compilation?
    ray911911
    @ray911911
    Sorry is dart code used for both android and iOS projects? Or is it like xamarin each platform will have a bit of customized code.
    Simon Binder
    @simolus3

    @ray911911 @richardcatlin This room is for Dart's build packages, which are mostly unrelated to how Flutter compiles native apps. You might get a response faster when asking on Flutter channels or on TALK-general. That said,

    Must I conduct a test on Mac or is it one code that I can deploy to Mac later after

    Dart should behave the same on all platforms, so you don't have to expect major errors. Some problems might be different path handling etc. If you're using Flutter you might also have to adapt native buildscripts. So you definitely need to test your code on a Mac at some point, but you don't have to use one for development.

    Can I set a flag in pubspec.yaml for conditional compilation?

    You can't, but conditional imports/exports like here can help. Dart2js is smart enough not to compile code that's never imported, so it won't complain about you depending on a Flutter-only package in your pubspec.

    Or is it like xamarin each platform will have a bit of customized code

    By default, Dart apps look and behave almost identical on all platforms. If you don't want that, for instance because you want a Material-themed app for Android and a native-looking iOS app, you'll need to put in the work and write platform-specific Dart code. When you're using native APIs from the OS (say Bluetooth), you might also need to write native Java/Kotlin or ObjC/Swift if there's no prebuilt package available.

    Zufar Muhamadeev
    @muzuro
    Hi guys, I need to build different versions of web app based on external parameter. I wonder can I specify parameter in webdev command and check this parameter in code? Or is there other approaches to achieve this?
    Jimmy Forrester-Fellowes
    @jimmyff
    Hey, I need a solution to combine all the dart files in a folder in to a single dart file, I was just looking at using package:build but this looks like it was more designed to do one to one transforms/builds rather than many to one?
    Jacob MacDonald
    @jakemac53
    Many to one is fine - one to many is not
    Jimmy Forrester-Fellowes
    @jimmyff
    ahhh, great, thanks @jakemac53 - this is just what I needed
    Jacob MacDonald
    @jakemac53
    Note actually that the docs about the resolver there are I believe outdated
    I think you can just use a resolver normally now from an aggregate builder
    Olzhas Suleimen
    @ykmnkmi
    Hey. how to use cascade operator in code generation?
    Jacob MacDonald
    @jakemac53
    @ykmnkmi can you clarify what you mean? There are no limitations regarding the cascade operator that I am aware of.
    Randal L. Schwartz
    @RandalSchwartz
    The cascade operator is cool. I first used it in Smalltalk 80 in 1982.
    But it was slightly broken. It returned the result of the last message sent, rather than the target after the side-effects.
    so there was this weird method called “yourself” that would return “self”, and you’d have to throw that on about a quarter of your cascade chains.
    that couldn’t be fixed in ST80, but Gilad Bracha got it right for Dart.
    Ben Getsug
    @bgetsug
    Hi, I'm using source_gen with SharedPartBuilder. Is there a way to add imports to the resulting .g.dart files?
    Nate Bosch
    @natebosch
    no, part files my not have imports
    Ben Getsug
    @bgetsug
    so, perhaps I should use LibraryBuilder instead? (I'm trying to generate a set of Flutter widgets)
    Jacob MacDonald
    @jakemac53
    If you need to add imports that is really the only option available yes, but that does have its own limitations (namely, not having access to privates in the original library)
    Ben Getsug
    @bgetsug
    aye, will give that a shot, thanks :)
    Jacob MacDonald
    @jakemac53
    You can also check for the imports you need and ask the user to add them but that is not a great UX :)
    Ben Getsug
    @bgetsug
    yeah, since this is just for me, I think generating separate libraries and importing those will be okay.
    Olzhas Suleimen
    @ykmnkmi
    @jakemac53 how to build it in generation? constructorExpression.cascade('field1', someVar).cascade(..., ...,), can't find it in docs