This page describes solutions to problems that might occur when you’re trying to use DartPad, whether at dartpad.dev or in a page that has embedded DartPads. For an overview of DartPad, see the DartPad page.
Embedded DartPads don’t appear
The dart.dev homepage and many codelabs have embedded DartPads. If these DartPads don’t appear at all, then try the following:
Make sure you’re using a supported browser. DartPad might not work in other browsers, and is known not to work in the default configuration of the Brave browser.
If you’re using an ad blocker, disable it.
Check whether you’ve disabled third-party tracking cookies (Chrome instructions). If you’ve disabled cookies, change your settings to allow cookies for dartpad.dev. If you’re using embedded DartPads, such as in the Dart cheatsheet codelab or the implicit animations codelab, you might need to allow cookies for the embedding site domain, as well (in these cases, dart.dev and flutter.dev, respectively).
If you repeatedly reload a page that contains embedded DartPads, then you might run into GitHub rate limiting. Within 60 minutes, you should be able to reload the page and see code in the embedded DartPads.
Code doesn’t work outside DartPad
If you copy code from DartPad into another environment, the code might not run successfully. Here are some possible causes and fixes:
If Dart can’t find an imported library, make sure you’ve added all necessary package dependencies. DartPad includes many built-in packages by default, but your own project must explicitly list the packages that it depends on. To see the packages that DartPad includes, go to dartpad.dev and click the i icon at the bottom right of the window. To learn more about adding package dependencies, see the documentation for
dart pub add.
If the code has other compilation errors, make sure you’re using the latest stable version of the Dart SDK. DartPad and embedded samples generally use the latest stable release of the SDK, and older versions might be missing necessary language or library features. To learn how to update the Dart SDK, see Get the Dart SDK.
If you’re creating a web app, make sure you have the proper project setup. For example, the
HTMLtab doesn’t show all the necessary markup to run Dart code. To learn about connecting Dart code to the web, see HTML and Dart connections. To get started creating web apps with Dart, see Get started: Web apps.
DartPad doesn’t work in China
If you have any other problems when using DartPad, create an issue on GitHub.