-
Notifications
You must be signed in to change notification settings - Fork 74
/
onbording_screen.dart
59 lines (55 loc) · 2.03 KB
/
onbording_screen.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
import 'package:flutter/material.dart';
import 'package:introduction_screen/introduction_screen.dart';
class OnBoardingScreen extends StatelessWidget {
const OnBoardingScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return IntroductionScreen(
pages: [
PageViewModel(
image: buildImage(
'assets/images/introduction_screen/undraw_Books_re_8gea.png'),
title: 'A reader lives a thousands lives',
body: 'The man who never lives only one.',
decoration: getPageDecoration(),
),
PageViewModel(
image: buildImage(
'assets/images/introduction_screen/undraw_mathematics_4otb.png'),
title: 'Featured Books',
body: 'Available right at your fingerprints',
decoration: getPageDecoration(),
),
PageViewModel(
image: buildImage(
'assets/images/introduction_screen/undraw_Notebook_re_id0r.png'),
title: 'Simple UI',
body: 'For enhanced reading experience',
decoration: getPageDecoration(),
),
PageViewModel(
image: buildImage(
'assets/images/introduction_screen/undraw_road_to_knowledge_m8s0.png'),
title: 'Today a reader, tomorrow a leader',
body: 'Start your journey',
decoration: getPageDecoration(),
),
],
next: const Icon(Icons.arrow_forward),
done: const Text('Read', style: TextStyle(fontWeight: FontWeight.bold)),
onDone: () {
Navigator.pop(context);
},
);
}
Widget buildImage(String path) =>
Center(child: Image.asset(path, width: 350));
PageDecoration getPageDecoration() => PageDecoration(
titleTextStyle:
const TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
bodyTextStyle: const TextStyle(fontSize: 20),
imagePadding: const EdgeInsets.all(24),
bodyPadding: const EdgeInsets.all(16).copyWith(bottom: 0),
pageColor: Colors.white,
);
}