override_platforms: chrome: settings: arguments: --no-sandbox
pub run build_runner test --delete-conflicting-outputs -- -p chrome --coverage coverageit creates a coverage directory but it's blank after the tests
@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.
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.
build.yamlfile, something like this:
targets: $default: sources: - lib/** - web/** - pubspec.*
@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.