DeckOptions reference
Complete API reference for configuring SuperDeck presentations
DeckOptions reference
DeckOptions configures SuperDeckApp styling, custom widgets, slide parts, and debug visuals.
Constructor
const DeckOptions({
SlideStyle? baseStyle,
Map<String, SlideStyle> styles = const {},
Map<String, WidgetDefinition> widgets = const {},
SlideParts parts = const SlideParts(),
bool debug = false,
bool watchForChanges = false,
});
baseStyle
Type: SlideStyle? | Default: null
Base style for all slides.
DeckOptions(
baseStyle: SlideStyle(),
)
styles
Type: Map<String, SlideStyle> | Default: {}
Named style variants for specific slides.
DeckOptions(
styles: {
'title': SlideStyle(),
},
)
Use in slides:
---
style: title
---
# This slide uses the 'title' style
widgets
Type: Map<String, WidgetDefinition> | Default: {}
Custom widget definitions.
DeckOptions(
widgets: {
'twitter': TwitterWidgetDefinition(),
},
)
Use in Markdown:
@widget {
name: "twitter"
username: "flutterdev"
tweetId: "123"
}
Or shorthand:
@twitter {
username: "flutterdev"
tweetId: "123"
}
WidgetDefinition example (simple map args)
import 'package:flutter/widgets.dart';
import 'package:superdeck/superdeck.dart';
class TwitterWidgetDefinition extends WidgetDefinition<Map<String, Object?>> {
const TwitterWidgetDefinition();
@override
Map<String, Object?> parse(Map<String, Object?> args) => args;
@override
Widget build(BuildContext context, Map<String, Object?> args) {
final username = args['username'] as String? ?? '';
final tweetId = args['tweetId'] as String? ?? '';
return Text('Twitter: @$username ($tweetId)');
}
}
parts
Type: SlideParts | Default: const SlideParts()
Slide components (header, footer, background).
DeckOptions(
parts: SlideParts(
header: CustomHeaderPart(), // PreferredSizeWidget
footer: CustomFooterPart(), // PreferredSizeWidget
background: CustomBackgroundPart(), // Widget
),
)
See Custom Slide Parts Guide for examples.
watchForChanges
Type: bool | Default: false
Enables file watching for automatic deck rebuilds when supported by your runtime flow.
DeckOptions(
watchForChanges: true,
)
Complete configuration example
import 'package:flutter/material.dart';
import 'package:superdeck/superdeck.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SuperDeckApp(
options: DeckOptions(
// Custom widgets (registered by name)
widgets: const {
'twitter': TwitterWidgetDefinition(),
},
// Optional: provide slide chrome (header/footer/background)
parts: SlideParts(
header: CustomHeaderPart(),
footer: CustomFooterPart(),
background: CustomBackgroundPart(),
),
// Debug mode for development
debug: kDebugMode,
),
);
}
}
Styling
- Start with
baseStylefor defaults - Use named styles sparingly
- Maintain consistent palette and typography
- Test across different screen sizes
Custom widgets
- Validate in
parse()early - Provide explicit defaults
- Throw helpful errors (rendered on-slide)
- Keep widgets focused