-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathcollaborative_redeem_bottom_sheet.dart
More file actions
119 lines (115 loc) · 4.25 KB
/
Copy pathcollaborative_redeem_bottom_sheet.dart
File metadata and controls
119 lines (115 loc) · 4.25 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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/buttons/button.dart';
import 'package:bb_mobile/core/widgets/text/text.dart';
import 'package:bb_mobile/features/ark/presentation/cubit.dart';
import 'package:bb_mobile/features/ark/presentation/state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:gap/gap.dart';
class CollaborativeRedeemBottomSheet extends StatelessWidget {
const CollaborativeRedeemBottomSheet({
super.key,
required this.cubit,
required this.amount,
});
final ArkCubit cubit;
final int amount;
static Future<void> show(BuildContext context, ArkCubit cubit, int amount) {
return BlurredBottomSheet.show(
context: context,
child: CollaborativeRedeemBottomSheet(cubit: cubit, amount: amount),
);
}
@override
Widget build(BuildContext context) {
return Container(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.4,
),
decoration: BoxDecoration(
color: context.appColors.surface,
borderRadius: const BorderRadius.vertical(top: Radius.circular(32)),
),
child: BlocBuilder<ArkCubit, ArkState>(
bloc: cubit,
builder: (context, state) {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 10,
),
child: Column(
children: [
const Gap(20),
Row(
mainAxisAlignment: .spaceBetween,
children: [
const Gap(24),
BBText(
context.loc.arkCollaborativeRedeem,
style: context.font.headlineMedium,
),
GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: const Icon(Icons.close),
),
],
),
],
),
),
Flexible(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: .start,
children: [
SwitchListTile(
value: state.withRecoverableVtxos,
onChanged: cubit.onChangedSelectRecoverableVtxos,
title: BBText(
context.loc.arkRecoverableVtxos,
style: context.font.bodyMedium,
),
contentPadding: EdgeInsets.zero,
),
const Gap(32),
Row(
children: [
Expanded(
child: BBButton.big(
label: context.loc.arkCancelButton,
onPressed: () => Navigator.of(context).pop(),
bgColor: context.appColors.surface,
textColor: context.appColors.onSurface,
),
),
const Gap(16),
Expanded(
child: BBButton.big(
label: context.loc.arkRedeemButton,
onPressed: () async {
Navigator.of(context).pop();
await cubit.onSendConfirmed();
},
bgColor: context.appColors.primary,
textColor: context.appColors.onPrimary,
),
),
],
),
],
),
),
),
],
);
},
),
);
}
}