dev
dart 93 lines 2.98 KB
Raw
1 import 'package:auto_size_text/auto_size_text.dart';
2 import 'package:flutter/material.dart';
3 import 'package:cake_wallet/generated/i18n.dart';
4
5 class IntroducingCard extends StatelessWidget {
6 IntroducingCard(
7 {required this.borderColor,
8 required this.closeCard,
9 required this.title,
10 required this.subTitle});
11
12 final String title;
13 final String subTitle;
14 final Color borderColor;
15 final Function() closeCard;
16
17 @override
18 Widget build(BuildContext context) {
19 return Padding(
20 padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
21 child: Container(
22 width: double.infinity,
23 decoration: BoxDecoration(
24 borderRadius: BorderRadius.circular(30.0),
25 border: Border.all(
26 color: borderColor,
27 width: 1,
28 ),
29 color: Theme.of(context).colorScheme.surfaceContainer,
30 ),
31 child: Row(
32 mainAxisAlignment: MainAxisAlignment.spaceBetween,
33 crossAxisAlignment: CrossAxisAlignment.start,
34 children: [
35 Expanded(
36 flex: 1,
37 child: MergeSemantics(
38 child: Padding(
39 padding: const EdgeInsets.all(24),
40 child: Column(
41 crossAxisAlignment: CrossAxisAlignment.start,
42 children: [
43 AutoSizeText(
44 title,
45 style: Theme.of(context).textTheme.headlineSmall?.copyWith(
46 fontWeight: FontWeight.bold,
47 height: 1,
48 ),
49 maxLines: 1,
50 textAlign: TextAlign.center,
51 ),
52 SizedBox(height: 14),
53 Text(
54 subTitle,
55 textAlign: TextAlign.left,
56 style: Theme.of(context).textTheme.bodySmall,
57 ),
58 ],
59 ),
60 ),
61 ),
62 ),
63 Padding(
64 padding: const EdgeInsets.fromLTRB(0, 16, 16, 0),
65 child: Semantics(
66 label: S.of(context).close,
67 child: GestureDetector(
68 onTap: closeCard,
69 child: Container(
70 height: 23,
71 width: 23,
72 decoration: BoxDecoration(
73 color: Theme.of(context).colorScheme.surfaceContainer,
74 shape: BoxShape.circle,
75 ),
76 child: Center(
77 child: Image.asset(
78 'assets/images/x.png',
79 color: Theme.of(context).colorScheme.onSurface,
80 height: 15,
81 width: 15,
82 ),
83 ),
84 ),
85 ),
86 ),
87 )
88 ],
89 ),
90 ),
91 );
92 }
93 }