-
Notifications
You must be signed in to change notification settings - Fork 5
/
motivation.dart
95 lines (92 loc) · 3.64 KB
/
motivation.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
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter_show/generated/l10n.dart';
import 'package:flutter_show/presentation/provider/presentation_controller_provider.dart';
import 'package:flutter_show/slides/03_motivation/widgets/code.dart';
import 'package:flutter_show/styles/fs_gradients.dart';
import 'package:flutter_show/styles/fs_text_styles.dart';
import 'package:fluttershow_base/components/model/enum/directional_animation_direction.dart';
import 'package:fluttershow_base/components/widgets/fluttershow_base_components.dart';
import 'package:fluttershow_keynote/slides/blank/keynote_blank_slide.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
class MotivationSlide extends ConsumerWidget {
const MotivationSlide({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final t = S.of(context);
final controller = ref.watch(presentationController);
return DirectionalAnimation(
delay: 100,
direction: DirectionalAnimationDirection.bottom,
curve: Curves.easeInExpo,
child: DecoratedBox(
decoration: BoxDecoration(
gradient: FSGradients.dynamicBackground(controller.brightness),
),
child: KeynoteBlankSlide(
headerWidget: Text(t.motiviation, style: FSTextStyles.title()),
headerFlexUnits: 1,
bodyWidget: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Visibility(
visible: controller.animationIndex == 2,
child: const Code(),
),
Visibility(
visible: controller.animationIndex != 2,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Visibility(
visible: controller.animationIndex >= 0,
child: Row(
children: [
Text(t.step1, style: FSTextStyles.regularText()),
Transform.rotate(
angle: -math.pi / 14.0,
child: const Arrow(
size: Size(100, 100),
),
),
],
),
),
Visibility(
visible: controller.animationIndex >= 1,
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Text(
t.step2,
style: FSTextStyles.regularText(),
),
),
Padding(
padding: const EdgeInsets.only(top: 320),
child: Transform.rotate(
angle: -math.pi / 20.0,
child: const CurvyArrow(400, 160),
),
),
],
),
),
Visibility(
visible: controller.animationIndex >= 3,
child: Padding(
padding: const EdgeInsets.only(bottom: 60),
child: Text(t.step3, style: FSTextStyles.regularText()),
),
),
],
),
),
],
),
),
),
);
}
}