Running and Debugging Dart Web Applications
http://localhost:63342/project-name/web/index.html. However, the built-in server is not used to serve the application. Instead, PyCharm automatically starts pub serve (on a random free port, e.g.
54321) and the browser page is redirected to the pub serve URL (like
The work of pub serve is logged in the dedicated Pub Serve tool window. The tool window opens when you start running or debugging a Dart web application for the first time during the current PyCharm session. You can stop the tool by clicking on the toolbar. When you start running or debugging again, pub serve restarts automatically.
Running a Dart web application
Open the HTML file with a Dart reference or select it in the Project view. On the context menu of the editor or selection, click and choose the required browser in the list.
Debugging a Dart web application
- Open the HTML file that references Dart or select the file in the Project view.
URLfield already shows the URL address of the application in the format
http://localhost:<built-in server port>/<project-name>/<relative path to the HTML file>. During a debugging session, the browser will be redirected from this URL to the pub serve URL.
- Configure and set breakpoints in the Dart code.
- Initiate a debugging session: choose the created run configuration from the Edit configurations drop-down list on the toolbar and click . PyCharm opens the specified URL in the chosen browser.
- In the Debug Tool Window that opens, step through the program, stop and resume program execution, examine it when suspended, etc.