1
+import 'dart:io';
2
+
3
import 'package:cake_wallet/generated/i18n.dart';
4
import 'package:cake_wallet/routes.dart';
5
import 'package:cake_wallet/src/screens/base_page.dart';
31
@override
32
AppBarStyle get appBarStyle => AppBarStyle.regular;
33
34
+ ColorFilter get _colorFilter =>
35
+ ColorFilter.mode(currentTheme.colorScheme.onSurface, BlendMode.srcIn);
36
+
37
List<_DeviceManufacturer> get availableManufacturers => [
38
_DeviceManufacturer(
34
- image: SvgPicture.asset('assets/images/hardware_wallet/ledger_man.svg', height: 25),
39
+ image: SvgPicture.asset(
40
+ 'assets/images/hardware_wallet/ledger_man.svg',
41
+ height: 25,
42
+ colorFilter: _colorFilter,
43
+ ),
44
hardwareWalletType: HardwareWalletType.ledger,
45
),
37
- // _DeviceManufacturer(
38
- // image: SvgPicture.asset('assets/images/hardware_wallet/bitbox_man.svg', height: 25),
39
- // hardwareWalletType: HardwareWalletType.bitbox,
40
- // tag: S.current.new_tag,
41
- // ),
46
+ if (Platform.isAndroid) ...[
47
+ _DeviceManufacturer(
48
+ image: SvgPicture.asset(
49
+ 'assets/images/hardware_wallet/trezor_man.svg',
50
+ height: 25,
51
+ colorFilter: _colorFilter,
52
+ ),
53
+ hardwareWalletType: HardwareWalletType.trezor,
54
+ tag: S.current.new_tag,
55
+ ),
56
+ _DeviceManufacturer(
57
+ image: SvgPicture.asset(
58
+ 'assets/images/hardware_wallet/bitbox_man.svg',
59
+ height: 25,
60
+ colorFilter: _colorFilter,
61
+ ),
62
+ hardwareWalletType: HardwareWalletType.bitbox,
63
+ tag: S.current.new_tag,
64
+ ),
65
+ ],
66
_DeviceManufacturer(
43
- image: SvgPicture.asset('assets/images/hardware_wallet/cupcake_man.svg', height: 25),
67
+ image: SvgPicture.asset(
68
+ 'assets/images/hardware_wallet/cupcake_man.svg',
69
+ height: 25,
70
+ colorFilter: _colorFilter,
71
+ ),
72
hardwareWalletType: HardwareWalletType.cupcake,
73
tag: S.current.new_tag,
74
),
75
_DeviceManufacturer(
48
- image: SvgPicture.asset('assets/images/hardware_wallet/coldcard_man.svg', height: 25),
76
+ image: SvgPicture.asset(
77
+ 'assets/images/hardware_wallet/coldcard_man.svg',
78
+ height: 25,
79
+ colorFilter: _colorFilter,
80
+ ),
81
hardwareWalletType: HardwareWalletType.coldcard,
82
tag: S.current.new_tag,
83
),
84
// _DeviceManufacturer(
53
- // image: SvgPicture.asset('assets/images/hardware_wallet/seedsigner_man.svg', height: 25),
85
+ // image: SvgPicture.asset(
86
+ // 'assets/images/hardware_wallet/seedsigner_man.svg',
87
+ // height: 25,
88
+ // colorFilter: _colorFilter,
89
+ // ),
90
// hardwareWalletType: HardwareWalletType.seedsigner,
91
// tag: S.current.new_tag,
92
// ),
97
.toList();
98
99
List<_DeviceManufacturer> get comingManufacturers => [
100
+ if (!Platform.isAndroid) ...[
101
+ _DeviceManufacturer(
102
+ image: SvgPicture.asset(
103
+ 'assets/images/hardware_wallet/bitbox_man.svg',
104
+ height: 25,
105
+ colorFilter: _colorFilter,
106
+ ),
107
+ hardwareWalletType: HardwareWalletType.bitbox,
108
+ tag: S.current.coming_soon_tag,
109
+ ),
110
+ ],
111
_DeviceManufacturer(
65
- image: SvgPicture.asset('assets/images/hardware_wallet/trezor_man.svg', height: 25),
66
- tag: S.current.coming_soon_tag,
67
- ),
68
- _DeviceManufacturer(
69
- image: SvgPicture.asset('assets/images/hardware_wallet/bitbox_man.svg', height: 25),
70
- hardwareWalletType: HardwareWalletType.bitbox,
71
- tag: S.current.coming_soon_tag,
72
- ),
73
- _DeviceManufacturer(
74
- image: SvgPicture.asset('assets/images/hardware_wallet/seedsigner_man.svg', height: 25),
112
+ image: SvgPicture.asset(
113
+ 'assets/images/hardware_wallet/seedsigner_man.svg',
114
+ height: 25,
115
+ colorFilter: _colorFilter,
116
+ ),
117
hardwareWalletType: HardwareWalletType.seedsigner,
118
tag: S.current.coming_soon_tag,
119
),
120
_DeviceManufacturer(
79
- image: SvgPicture.asset('assets/images/hardware_wallet/foundation_man.svg', height: 25),
121
+ image: SvgPicture.asset(
122
+ 'assets/images/hardware_wallet/foundation_man.svg',
123
+ height: 25,
124
+ colorFilter: _colorFilter,
125
+ ),
126
tag: S.current.coming_soon_tag,
127
),
128
_DeviceManufacturer(
83
- image: SvgPicture.asset('assets/images/hardware_wallet/keystone_man.svg', height: 25),
129
+ image: SvgPicture.asset(
130
+ 'assets/images/hardware_wallet/keystone_man.svg',
131
+ height: 25,
132
+ colorFilter: _colorFilter,
133
+ ),
134
tag: S.current.coming_soon_tag,
135
),
136
];
140
child: Center(
141
child: Container(
142
padding: EdgeInsets.only(left: 24, right: 24),
93
- child: Column(
94
- children: [
95
- ...availableManufacturers.map(
96
- (manufacturer) => Padding(
97
- padding: EdgeInsets.only(top: 10),
98
- child: ManufacturerOptionTile(
99
- image: manufacturer.image,
100
- tag: manufacturer.tag,
101
- onPressed: () {
102
- if (onSelect != null)
103
- return onSelect!.call(context, manufacturer.hardwareWalletType!);
104
-
105
- if (isAirgappedWallet(manufacturer.hardwareWalletType)) {
106
- _onScanQRCode(context, manufacturer.hardwareWalletType!);
107
- } else if (manufacturer.hardwareWalletType != null) {
108
- Navigator.pushNamed(context, Routes.connectHardwareWallet,
109
- arguments: [manufacturer.hardwareWalletType]);
110
- }
111
- },
112
- ),
113
- ),
114
- ),
115
- if (showUnavailable) ...[
116
- Padding(
117
- padding: EdgeInsets.only(top: 20, bottom: 10),
118
- child: DottedDivider(color: Theme.of(context).colorScheme.surfaceContainer),
119
- ),
120
- ...comingManufacturers.map(
143
+ height: double.infinity,
144
+ child: SingleChildScrollView(
145
+ child: Column(
146
+ children: [
147
+ ...availableManufacturers.map(
148
(manufacturer) => Padding(
149
padding: EdgeInsets.only(top: 10),
150
child: ManufacturerOptionTile(
151
image: manufacturer.image,
152
tag: manufacturer.tag,
126
- onPressed: () =>
127
- Fluttertoast.showToast(msg: 'One more tap and it might work'),
128
- // Ester egg
129
- isUnavailable: true,
153
+ onPressed: () {
154
+ if (onSelect != null)
155
+ return onSelect!.call(context, manufacturer.hardwareWalletType!);
156
+
157
+ if (isAirgappedWallet(manufacturer.hardwareWalletType)) {
158
+ _onScanQRCode(context, manufacturer.hardwareWalletType!);
159
+ } else if (manufacturer.hardwareWalletType != null) {
160
+ Navigator.pushNamed(context, Routes.connectHardwareWallet,
161
+ arguments: [manufacturer.hardwareWalletType]);
162
+ }
163
+ },
164
),
165
),
166
),
133
- ]
134
- ],
167
+ if (showUnavailable) ...[
168
+ Padding(
169
+ padding: EdgeInsets.only(top: 20, bottom: 10),
170
+ child: DottedDivider(color: Theme.of(context).colorScheme.surfaceContainer),
171
+ ),
172
+ ...comingManufacturers.map(
173
+ (manufacturer) => Padding(
174
+ padding: EdgeInsets.only(top: 10),
175
+ child: ManufacturerOptionTile(
176
+ image: manufacturer.image,
177
+ tag: manufacturer.tag,
178
+ onPressed: () =>
179
+ Fluttertoast.showToast(msg: 'One more tap and it might work'),
180
+ // Ester egg
181
+
182
+ isUnavailable: true,
183
+ ),
184
+ ),
185
+ ),
186
+ ]
187
+ ],
188
+ ),
189
),
190
),
191
),