GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — Embedding guide Embedding guide
David Simon Tetruahsvili edited this page
DartPad can be embedded in any web page with a plain <iframe src="https://dartpad.dev/?sample=counter&embed=true&theme=light" title="Flutter counter example" width="100%" height="600" style="border: 0" allow="clipboard-read; clipboard-write" ></iframe> DartPad analyzes and compiles code in the browser, in a WebWorker. No code is sent to a server to compile. Each URL loads one project source:
Optional project settings:
For example, to embed the example of a pub.dev package: <iframe src="https://dartpad.dev/?package=<name>&root=example&file=example/lib/main.dart&embed=true" width="100%" height="600" style="border: 0" allow="clipboard-read; clipboard-write" ></iframe>
The DartPad README has the full list of query parameters, defaults, and panel rules. Browsers block clipboard access in cross-origin iframes unless the host page allows it. Add
Keyboard shortcuts such as Ctrl+C and Ctrl+V work without these permissions. See Chromium's documentation on permissions in cross-origin iframes for more information. DartPad is resource heavy. Each embed loads an editor, a Dart analyzer, a compiler, and a runtime for the program. A page with many DartPad embeds can use a lot of memory and CPU, especially on mobile devices. If a page needs many examples, consider static code snippets with a link to DartPad, or one embed for the most important example. To limit the cost, DartPad:
The limit is shared by all DartPad embeds in the same browser, including embeds in other tabs. The old The Clone this wiki locally | ||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |