-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.dart
157 lines (145 loc) · 4.46 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import 'package:flutter/material.dart';
import 'package:made_with_serverpod/made_with_serverpod.dart';
import 'package:slick_slides/slick_slides.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SlickSlides.initialize();
runApp(const MyApp());
}
const _defaultTransition = SlickFadeTransition(
color: Colors.black,
);
const _codeExampleA = '''class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
}
}''';
const _codeExampleB = '''class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return SlideDeck(
slides: [
Slide(
builder: (context) {
return const TitleSlide(
title: Text('Slick Slides'),
subtitle: Text('Stunning presentations in Flutter'),
);
},
),
],
);
}
}''';
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Slick Slides Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({
super.key,
});
@override
Widget build(BuildContext context) {
return SlideDeck(
slides: [
FullScreenImageSlide(
image: const AssetImage('assets/logo-background.jpg'),
title: 'Slick Slides',
subtitle: 'Stunning presentations\nwith Flutter',
alignment: const Alignment(0.6, 0.0),
theme: const SlideThemeData.darkAlt(),
transition: _defaultTransition,
),
BulletsSlide(
title: 'What is Slick Slides?',
bulletByBullet: true,
bullets: const [
'Slick Slides was born out of the need to make nice looking '
'slides for Serverpod at the FlutterCon conference.',
'It comes with many built-in slide types, and is easy to '
'extend with your own.',
'Browse through the slides in this presentation to see '
'what it can do.',
'If you use Slick Slides for your presentation, please '
'give some credit to Serverpod for the work we put into '
'this package. Also, check out Serverpod if you haven\'t '
'already, it\'s a great way to build your backend in '
'Dart.',
],
transition: _defaultTransition,
),
BulletsSlide(
title: 'Bullets with images',
image: const AssetImage('assets/serverpod-avatars.webp'),
bullets: [
'Add images to you presentation with a single line of code.',
'Bullet point slides can have images too.',
],
transition: _defaultTransition,
),
PersonSlide(
title: 'Rockstar Flutter Developer',
name: 'Philippa Flutterista',
image: const AssetImage(
'assets/portrait.jpg',
),
transition: _defaultTransition,
),
Slide(
builder: (context) {
return const ContentLayout(
content: Center(
child: SizedBox(
width: 600,
child: AnimatedServerpodLogo(
brightness: Brightness.dark,
animate: true,
loop: false,
),
),
),
);
},
transition: const SlickFadeTransition(),
onPrecache: (context) async {
AnimatedServerpodLogo.precache();
},
),
BulletsSlide(
theme: const SlideThemeData.light(),
title: 'Themes',
bullets: const [
'Use the built in themes or create your own.',
'This is the default light theme.',
],
transition: _defaultTransition,
),
AnimatedCodeSlide(
formattedCode: [
FormattedCode(
code: _codeExampleA,
),
FormattedCode(
code: _codeExampleB,
highlightedLines: [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
),
],
),
],
);
}
}