I know the documentation was already exist on Dart website but most of the documentations "assumed" that you know "this" and "that". So, I'll try to solve that problem here. Let's dive-in on how to run Dart for Web in Windows platform.
Install Dart-SDK using Chocolatey
Head over to chocolatey website and follow the instruction on how to install chocolatey. This amazing application is like a composer for PHP or pip for Python.Don't forget to run the terminal in Administrative mode when you don't have Powershell. I recommend this approach of installing the Dart-SDK compare the Gekorm.
Get CLI tools or an IDE (or both)
C:\>pub global activate webdevC:\>pub global activate stagehand
Stagehand helps you get your Dart projects set up. It is a Dart project scaffolding generator. Webdev will do build and serve for the app.
The available commands for stagehand are the following:
console-full - A command-line application sample.package-simple - A starting point for Dart libraries or applications. (We are going to use this one later)server-shelf - A web server built using the shelf package.web-angular - A web app with material design components.web-simple - A web app that uses only core Dart libraries.web-stagexl - A starting point for 2D animation and gamesCreate a web app
Create a new folder and name it dart-app. To create a web app from the command line, use these commands:
Note that
C:\dart-app>stagehand web-simpleC:\dart-app>pub getNote that
pub get is like composer install in PHP.Let's run the app
To run the app from the command line, use webdev to build and serve the app:
C:\dart-app>webdev serve
Now open your browser and visit http://localhost:8080.
Note that
Note that
webdev serve is like php artisan serve in Laravel and php yii serve in Yii
Comments
Post a Comment