Running Dart for Web in Windows

Running Dart for Web in Windows

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)

Install webdev and stagehand. Your CLI buddies.

C:\>pub global activate webdev

C:\>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 games

Create a web app

Create a new folder and name it dart-app. To create a web app from the command line, use these commands:

C:\dart-app>stagehand web-simple

C:\dart-app>pub get

Note 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 https://localhost:8080.

Note that webdev serve is like php artisan serve in Laravel and php yii serve in Yii


Reference: https://jakepucan.blogspot.com/2019/05/running-dart-for-web-in-windows.html

要查看或添加评论,请登录

Lemwell Jake P.的更多文章

  • The basics of creating a website using Hacklang+HHVM

    The basics of creating a website using Hacklang+HHVM

    Disclaimer: For educational purposes only. Not intended to “boo!” Hacklang or PHP.

  • Why I use SeasLog for my PHP projects

    Why I use SeasLog for my PHP projects

    In PHP world, we encountered a lot of frameworks. The problem is they have different implementation in solving the same…

  • Measure your website

    Measure your website

    Without too much talking. I want to share my tools in measuring website.

  • Use Yii framework now!

    Use Yii framework now!

    First of all, I respect all PHP frameworks but it depends on your requirements. I'll give you a scenario.

  • Securing PHP web app directories

    Securing PHP web app directories

    Sometimes when we access https://cool-domain.com/images/ you will see bunch of images of your website.

  • Developing "Offline First" Web App

    Developing "Offline First" Web App

    Very disappointing when you see the welcoming message "Offline" on the ATM machine right? or "Out of Order" written in…

社区洞察

其他会员也浏览了