flutter_deck 0.5.0 flutter_deck: ^0.5.0 copied to clipboard
A lightweight, customizable, and easy-to-use framework to create presentations in Flutter.
import 'package:flutter/material.dart';
import 'package:flutter_deck/flutter_deck.dart';
import 'package:flutter_deck_example/slides/slides.dart';
void main() {
runApp(const FlutterDeckExample());
}
class FlutterDeckExample extends StatelessWidget {
const FlutterDeckExample({super.key});
@override
Widget build(BuildContext context) {
// This is an entry point for the Flutter Deck app.
return FlutterDeckApp(
// You could use the default configuration or create your own.
configuration: const FlutterDeckConfiguration(
// Define a global background for the light and dark themes separately.
background: FlutterDeckBackgroundConfiguration(
light: FlutterDeckBackground.gradient(
LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFFFFDEE9), Color(0xFFB5FFFC)],
),
),
dark: FlutterDeckBackground.gradient(
LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFF16222A), Color(0xFF3A6073)],
),
),
),
// Set defaults for the footer.
footer: FlutterDeckFooterConfiguration(
showSlideNumbers: true,
showSocialHandle: true,
),
// Set defaults for the header.
header: FlutterDeckHeaderConfiguration(
showHeader: false,
),
// Use a custom transition between slides.
transition: FlutterDeckTransition.fade(),
),
// You can also define your own light...
lightTheme: FlutterDeckThemeData.fromTheme(
ThemeData.from(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFFB5FFFC),
),
useMaterial3: true,
),
),
// ...and dark themes.
darkTheme: FlutterDeckThemeData.fromTheme(
ThemeData.from(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF16222A),
brightness: Brightness.dark,
),
useMaterial3: true,
),
),
// Presentation is build automatically from the list of slides.
slides: const [
TitleSlide(),
LayoutStructureSlide(),
BlankSlide(),
SplitSlide(),
ImageSlide(),
HiddenSlide(),
DrawerSlide(),
ThemingSlide(),
BackgroundSlide(),
TransitionsSlide(),
StepsSlide(),
CodeHighlightSlide(),
EndSlide(),
],
// Do not forget to introduce yourself!
speakerInfo: const FlutterDeckSpeakerInfo(
name: 'Flutter Deck',
description: 'The power of Flutter, in your presentations.',
socialHandle: 'flutter_deck',
imagePath: 'assets/flutter_logo.png',
),
);
}
}