-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathsell_qr_bottom_sheet.dart
More file actions
90 lines (85 loc) · 2.6 KB
/
Copy pathsell_qr_bottom_sheet.dart
File metadata and controls
90 lines (85 loc) · 2.6 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
import 'package:bb_mobile/core/themes/app_theme.dart';
import 'package:bb_mobile/core/widgets/bottom_sheet/x.dart';
import 'package:bb_mobile/core/utils/build_context_x.dart';
import 'package:bb_mobile/core/widgets/text/text.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:qr_flutter/qr_flutter.dart';
class SellQrBottomSheet extends StatelessWidget {
const SellQrBottomSheet({super.key, required this.bip21InvoiceData});
final String bip21InvoiceData;
static Future<void> show(
BuildContext context,
String bip21InvoiceData,
) async {
await BlurredBottomSheet.show(
context: context,
child: SellQrBottomSheet(bip21InvoiceData: bip21InvoiceData),
);
}
@override
Widget build(BuildContext context) {
if (bip21InvoiceData.isEmpty) {
return Container(
padding: const EdgeInsets.all(16),
child: Center(
child: BBText(
context.loc.sellNoInvoiceData,
style: context.font.bodyMedium,
),
),
);
}
return Container(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: .min,
crossAxisAlignment: .stretch,
children: [
Row(
mainAxisAlignment: .spaceBetween,
children: [
BBText(
context.loc.sellQrCode,
style: context.font.headlineSmall,
color: context.appColors.secondary,
),
IconButton(
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.close),
),
],
),
const Gap(24),
Center(
child: Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: context.appColors.background,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: context.appColors.overlay.withValues(alpha: 0.5),
blurRadius: 8,
offset: const Offset(0, 2),
),
],
),
child: SizedBox(
width: 280,
height: 280,
child: QrImageView(
data: bip21InvoiceData,
size: 280,
// ignore: deprecated_member_use
foregroundColor: context.appColors.secondary,
),
),
),
),
const Gap(16),
],
),
);
}
}