Dart in a stand-alone app that does NOT require Chrome to be installed

StackOverflow https://stackoverflow.com/questions/23628174

  •  21-07-2023
  •  | 
  •  

Вопрос

electron, node-webkit, brackets-shell and atom-shell are frameworks that allow a user to create stand alone executables that use HTML, CSS, and JavaScript (Node) for all code in the app. They don't require any prior installation of any software, as I understand it. I want to use Dart instead of JavaScript. I don't want a chrome app because that requires the installation of Chrome, if I understand correctly. Is it possible to make a stand-alone application using Dart? Will DartToJs be able to do this for me?

Это было полезно?

Решение

You need to have a Dart-VM (Dart-Runtime) installed in order to be able to execute Dart applications on the command line/server.

As far as I know there is no way to create a standalone executable, at least no easy one.

It is technically possible to create an executable that contains the Dart-VM but there are no tools available yet that generate that for you. I don't think the path using Dart2JS will help much. Dart2JS aims primarily at browsers but I have heard that some try to use Dart2JS to run Dart code with Node.js but I don't know if that really works.

This similar question contains some links that may be of interest to you: Embedding Dart into application

Другие советы

dart2js + node-webkit will definitely do this for you. Just compile your webapp to js, make a proper package.json file and follow the standard directions on the node-webkit github page. There's even a pub package that let's you use the node-webkit API from dart (filesystem access, window controls, and whatnot). Search pub for node_webkit and you'll find it. Good luck.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top