dart2native Dart created using the command-line tools on macOS, Windows or Linux

>dart2native --help

Preparation of the source file

// bin\main.dart
main(List<String> args) {
  print('hello world');
}

Bale

>dart2native ./bin\main.dart -o ./hello

λ ./hello
hello world

It can also be packaged as exe file

>dart2native .\bin\main.dart -o ./hello.exe
Generated: d:\ajanuw\dart-test\hello.exe

>hello.exe
hello world

Guess you like

Origin www.cnblogs.com/ajanuw/p/11802990.html