Tutoriel N° 2d0
Dart installation on UBuntu
shareannonce@shareannonce:~$ nano dart_install.sh
#!/bin/bash
sudo apt-get update -y
sudo apt-get install apt-transport-https
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update -y
sudo apt-get install dart -y
sudo ln -s /usr/lib/dart/bin/pub /usr/bin/pub
sudo ln -s /usr/lib/dart/bin/dart2js /usr/bin/dart2js
pub global activate webdev
pub global activate stagehand
echo 'export PATH=$PATH:/usr/lib/dart/bin' >> /home/$USER/.profile
echo 'export PATH=$PATH:~/.pub-cache/bin' >> /home/$USER/.profile
mkdir /home/$USER/quickstart && cd /home/$USER/quickstart && ~/.pub-cache/bin/stagehand web-simple
pub get
sudo apt-get update -y
sudo apt-get install apt-transport-https
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update -y
sudo apt-get install dart -y
sudo ln -s /usr/lib/dart/bin/pub /usr/bin/pub
sudo ln -s /usr/lib/dart/bin/dart2js /usr/bin/dart2js
pub global activate webdev
pub global activate stagehand
echo 'export PATH=$PATH:/usr/lib/dart/bin' >> /home/$USER/.profile
echo 'export PATH=$PATH:~/.pub-cache/bin' >> /home/$USER/.profile
mkdir /home/$USER/quickstart && cd /home/$USER/quickstart && ~/.pub-cache/bin/stagehand web-simple
pub get
shareannonce@shareannonce:~$ sh dart_install.sh
shareannonce@shareannonce:~$ cd /home/$USER/quickstart && ~/.pub-cache/bin/webdev serve
Open your browser and go to: http://localhost:8080/
Notes:
1/ You need to be in the folder quickstart to launch webdev serve
2/ After restart your session, you could launch it with: cd /home/$USER/quickstart && webdev serve
source: https://webdev.dartlang.org/guides/get-started