I recently updated Flutter, which also updated the Dart SDK to 2.7. In the documentation, it says I now should have access to the dart2native binary, but I was not able to find it. I eventually found and issue (https://github.com/flutter/flutter/issues/43968) where it was mentioned that the dart2native binary doesn't come with the version of Dart downloaded through Flutter.
Perhaps it would make sense to mention this on the documentation page for dart2native (https://dart.dev/tools/dart2native)?
Good point. I think the Flutter SDK used to include everything in the Dart SDK, but apparently that's no longer true (if it ever was). I'm a little worried about yet another thing to keep in sync, but this seems helpful enough to be worth the risk.
Marking this as e1 because we should compare everything in the SDKs and maybe come up with a boilerplate include, plus add it to the list of things to update when a new stable SDK drops.
So the suggested workaround is downloading a seperate copy of the dart sdk? Should I add this copy to my $PATH instead of the included dart sdk or will this break this things with flutter?
@kevmoo or @mit-mit do you have recommendations for what to do when you have both the Flutter SDK & the Dart SDK?
The Dart SDK located inside the Flutter SDK is currently designed to run the Flutter tool, and not for direct use. That's why it's hidden inside the cache folder and not shown in a more prominent folder. We're hoping to include an actual Dart SDK for wide consumption, but that is not ready yet.
For now, if you want to do to Dart development and use the Dart terminal commands (like dartfmt, pub, or dart2native), it's recommended that you download and install the Dart SDK. If you'd like you can also add it to path.
Most helpful comment
The Dart SDK located inside the Flutter SDK is currently designed to run the Flutter tool, and not for direct use. That's why it's hidden inside the
cachefolder and not shown in a more prominent folder. We're hoping to include an actual Dart SDK for wide consumption, but that is not ready yet.For now, if you want to do to Dart development and use the Dart terminal commands (like dartfmt, pub, or dart2native), it's recommended that you download and install the Dart SDK. If you'd like you can also add it to path.