SuperDeck enables you to craft visually appealing and interactive presentations directly within your Flutter apps, using the simplicity and power of Markdown.
Follow these steps to integrate SuperDeck into your Flutter project:
-
Install the CLI to set up your project:
dart pub global activate superdeck_cli
-
In your Flutter project, run the setup command:
superdeck setup
This command will:
- Configure your pubspec.yaml with required assets
- Set up macOS entitlements if applicable
- Create a basic slides.md file if none exists
- Set up a custom index.html for web with loading indicator
-
Add the
superdeckpackage to your project:flutter pub add superdeck
-
Import the package and initialize SuperDeck:
import 'package:superdeck/superdeck.dart'; void main() async { await SuperDeckApp.initialize(); runApp( MaterialApp( title: 'Superdeck', debugShowCheckedModeBanner: false, home: SuperDeckApp( options: DeckOptions( baseStyle: BaseStyle(), widgets: { 'twitter': (args) { return TwitterWidget( username: args.getString('username'), tweetId: args.getString('tweetId'), ); }, }, debug: false, styles: { 'announcement': AnnouncementStyle(), 'quote': QuoteStyle(), }, parts: const SlideParts( header: HeaderPart(), footer: FooterPart(), background: BackgroundPart(), ), ), ), ), ); }
SuperDeck uses a powerful block-based system for arranging content in your slides. This provides flexible layouts and composition options.
@column- For text and markdown content@section- Container for organizing multiple blocks@image- For displaying images with various options@dartpad- Embed DartPad examples@widget- Embed custom widgets with arguments
---
@column
# Welcome to SuperDeck
Your awesome slides start here!
@column
- Create beautiful slides using markdown
- Arrange content using the block-based system
- Customize with images, widgets, and more
------
@column {
align: center_left
flex: 2
}
## Left Column Content
- Item 1
- Item 2
- Item 3
@column {
align: center_right
}
## Right Column Content
With some explanatory text.
---Blocks support various alignment options:
topLeft,topCenter,topRightcenterLeft,center,centerRightbottomLeft,bottomCenter,bottomRight
Use the flex property to control relative sizing of blocks:
@section
@column {
flex: 2
}
This column takes up twice the space
@column
Normal sized column@column
## Image Example
@column
 {.cover}@dartpad {
id: your_dartpad_id
theme: dark
run: true
}@widget {
name: colorPalette
schema: true
prompts: [tropical, vibrant, pastel]
}---
@column
# My Slide Title
- Point 1
- Point 2
- Point 3
------
@column {
align: center_left
flex: 2
}
# Left Content
- More content on the left side
- With a larger flex value
@column {
align: center_right
}
# Right Content
This content takes up less space due to the default flex value of 1.
------
@column
# Tweet Example
@twitter {
username: username
tweetId: 1234567890
}
@column
# More content
------
@column
# Diagram Example
```mermaid
graph TD
A[Start] --> B[Input]
B --> C[Process]
C --> D[Output]
D --> E[End]
``` {.code}
------
@column
# DartPad Example
@dartpad {
id: example-dartpad-id
theme: dark
}
@column
# Explanation
This code demonstrates how to use Flutter widgets.
------
@column
# Image Example
 {.cover}
