Embedding Flutter Applications in Websites Using DartPad
Article Summary
Jose Alba from Google's Material team shows how to turn your Flutter apps into embeddable web demos. No hosting required—just GitHub and DartPad.
Flutter now runs on web, and DartPad (Google's browser-based Dart playground) supports Flutter apps. This tutorial walks through embedding live, interactive Flutter demos directly into websites using GitHub Gists or repos, letting users see both code and running app simultaneously.
Key Takeaways
- Two embedding methods: GitHub Gists for single files or repos for multi-file projects
- Convert any Gist URL to DartPad by replacing domain with dartpad.dev/gistID
- Use embed-flutter.html?id= prefix to create iframe-ready Flutter demos
- Requires only main.dart and dartpad_metadata.yaml for basic multi-file setups
- No separate hosting needed—GitHub serves the code, DartPad runs it
Critical Insight
You can now embed fully functional Flutter apps in documentation or blogs using just GitHub and DartPad's embed URLs, eliminating the need for separate hosting infrastructure.