1
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
2
+import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
3
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
4
import 'package:cake_wallet/utils/payment_request.dart';
5
import 'package:cake_wallet/utils/responsive_layout_util.dart';
6
+import 'package:cw_core/crypto_currency.dart';
7
+import 'package:cw_core/currency.dart';
8
import 'package:cw_core/transaction_priority.dart';
9
import 'package:cake_wallet/routes.dart';
10
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
35
36
@override
37
SendCardState createState() => SendCardState(
35
- output: output,
36
- sendViewModel: sendViewModel,
37
- initialPaymentRequest: initialPaymentRequest,
38
- );
38
+ output: output,
39
+ sendViewModel: sendViewModel,
40
+ initialPaymentRequest: initialPaymentRequest,
41
+ );
42
}
43
41
-class SendCardState extends State<SendCard>
42
- with AutomaticKeepAliveClientMixin<SendCard> {
43
- SendCardState({
44
- required this.output,
45
- required this.sendViewModel,
46
- this.initialPaymentRequest})
44
+class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<SendCard> {
45
+ SendCardState({required this.output, required this.sendViewModel, this.initialPaymentRequest})
46
: addressController = TextEditingController(),
47
cryptoAmountController = TextEditingController(),
48
fiatAmountController = TextEditingController(),
99
return Stack(
100
children: [
101
KeyboardActions(
103
- config: KeyboardActionsConfig(
104
- keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
105
- keyboardBarColor: Theme.of(context)
106
- .accentTextTheme
107
- .bodyLarge!
108
- .backgroundColor!,
109
- nextFocus: false,
110
- actions: [
111
- KeyboardActionsItem(
112
- focusNode: cryptoAmountFocus,
113
- toolbarButtons: [(_) => KeyboardDoneButton()],
114
- ),
115
- KeyboardActionsItem(
116
- focusNode: fiatAmountFocus,
117
- toolbarButtons: [(_) => KeyboardDoneButton()],
118
- )
119
- ]),
120
- child: Container(
121
- height: 0,
122
- color: Colors.transparent,
123
- )),
102
+ config: KeyboardActionsConfig(
103
+ keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
104
+ keyboardBarColor: Theme.of(context).accentTextTheme.bodyLarge!.backgroundColor!,
105
+ nextFocus: false,
106
+ actions: [
107
+ KeyboardActionsItem(
108
+ focusNode: cryptoAmountFocus,
109
+ toolbarButtons: [(_) => KeyboardDoneButton()],
110
+ ),
111
+ KeyboardActionsItem(
112
+ focusNode: fiatAmountFocus,
113
+ toolbarButtons: [(_) => KeyboardDoneButton()],
114
+ )
115
+ ],
116
+ ),
117
+ child: Container(
118
+ height: 0,
119
+ color: Colors.transparent,
120
+ ),
121
+ ),
122
Container(
125
- decoration: ResponsiveLayoutUtil.instance.isMobile ? BoxDecoration(
126
- borderRadius: BorderRadius.only(
127
- bottomLeft: Radius.circular(24),
128
- bottomRight: Radius.circular(24)),
129
- gradient: LinearGradient(colors: [
130
- Theme.of(context).primaryTextTheme.titleMedium!.color!,
131
- Theme.of(context)
132
- .primaryTextTheme
133
- .titleMedium!
134
- .decorationColor!,
135
- ], begin: Alignment.topLeft, end: Alignment.bottomRight),
136
- ) : null,
123
+ decoration: ResponsiveLayoutUtil.instance.isMobile
124
+ ? BoxDecoration(
125
+ borderRadius: BorderRadius.only(
126
+ bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24)),
127
+ gradient: LinearGradient(
128
+ colors: [
129
+ Theme.of(context).primaryTextTheme.titleMedium!.color!,
130
+ Theme.of(context).primaryTextTheme.titleMedium!.decorationColor!,
131
+ ],
132
+ begin: Alignment.topLeft,
133
+ end: Alignment.bottomRight,
134
+ ),
135
+ )
136
+ : null,
137
child: Padding(
138
padding: EdgeInsets.fromLTRB(
139
24,
142
ResponsiveLayoutUtil.instance.isMobile ? 32 : 0,
143
),
144
child: SingleChildScrollView(
145
- child: Observer(builder: (_) => Column(
145
+ child: Observer(
146
+ builder: (_) => Column(
147
mainAxisSize: MainAxisSize.min,
148
children: <Widget>[
149
Observer(builder: (_) {
165
AddressTextFieldOption.qrCode,
166
AddressTextFieldOption.addressBook
167
],
167
- buttonColor: Theme.of(context)
168
- .primaryTextTheme
169
- .headlineMedium!
170
- .color!,
171
- borderColor: Theme.of(context)
172
- .primaryTextTheme
173
- .headlineSmall!
174
- .color!,
168
+ buttonColor: Theme.of(context).primaryTextTheme.headlineMedium!.color!,
169
+ borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!,
170
textStyle: TextStyle(
176
- fontSize: 14,
177
- fontWeight: FontWeight.w500,
178
- color: Colors.white),
171
+ fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
172
hintStyle: TextStyle(
173
fontSize: 14,
174
fontWeight: FontWeight.w500,
182
- color: Theme.of(context)
183
- .primaryTextTheme
184
- .headlineSmall!
185
- .decorationColor!),
175
+ color:
176
+ Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!),
177
onPushPasteButton: (context) async {
178
output.resetParsedAddress();
179
await output.fetchParsedAddress(context);
188
selectedCurrency: sendViewModel.currency,
189
);
190
}),
200
- if (output.isParsedAddress) Padding(
201
- padding: const EdgeInsets.only(top: 20),
202
- child: BaseTextFormField(
203
- controller: extractedAddressController,
204
- readOnly: true,
205
- borderColor: Theme.of(context)
206
- .primaryTextTheme
207
- .headlineSmall!
208
- .color!,
209
- textStyle: TextStyle(
210
- fontSize: 14,
211
- fontWeight: FontWeight.w500,
212
- color: Colors.white),
213
- validator: sendViewModel.addressValidator
214
- )
215
- ),
191
+ if (output.isParsedAddress)
192
+ Padding(
193
+ padding: const EdgeInsets.only(top: 20),
194
+ child: BaseTextFormField(
195
+ controller: extractedAddressController,
196
+ readOnly: true,
197
+ borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!,
198
+ textStyle: TextStyle(
199
+ fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
200
+ validator: sendViewModel.addressValidator)),
201
Observer(
217
- builder: (_) => Padding(
218
- padding: const EdgeInsets.only(top: 20),
219
- child: Row(
220
- children: [
221
- Padding(
222
- padding: const EdgeInsets.only(bottom: 8.0),
223
- child: Row(
224
- children: [
225
- Text(
226
- sendViewModel.selectedCryptoCurrency.title,
227
- style: TextStyle(
228
- fontSize: 16,
229
- fontWeight: FontWeight.w600,
230
- color: Colors.white,
231
- )),
232
- sendViewModel.selectedCryptoCurrency.tag != null ? Padding(
233
- padding: const EdgeInsets.fromLTRB(3.0,0,3.0,0),
234
- child: Container(
235
- height: 32,
236
- decoration: BoxDecoration(
237
- color: Theme.of(context)
238
- .primaryTextTheme
239
- .headlineMedium!
240
- .color!,
241
- borderRadius:
242
- BorderRadius.all(Radius.circular(6))),
243
- child: Center(
244
- child: Padding(
245
- padding: const EdgeInsets.all(6.0),
246
- child: Text( sendViewModel.selectedCryptoCurrency.tag!,
247
- style: TextStyle(
248
- fontSize: 12,
249
- fontWeight: FontWeight.bold,
250
- color: Theme.of(context)
251
- .primaryTextTheme
252
- .headlineMedium!
253
- .decorationColor!)),
202
+ builder: (_) => Padding(
203
+ padding: const EdgeInsets.only(top: 20),
204
+ child: Row(
205
+ children: [
206
+ Padding(
207
+ padding: const EdgeInsets.only(bottom: 8.0),
208
+ child: Row(
209
+ children: [
210
+ sendViewModel.hasMultipleTokens
211
+ ? Container(
212
+ padding: EdgeInsets.only(right: 8),
213
+ height: 32,
214
+ child: InkWell(
215
+ onTap: () => _presentPicker(context),
216
+ child: Row(
217
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
218
+ mainAxisSize: MainAxisSize.min,
219
+ children: <Widget>[
220
+ Padding(
221
+ padding: EdgeInsets.only(right: 5),
222
+ child: Image.asset(
223
+ 'assets/images/arrow_bottom_purple_icon.png',
224
+ color: Colors.white,
225
+ height: 8,
226
+ ),
227
+ ),
228
+ Text(
229
+ sendViewModel.selectedCryptoCurrency.title,
230
+ style: TextStyle(
231
+ fontWeight: FontWeight.w600,
232
+ fontSize: 16,
233
+ color: Colors.white),
234
+ ),
235
+ ],
236
+ ),
237
),
255
- ),
256
- ),
257
- ) : Container(),
258
- Padding(
259
- padding: const EdgeInsets.only(right: 10.0),
260
- child: Text(':',
238
+ )
239
+ : Text(
240
+ sendViewModel.selectedCryptoCurrency.title,
241
style: TextStyle(
242
fontWeight: FontWeight.w600,
243
fontSize: 16,
264
- color: Colors.white)),
244
+ color: Colors.white),
245
+ ),
246
+ sendViewModel.selectedCryptoCurrency.tag != null
247
+ ? Padding(
248
+ padding: const EdgeInsets.fromLTRB(3.0, 0, 3.0, 0),
249
+ child: Container(
250
+ height: 32,
251
+ decoration: BoxDecoration(
252
+ color: Theme.of(context)
253
+ .primaryTextTheme
254
+ .headlineMedium!
255
+ .color!,
256
+ borderRadius: BorderRadius.all(
257
+ Radius.circular(6),
258
+ )),
259
+ child: Center(
260
+ child: Padding(
261
+ padding: const EdgeInsets.all(6.0),
262
+ child: Text(
263
+ sendViewModel.selectedCryptoCurrency.tag!,
264
+ style: TextStyle(
265
+ fontSize: 12,
266
+ fontWeight: FontWeight.bold,
267
+ color: Theme.of(context)
268
+ .primaryTextTheme
269
+ .headlineMedium!
270
+ .decorationColor!),
271
+ ),
272
+ ),
273
+ ),
274
+ ),
275
+ )
276
+ : Container(),
277
+ Padding(
278
+ padding: const EdgeInsets.only(right: 10.0),
279
+ child: Text(
280
+ ':',
281
+ style: TextStyle(
282
+ fontWeight: FontWeight.w600,
283
+ fontSize: 16,
284
+ color: Colors.white),
285
),
266
- ],
267
- ),
286
+ ),
287
+ ],
288
),
269
- Expanded(
270
- child: Stack(
271
- children: [
272
- BaseTextFormField(
273
- focusNode: cryptoAmountFocus,
274
- controller: cryptoAmountController,
275
- keyboardType:
276
- TextInputType.numberWithOptions(
277
- signed: false, decimal: true),
278
- inputFormatters: [
279
- FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
280
- ],
281
- suffixIcon: SizedBox(
282
- width: prefixIconWidth,
283
- ),
284
- hintText: '0.0000',
285
- borderColor: Colors.transparent,
286
- textStyle: TextStyle(
287
- fontSize: 14,
288
- fontWeight: FontWeight.w500,
289
- color: Colors.white),
290
- placeholderTextStyle: TextStyle(
289
+ ),
290
+ Expanded(
291
+ child: Stack(
292
+ children: [
293
+ BaseTextFormField(
294
+ focusNode: cryptoAmountFocus,
295
+ controller: cryptoAmountController,
296
+ keyboardType: TextInputType.numberWithOptions(
297
+ signed: false, decimal: true),
298
+ inputFormatters: [
299
+ FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
300
+ ],
301
+ suffixIcon: SizedBox(
302
+ width: prefixIconWidth,
303
+ ),
304
+ hintText: '0.0000',
305
+ borderColor: Colors.transparent,
306
+ textStyle: TextStyle(
307
+ fontSize: 14,
308
+ fontWeight: FontWeight.w500,
309
+ color: Colors.white),
310
+ placeholderTextStyle: TextStyle(
311
+ color: Theme.of(context)
312
+ .primaryTextTheme
313
+ .headlineSmall!
314
+ .decorationColor!,
315
+ fontWeight: FontWeight.w500,
316
+ fontSize: 14),
317
+ validator: output.sendAll
318
+ ? sendViewModel.allAmountValidator
319
+ : sendViewModel.amountValidator,
320
+ ),
321
+ if (!sendViewModel.isBatchSending)
322
+ Positioned(
323
+ top: 2,
324
+ right: 0,
325
+ child: Container(
326
+ width: prefixIconWidth,
327
+ height: prefixIconHeight,
328
+ child: InkWell(
329
+ onTap: () async => output.setSendAll(),
330
+ child: Container(
331
+ decoration: BoxDecoration(
332
color: Theme.of(context)
333
.primaryTextTheme
293
- .headlineSmall!
294
- .decorationColor!,
295
- fontWeight: FontWeight.w500,
296
- fontSize: 14),
297
- validator: output.sendAll
298
- ? sendViewModel.allAmountValidator
299
- : sendViewModel
300
- .amountValidator),
301
- if (!sendViewModel.isBatchSending) Positioned(
302
- top: 2,
303
- right: 0,
304
- child: Container(
305
- width: prefixIconWidth,
306
- height: prefixIconHeight,
307
- child: InkWell(
308
- onTap: () async =>
309
- output.setSendAll(),
310
- child: Container(
311
- decoration: BoxDecoration(
312
- color: Theme.of(context)
313
- .primaryTextTheme
314
- .headlineMedium!
315
- .color!,
316
- borderRadius:
317
- BorderRadius.all(
318
- Radius.circular(6))),
319
- child: Center(
320
- child: Text(
321
- S.of(context).all,
322
- textAlign:
323
- TextAlign.center,
324
- style: TextStyle(
325
- fontSize: 12,
326
- fontWeight:
327
- FontWeight.bold,
328
- color:
329
- Theme.of(context)
330
- .primaryTextTheme
331
- .headlineMedium!
332
- .decorationColor!))),
333
- ))))]),
334
+ .headlineMedium!
335
+ .color!,
336
+ borderRadius: BorderRadius.all(
337
+ Radius.circular(6),
338
+ ),
339
+ ),
340
+ child: Center(
341
+ child: Text(
342
+ S.of(context).all,
343
+ textAlign: TextAlign.center,
344
+ style: TextStyle(
345
+ fontSize: 12,
346
+ fontWeight: FontWeight.bold,
347
+ color: Theme.of(context)
348
+ .primaryTextTheme
349
+ .headlineMedium!
350
+ .decorationColor!,
351
+ ),
352
+ ),
353
+ ),
354
+ ),
355
+ ),
356
+ ),
357
+ ),
358
+ ],
359
),
335
- ],
336
- )
337
- )),
338
- Divider(height: 1,color: Theme.of(context)
339
- .primaryTextTheme
340
- .headlineSmall!
341
- .decorationColor!),
360
+ ),
361
+ ],
362
+ )),
363
+ ),
364
+ Divider(
365
+ height: 1,
366
+ color: Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!),
367
Observer(
343
- builder: (_) => Padding(
344
- padding: EdgeInsets.only(top: 10),
345
- child: Row(
346
- mainAxisSize: MainAxisSize.max,
347
- mainAxisAlignment:
348
- MainAxisAlignment.spaceBetween,
349
- children: <Widget>[
350
- Expanded(
351
- child: Text(
352
- S.of(context).available_balance +
353
- ':',
354
- style: TextStyle(
355
- fontSize: 12,
356
- fontWeight: FontWeight.w600,
357
- color: Theme.of(context)
358
- .primaryTextTheme
359
- .headlineSmall!
360
- .decorationColor!),
361
- )),
362
- Text(
363
- sendViewModel.balance,
368
+ builder: (_) => Padding(
369
+ padding: EdgeInsets.only(top: 10),
370
+ child: Row(
371
+ mainAxisSize: MainAxisSize.max,
372
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
373
+ children: <Widget>[
374
+ Expanded(
375
+ child: Text(
376
+ S.of(context).available_balance + ':',
377
style: TextStyle(
378
fontSize: 12,
379
fontWeight: FontWeight.w600,
381
.primaryTextTheme
382
.headlineSmall!
383
.decorationColor!),
371
- )
372
- ],
373
- ),
374
- )),
384
+ ),
385
+ ),
386
+ Text(
387
+ sendViewModel.balance,
388
+ style: TextStyle(
389
+ fontSize: 12,
390
+ fontWeight: FontWeight.w600,
391
+ color: Theme.of(context)
392
+ .primaryTextTheme
393
+ .headlineSmall!
394
+ .decorationColor!),
395
+ )
396
+ ],
397
+ ),
398
+ ),
399
+ ),
400
if (!sendViewModel.isFiatDisabled)
401
Padding(
402
padding: const EdgeInsets.only(top: 20),
404
focusNode: fiatAmountFocus,
405
controller: fiatAmountController,
406
keyboardType:
382
- TextInputType.numberWithOptions(
383
- signed: false, decimal: true),
407
+ TextInputType.numberWithOptions(signed: false, decimal: true),
408
inputFormatters: [
385
- FilteringTextInputFormatter.deny(RegExp('[\\-|\\ ]'))
409
+ FilteringTextInputFormatter.deny(
410
+ RegExp('[\\-|\\ ]'),
411
+ )
412
],
413
prefixIcon: Padding(
414
padding: EdgeInsets.only(top: 9),
389
- child:
390
- Text(sendViewModel.fiat.title + ':',
391
- style: TextStyle(
392
- fontSize: 16,
393
- fontWeight: FontWeight.w600,
394
- color: Colors.white,
395
- )),
415
+ child: Text(
416
+ sendViewModel.fiat.title + ':',
417
+ style: TextStyle(
418
+ fontSize: 16,
419
+ fontWeight: FontWeight.w600,
420
+ color: Colors.white,
421
+ ),
422
+ ),
423
),
424
hintText: '0.00',
398
- borderColor: Theme.of(context)
399
- .primaryTextTheme
400
- .headlineSmall!
401
- .color!,
425
+ borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!,
426
textStyle: TextStyle(
403
- fontSize: 14,
404
- fontWeight: FontWeight.w500,
405
- color: Colors.white),
427
+ fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
428
placeholderTextStyle: TextStyle(
429
color: Theme.of(context)
408
- .primaryTextTheme.headlineSmall!.decorationColor!,
430
+ .primaryTextTheme
431
+ .headlineSmall!
432
+ .decorationColor!,
433
fontWeight: FontWeight.w500,
434
fontSize: 14),
411
- )),
435
+ ),
436
+ ),
437
Padding(
438
padding: EdgeInsets.only(top: 20),
439
child: BaseTextFormField(
440
controller: noteController,
441
keyboardType: TextInputType.multiline,
442
maxLines: null,
418
- borderColor: Theme.of(context)
419
- .primaryTextTheme
420
- .headlineSmall!
421
- .color!,
443
+ borderColor: Theme.of(context).primaryTextTheme.headlineSmall!.color!,
444
textStyle: TextStyle(
423
- fontSize: 14,
424
- fontWeight: FontWeight.w500,
425
- color: Colors.white),
445
+ fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
446
hintText: S.of(context).note_optional,
447
placeholderTextStyle: TextStyle(
448
fontSize: 14,
449
fontWeight: FontWeight.w500,
430
- color: Theme.of(context)
431
- .primaryTextTheme
432
- .headlineSmall!
433
- .decorationColor!),
450
+ color:
451
+ Theme.of(context).primaryTextTheme.headlineSmall!.decorationColor!),
452
),
453
),
454
Observer(
437
- builder: (_) => GestureDetector(
438
- onTap: () =>
439
- _setTransactionPriority(context),
455
+ builder: (_) => GestureDetector(
456
+ onTap: () => _setTransactionPriority(context),
457
+ child: Container(
458
+ padding: EdgeInsets.only(top: 24),
459
+ child: Row(
460
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
461
+ crossAxisAlignment: CrossAxisAlignment.start,
462
+ children: <Widget>[
463
+ Text(
464
+ S.of(context).send_estimated_fee,
465
+ style: TextStyle(
466
+ fontSize: 12,
467
+ fontWeight: FontWeight.w500,
468
+ //color: Theme.of(context).primaryTextTheme!.displaySmall!.color!,
469
+ color: Colors.white),
470
+ ),
471
+ Container(
472
+ child: Row(
473
+ crossAxisAlignment: CrossAxisAlignment.start,
474
+ children: <Widget>[
475
+ Column(
476
+ mainAxisAlignment: MainAxisAlignment.start,
477
+ crossAxisAlignment: CrossAxisAlignment.end,
478
+ children: [
479
+ Text(
480
+ output.estimatedFee.toString() +
481
+ ' ' +
482
+ sendViewModel.selectedCryptoCurrency.toString(),
483
+ style: TextStyle(
484
+ fontSize: 12,
485
+ fontWeight: FontWeight.w600,
486
+ //color: Theme.of(context).primaryTextTheme!.displaySmall!.color!,
487
+ color: Colors.white,
488
+ ),
489
+ ),
490
+ Padding(
491
+ padding: EdgeInsets.only(top: 5),
492
+ child: sendViewModel.isFiatDisabled
493
+ ? const SizedBox(height: 14)
494
+ : Text(
495
+ output.estimatedFeeFiatAmount +
496
+ ' ' +
497
+ sendViewModel.fiat.title,
498
+ style: TextStyle(
499
+ fontSize: 12,
500
+ fontWeight: FontWeight.w600,
501
+ color: Theme.of(context)
502
+ .primaryTextTheme
503
+ .headlineSmall!
504
+ .decorationColor!,
505
+ ),
506
+ ),
507
+ ),
508
+ ],
509
+ ),
510
+ Padding(
511
+ padding: EdgeInsets.only(top: 2, left: 5),
512
+ child: Icon(
513
+ Icons.arrow_forward_ios,
514
+ size: 12,
515
+ color: Colors.white,
516
+ ),
517
+ )
518
+ ],
519
+ ),
520
+ )
521
+ ],
522
+ ),
523
+ ),
524
+ ),
525
+ ),
526
+ if (sendViewModel.isElectrumWallet)
527
+ Padding(
528
+ padding: EdgeInsets.only(top: 6),
529
+ child: GestureDetector(
530
+ onTap: () => Navigator.of(context).pushNamed(Routes.unspentCoinsList),
531
child: Container(
441
- padding: EdgeInsets.only(top: 24),
532
+ color: Colors.transparent,
533
child: Row(
443
- mainAxisAlignment:
444
- MainAxisAlignment.spaceBetween,
445
- crossAxisAlignment: CrossAxisAlignment.start,
446
- children: <Widget>[
534
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
535
+ children: [
536
Text(
448
- S
449
- .of(context)
450
- .send_estimated_fee,
451
- style: TextStyle(
452
- fontSize: 12,
453
- fontWeight:
454
- FontWeight.w500,
455
- //color: Theme.of(context).primaryTextTheme!.displaySmall!.color!,
456
- color: Colors.white)),
457
- Container(
458
- child: Row(
459
- crossAxisAlignment: CrossAxisAlignment.start,
460
- children: <Widget>[
461
- Column(
462
- mainAxisAlignment: MainAxisAlignment.start,
463
- crossAxisAlignment: CrossAxisAlignment.end,
464
- children: [
465
- Text(
466
- output
467
- .estimatedFee
468
- .toString() +
469
- ' ' +
470
- sendViewModel
471
- .selectedCryptoCurrency.toString(),
472
- style: TextStyle(
473
- fontSize: 12,
474
- fontWeight:
475
- FontWeight.w600,
476
- //color: Theme.of(context).primaryTextTheme!.displaySmall!.color!,
477
- color:
478
- Colors.white)),
479
- Padding(
480
- padding:
481
- EdgeInsets.only(top: 5),
482
- child: sendViewModel.isFiatDisabled
483
- ? const SizedBox(height: 14)
484
- : Text(output
485
- .estimatedFeeFiatAmount
486
- + ' ' +
487
- sendViewModel
488
- .fiat.title,
489
- style: TextStyle(
490
- fontSize: 12,
491
- fontWeight:
492
- FontWeight.w600,
493
- color: Theme
494
- .of(context)
495
- .primaryTextTheme
496
- .headlineSmall!
497
- .decorationColor!))
498
- ),
499
- ],
500
- ),
501
- Padding(
502
- padding: EdgeInsets.only(
503
- top: 2,
504
- left: 5),
505
- child: Icon(
506
- Icons.arrow_forward_ios,
507
- size: 12,
508
- color: Colors.white,
509
- ),
510
- )
511
- ],
512
- ),
513
- )
537
+ S.of(context).coin_control,
538
+ style: TextStyle(
539
+ fontSize: 12,
540
+ fontWeight: FontWeight.w600,
541
+ color: Colors.white),
542
+ ),
543
+ Icon(
544
+ Icons.arrow_forward_ios,
545
+ size: 12,
546
+ color: Colors.white,
547
+ ),
548
],
549
),
550
),
517
- )),
518
- if (sendViewModel.isElectrumWallet) Padding(
519
- padding: EdgeInsets.only(top: 6),
520
- child: GestureDetector(
521
- onTap: () => Navigator.of(context)
522
- .pushNamed(Routes.unspentCoinsList),
523
- child: Container(
524
- color: Colors.transparent,
525
- child: Row(
526
- mainAxisAlignment:
527
- MainAxisAlignment.spaceBetween,
528
- children: [
529
- Text(
530
- S.of(context).coin_control,
531
- style: TextStyle(
532
- fontSize: 12,
533
- fontWeight: FontWeight.w600,
534
- color: Colors.white)),
535
- Icon(
536
- Icons.arrow_forward_ios,
537
- size: 12,
538
- color: Colors.white,
539
- )
540
- ],
541
- )
542
- )
543
- )
544
- )
551
+ ),
552
+ ),
553
],
546
- ))
554
+ ),
555
+ ),
556
),
557
),
558
)
561
}
562
563
void _setEffects(BuildContext context) {
555
- if (_effectsInstalled) {
564
+ if (_effectsInstalled) {
565
return;
566
}
558
-
567
+
568
if (output.address.isNotEmpty) {
569
addressController.text = output.address;
570
}
673
final selectedItem = items.indexOf(sendViewModel.transactionPriority);
674
675
await showPopUp<void>(
667
- builder: (_) => Picker(
668
- items: items,
669
- displayItem: sendViewModel.displayFeeRate,
670
- selectedAtIndex: selectedItem,
671
- title: S.of(context).please_select,
672
- mainAxisAlignment: MainAxisAlignment.center,
673
- onItemSelected: (TransactionPriority priority) =>
674
- sendViewModel.setTransactionPriority(priority),
675
- ),
676
- context: context);
676
+ context: context,
677
+ builder: (_) => Picker(
678
+ items: items,
679
+ displayItem: sendViewModel.displayFeeRate,
680
+ selectedAtIndex: selectedItem,
681
+ title: S.of(context).please_select,
682
+ mainAxisAlignment: MainAxisAlignment.center,
683
+ onItemSelected: (TransactionPriority priority) =>
684
+ sendViewModel.setTransactionPriority(priority),
685
+ ),
686
+ );
687
+ }
688
+
689
+ void _presentPicker(BuildContext context) {
690
+ showPopUp<void>(
691
+ context: context,
692
+ builder: (_) => CurrencyPicker(
693
+ selectedAtIndex: sendViewModel.currencies.indexOf(sendViewModel.selectedCryptoCurrency),
694
+ items: sendViewModel.currencies,
695
+ hintText: S.of(context).search_currency,
696
+ onItemSelected: (Currency cur) =>
697
+ sendViewModel.selectedCryptoCurrency = (cur as CryptoCurrency),
698
+ ),
699
+ );
700
}
701
702
@override