@column
# Text alongside the image
------
@section
@column {
align: center
}
# Main Header
@section {
flex: 2
}
@column {
align: center_left
}
## Left Content
@column {
align: center_right
}
## Right Content
---When initializing SuperDeck, configure deck-level behavior with DeckOptions:
SuperDeckApp(
options: DeckOptions(
baseStyle: BaseStyle(),
widgets: {
'twitter': (args) {
return TwitterWidget(
username: args.getString('username'),
tweetId: args.getString('tweetId'),
);
},
},
styles: {
'announcement': AnnouncementStyle(),
'quote': QuoteStyle(),
},
parts: const SlideParts(
header: HeaderPart(),
footer: FooterPart(),
background: BackgroundPart(),
),
debug: false,
),
);You can register custom widgets and reference them directly from markdown:
widgets: {
'twitter': (args) {
return TwitterWidget(
username: args.getString('username'),
tweetId: args.getString('tweetId'),
);
},
},@twitter {
username: username
tweetId: 1234567890
}SuperDeck can generate and manage rich assets for your deck:
- Image formats including PNG, JPEG, GIF, WEBP, and SVG
- Auto-generated thumbnails for quick previews
- Mermaid diagram renderings
Apply global themes and per-slide styling through DeckOptions:
baseStyle: BaseStyle(),
styles: {
'announcement': AnnouncementStyle(),
'quote': QuoteStyle(),
},You can also add CSS classes to individual elements using the {.class-name} syntax:
## Styled Heading {.highlight}
 {.cover}Slide parts let you add consistent UI chrome to every slide:
parts: const SlideParts(
header: HeaderPart(),
footer: FooterPart(),
background: BackgroundPart(),
)The Block hierarchy powers the SuperDeck renderer:
SectionBlock: Containers that organize other blocksColumnBlock: Renders markdown content within a columnImageBlock: Displays local or remote imagesDartPadBlock: Embeds live DartPad snippetsWidgetBlock: Hosts custom Flutter widgets registered inDeckOptions
GeneratedAsset instances represent resources produced during builds:
- Image variants (PNG, JPEG, GIF, WEBP, SVG)
- Slide thumbnails for quick previews
- Mermaid diagrams rendered from fenced markdown blocks
Each Slide captures the structure of a presentation segment:
key: Unique identifier for lookup and navigationoptions: Slide-level configuration and metadatasections: Ordered collection of section blockscomments: Optional presenter notes or annotations
Add the .code class to code fences for consistent formatting:
```dart
void main() {
print('Hello, world!');
}
``` {.code}Animate individual elements with the .animate helper:
# This title will animate {.animate}Call out supplemental information directly in markdown:
> [!NOTE]
> This is a note.
> [!WARNING]
> This is a warning.
> [!CAUTION]
> This is a caution.You can configure SuperDeck by creating a superdeck.yaml file in the root of your project. This allows you to set default options for all slides.
The SuperDeck CLI is included as a dev dependency in the demo app, making it easy to run locally:
# From the demo app directory, run the CLI directly
cd demo
dart ../packages/cli/bin/main.dart <command> [arguments]
# Example: Build slides
dart ../packages/cli/bin/main.dart build
# Example: Watch for changes and rebuild automatically
dart ../packages/cli/bin/main.dart build --watchThe demo app located at demo/ is a complete Flutter application that showcases SuperDeck functionality:
-
Navigate to the demo directory:
cd demo -
Build the slides using the local CLI:
dart ../packages/cli/bin/main.dart build
-
Run the Flutter app:
flutter run
For an efficient development workflow when working on SuperDeck:
-
Start the CLI in watch mode (in one terminal):
cd demo dart ../packages/cli/bin/main.dart build --watch -
Run the Flutter app (in another terminal):
cd demo flutter run -
Edit slides: Modify
demo/slides.mdand the CLI will automatically rebuild the assets. -
Hot reload: Use Flutter's hot reload (
r) to see changes in the app immediately.
dart ../packages/cli/bin/main.dart build- Build slides oncedart ../packages/cli/bin/main.dart build --watch- Build and watch for changesdart ../packages/cli/bin/main.dart setup- Set up SuperDeck configurationdart ../packages/cli/bin/main.dart --help- Show all available commands
demo/slides.md- The main presentation contentdemo/superdeck.yaml- Configuration file for SuperDeckdemo/lib/main.dart- Flutter app entry pointdemo/assets/- Static assets for the presentation
Check out demo/slides.md for a complete deck walkthrough and explore the API documentation for advanced usage scenarios.


