onboarding_illustrations.dart
2.35 KB
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
import 'package:doublefeel_flutter/core/theme/app_theme.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:flutter/material.dart';
class ResearchCard extends StatelessWidget {
const ResearchCard({
super.key,
required this.title,
required this.isHRVup,
required this.backgroundColor,
required this.image,
});
final String title;
final bool isHRVup;
final Color backgroundColor;
final String image;
@override
Widget build(BuildContext context) {
return Container(
height: 320,
width: 171,
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(32),
image: DecorationImage(image: AssetImage(image), fit: BoxFit.fill),
),
padding: const EdgeInsets.fromLTRB(12, 24, 12, 28),
child: Stack(
children: [
Positioned(
top: 0,
left: 0,
right: 0,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
title,
textAlign: TextAlign.center,
style: TextStyle(
color: context.colors.textPrimary,
fontSize: 18,
fontWeight: FontWeight.w600,
letterSpacing: 0,
),
),
const SizedBox(height: 2),
RichText(
text: TextSpan(children: [
TextSpan(
text: isHRVup
? context.l10n.onboardingResearchHrvUp
: context.l10n.onboardingResearchHrvDown,
style: TextStyle(
color: context.colors.textSecondary,
fontSize: 12,
letterSpacing: 0)),
WidgetSpan(
child: Image.asset(
width: 12,
height: 12,
isHRVup
? 'assets/images/common/ic_arrow_green_up.png'
: 'assets/images/common/ic_arrow_red_down.png'),
alignment: PlaceholderAlignment.middle),
])),
],
),
),
],
),
);
}
}