Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 1.17 KB

File metadata and controls

63 lines (46 loc) · 1.17 KB

project layout

How to structure dart projects?

see:

intro (dart package, pubspec.yaml)

  • A dart project is called "dart package".
  • Each "package" should contain a pubspec.yaml file .
  • Use "$ pub get" to install/update dependencies defined in "pubspec.yaml" .
  • dependencies are hosted here: https://pub.dev/

package types (app - vs - library)

A package is of type:

  • app
  • library

create layout from intellij

New Module ... -> "Dart"

  • -> "Dart package" -> "OK"
  • -> "Dart Cli App" -> "OK"

create layout from cli (stagehand)

  • stagehand is a project generator
# install stagehand (global)
$ pub global activate stagehand

# use stagehand
$ mkdir foo && cd foo
$ stagehand --help
$ stagehand console-full

example (hello-cli app)

hello-cli
    bin
        main.dart
        main.exe
    lib
        hello_cli.dart
    test
        hello_cli_test.dart

    pubspec.yaml
# compile native
$ dart2native hello-cli/bin/main.dart
# Generated: hello-cli/bin/main.exe