forked from SatoshiPortal/bullbitcoin-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_option_card.dart
More file actions
93 lines (89 loc) · 2.82 KB
/
Copy pathbackup_option_card.dart
File metadata and controls
93 lines (89 loc) · 2.82 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import 'package:bb_mobile/core/themes/app_theme.dart';
import 'package:bb_mobile/core/widgets/cards/tag_card.dart';
import 'package:bb_mobile/core/widgets/text/text.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
class BackupOptionCard extends StatelessWidget {
final Widget icon;
final String title;
final String description;
/// Zero or more short labels shown under the description. A card may carry
/// several (e.g. how easy an option is AND how it reaches the network).
final List<String> tags;
final VoidCallback onTap;
const BackupOptionCard({
super.key,
required this.icon,
required this.title,
required this.description,
this.tags = const [],
required this.onTap,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: context.appColors.surface,
border: Border.all(color: context.appColors.border),
boxShadow: [
BoxShadow(
color: context.appColors.border,
offset: const Offset(0, 2),
),
],
borderRadius: BorderRadius.circular(2),
),
child: Row(
children: [
Expanded(
flex: 6,
child: Row(
crossAxisAlignment: .start,
children: [
SizedBox(width: 40, height: 40, child: icon),
const Gap(12),
Expanded(
child: Column(
crossAxisAlignment: .start,
children: [
BBText(title, style: context.font.headlineMedium),
const Gap(10),
BBText(
description,
style: context.font.bodySmall?.copyWith(
color: context.appColors.textMuted,
),
maxLines: 3,
),
const Gap(10),
if (tags.isNotEmpty)
Wrap(
spacing: 8,
runSpacing: 8,
children: [
for (final tag in tags) OptionsTag(text: tag),
],
),
],
),
),
],
),
),
SizedBox(
width: 24,
height: 24,
child: Icon(
Icons.arrow_forward,
color: context.appColors.onSurface,
),
),
],
),
),
);
}
}