CWA-198 | removed buttons_widget, fixed wallet_card, trade_history_panel, date_section_raw, trade_raw, transaction_raw and dashboard_page
Oleksandr Sobol committed
Apr 17, 2020 at 22:40 UTC
2a18f4a1e40a272f31cbaa2bdb17befe62137a31
20 files changed
+480
-838
lib/generated/i18n.dart
+23
@@ -39,6 +39,7 @@ class S implements WidgetsLocalizations {
39
String get authentication => "Authentication";
40
String get available_balance => "Available Balance";
41
String get biometric_auth_reason => "Scan your fingerprint to authenticate";
42
+ String get buy => "Buy";
43
String get cancel => "Cancel";
44
String get card_address => "Address:";
45
String get change => "Change";
@@ -439,6 +440,8 @@ class $de extends S {
440
@override
441
String get trade_details_fetching => "Holen";
442
@override
443
+ String get buy => "Kaufen";
444
+ @override
445
String get confirm_sending => "Bestätigen Sie das Senden";
446
@override
447
String get settings_title => "die Einstellungen";
@@ -1009,6 +1012,8 @@ class $hi extends S {
1012
@override
1013
String get trade_details_fetching => "ला रहा है";
1014
@override
1015
+ String get buy => "खरीदें";
1016
+ @override
1017
String get confirm_sending => "भेजने की पुष्टि करें";
1018
@override
1019
String get settings_title => "सेटिंग्स";
@@ -1579,6 +1584,8 @@ class $ru extends S {
1584
@override
1585
String get trade_details_fetching => "Получение";
1586
@override
1587
+ String get buy => "Купить";
1588
+ @override
1589
String get confirm_sending => "Подтвердить отправку";
1590
@override
1591
String get settings_title => "Настройки";
@@ -2149,6 +2156,8 @@ class $ko extends S {
2156
@override
2157
String get trade_details_fetching => "가져 오는 중";
2158
@override
2159
+ String get buy => "구입";
2160
+ @override
2161
String get confirm_sending => "전송 확인";
2162
@override
2163
String get settings_title => "설정";
@@ -2719,6 +2728,8 @@ class $pt extends S {
2728
@override
2729
String get trade_details_fetching => "Buscando";
2730
@override
2731
+ String get buy => "Comprar";
2732
+ @override
2733
String get confirm_sending => "Confirmar o envio";
2734
@override
2735
String get settings_title => "Configurações";
@@ -3289,6 +3300,8 @@ class $uk extends S {
3300
@override
3301
String get trade_details_fetching => "Отримання";
3302
@override
3303
+ String get buy => "Купити";
3304
+ @override
3305
String get confirm_sending => "Підтвердити відправлення";
3306
@override
3307
String get settings_title => "Налаштування";
@@ -3859,6 +3872,8 @@ class $ja extends S {
3872
@override
3873
String get trade_details_fetching => "フェッチング";
3874
@override
3875
+ String get buy => "購入";
3876
+ @override
3877
String get confirm_sending => "送信を確認";
3878
@override
3879
String get settings_title => "設定";
@@ -4433,6 +4448,8 @@ class $pl extends S {
4448
@override
4449
String get trade_details_fetching => "Ujmujący";
4450
@override
4451
+ String get buy => "Kup";
4452
+ @override
4453
String get confirm_sending => "Potwierdź wysłanie";
4454
@override
4455
String get settings_title => "Ustawienia";
@@ -5003,6 +5020,8 @@ class $es extends S {
5020
@override
5021
String get trade_details_fetching => "Cargando";
5022
@override
5023
+ String get buy => "Comprar";
5024
+ @override
5025
String get confirm_sending => "Confirmar envío";
5026
@override
5027
String get settings_title => "Configuraciones";
@@ -5573,6 +5592,8 @@ class $nl extends S {
5592
@override
5593
String get trade_details_fetching => "Ophalen";
5594
@override
5595
+ String get buy => "Kopen";
5596
+ @override
5597
String get confirm_sending => "Bevestig verzending";
5598
@override
5599
String get settings_title => "Instellingen";
@@ -6143,6 +6164,8 @@ class $zh extends S {
6164
@override
6165
String get trade_details_fetching => "正在取得";
6166
@override
6167
+ String get buy => "購買";
6168
+ @override
6169
String get confirm_sending => "确认发送";
6170
@override
6171
String get settings_title => "设定值";
lib/src/screens/dashboard/dashboard_page.dart
+11
-579
@@ -1,111 +1,18 @@
1
-import 'package:provider/provider.dart';
2
-import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
1
import 'package:flutter/material.dart';
2
import 'package:flutter/cupertino.dart';
5
-import 'package:flutter_mobx/flutter_mobx.dart';
6
-import 'package:cake_wallet/routes.dart';
3
import 'package:cake_wallet/palette.dart';
8
-import 'package:cake_wallet/generated/i18n.dart';
9
-import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
10
-import 'package:cake_wallet/src/domain/common/sync_status.dart';
11
-import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
12
-import 'package:cake_wallet/src/stores/action_list/action_list_store.dart';
13
-import 'package:cake_wallet/src/stores/balance/balance_store.dart';
14
-import 'package:cake_wallet/src/stores/sync/sync_store.dart';
15
-import 'package:cake_wallet/src/stores/settings/settings_store.dart';
16
-import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
17
-import 'package:cake_wallet/src/stores/action_list/date_section_item.dart';
18
-import 'package:cake_wallet/src/stores/action_list/trade_list_item.dart';
19
-import 'package:cake_wallet/src/stores/action_list/transaction_list_item.dart';
4
import 'package:cake_wallet/src/screens/base_page.dart';
21
-import 'package:cake_wallet/src/screens/dashboard/widgets/date_section_raw.dart';
22
-import 'package:cake_wallet/src/screens/dashboard/widgets/trade_row.dart';
23
-import 'package:cake_wallet/src/screens/dashboard/widgets/transaction_raw.dart';
24
-import 'package:cake_wallet/src/widgets/primary_button.dart';
25
-import 'package:cake_wallet/src/screens/dashboard/wallet_menu.dart';
26
-import 'package:cake_wallet/src/widgets/picker.dart';
5
import 'package:cake_wallet/src/screens/dashboard/widgets/wallet_card.dart';
28
-import 'package:cake_wallet/src/screens/dashboard/widgets/buttons_widget.dart';
6
import 'package:cake_wallet/src/screens/dashboard/widgets/trade_history_panel.dart';
7
8
class DashboardPage extends BasePage {
9
final _bodyKey = GlobalKey();
10
34
- /*@override
35
- Widget leading(BuildContext context) {
36
- return SizedBox(
37
- width: 30,
38
- child: FlatButton(
39
- padding: EdgeInsets.all(0),
40
- onPressed: () => _presentWalletMenu(context),
41
- child: Image.asset('assets/images/more.png',
42
- color: Theme.of(context).primaryTextTheme.caption.color,
43
- width: 30)));
44
- }
45
-
46
- @override
47
- Widget middle(BuildContext context) {
48
- final walletStore = Provider.of<WalletStore>(context);
49
-
50
- return Observer(builder: (_) {
51
- return Column(
52
- mainAxisAlignment: MainAxisAlignment.center,
53
- children: <Widget>[
54
- Text(
55
- walletStore.name,
56
- style: TextStyle(
57
- color: Theme.of(context).primaryTextTheme.title.color),
58
- ),
59
- SizedBox(height: 5),
60
- Text(
61
- walletStore.account != null ? '${walletStore.account.label}' : '',
62
- style: TextStyle(
63
- fontWeight: FontWeight.w400,
64
- fontSize: 10,
65
- color: Theme.of(context).primaryTextTheme.title.color),
66
- ),
67
- ]);
68
- });
69
- }
70
-
71
- @override
72
- Widget trailing(BuildContext context) {
73
- return SizedBox(
74
- width: 20,
75
- child: FlatButton(
76
- padding: EdgeInsets.all(0),
77
- onPressed: () => Navigator.of(context).pushNamed(Routes.settings),
78
- child: Image.asset('assets/images/settings_icon.png',
79
- color: Colors.grey, height: 20)),
80
- );
81
- }*/
11
@override
12
ObstructingPreferredSizeWidget appBar(BuildContext context) => null;
13
14
@override
15
Widget body(BuildContext context) => DashboardPageBody(key: _bodyKey);
87
-
88
- /*@override
89
- Widget floatingActionButton(BuildContext context) => FloatingActionButton(
90
- child: Image.asset('assets/images/exchange_icon.png',
91
- color: Colors.white, height: 26, width: 22),
92
- backgroundColor: Palette.floatingActionButton,
93
- onPressed: () async => await Navigator.of(context, rootNavigator: true)
94
- .pushNamed(Routes.exchange));
95
-
96
- void _presentWalletMenu(BuildContext bodyContext) {
97
- final walletMenu = WalletMenu(bodyContext);
98
-
99
- showDialog<void>(
100
- builder: (_) => Picker(
101
- items: walletMenu.items,
102
- selectedAtIndex: -1,
103
- title: S.of(bodyContext).wallet_menu,
104
- pickerHeight: 510,
105
- onItemSelected: (String item) =>
106
- walletMenu.action(walletMenu.items.indexOf(item))),
107
- context: bodyContext);
108
- }*/
16
}
17
18
class DashboardPageBody extends StatefulWidget {
@@ -117,12 +24,6 @@ class DashboardPageBody extends StatefulWidget {
24
25
class DashboardPageBodyState extends State<DashboardPageBody> {
26
final menuButton = Image.asset('assets/images/menu_button.png');
120
- /*final _connectionStatusObserverKey = GlobalKey();
121
- final _balanceObserverKey = GlobalKey();
122
- final _balanceTitleObserverKey = GlobalKey();
123
- final _syncingObserverKey = GlobalKey();
124
- final _listObserverKey = GlobalKey();
125
- final _listKey = GlobalKey();*/
27
28
@override
29
Widget build(BuildContext context) {
@@ -161,491 +62,22 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
62
padding: EdgeInsets.only(left: 20, top: 23),
63
child: WalletCard(),
64
),
164
- Padding(
165
- padding: EdgeInsets.only(top: 28),
166
- child: ButtonsWidget(),
167
- ),
65
Expanded(
169
- child: TradeHistoryPanel()
66
+ child: Stack(
67
+ alignment: Alignment.topCenter,
68
+ fit: StackFit.expand,
69
+ children: <Widget>[
70
+ Positioned(
71
+ top: 28,
72
+ left: 0,
73
+ child: TradeHistoryPanel()
74
+ ),
75
+ ],
76
+ )
77
)
78
],
79
),
80
),
81
);
175
-
176
- /*final balanceStore = Provider.of<BalanceStore>(context);
177
- final actionListStore = Provider.of<ActionListStore>(context);
178
- final syncStore = Provider.of<SyncStore>(context);
179
- final settingsStore = Provider.of<SettingsStore>(context);
180
- final transactionDateFormat = settingsStore.getCurrentDateFormat(
181
- formatUSA: "MMMM d, yyyy, HH:mm",
182
- formatDefault: "d MMMM yyyy, HH:mm");
183
-
184
- return Observer(
185
- key: _listObserverKey,
186
- builder: (_) {
187
- final items = actionListStore.items == null
188
- ? <String>[]
189
- : actionListStore.items;
190
- final itemsCount = items.length + 2;
191
-
192
- return ListView.builder(
193
- key: _listKey,
194
- padding: EdgeInsets.only(bottom: 15),
195
- itemCount: itemsCount,
196
- itemBuilder: (context, index) {
197
- if (index == 0) {
198
- return Container(
199
- margin: EdgeInsets.only(bottom: 20),
200
- decoration: BoxDecoration(
201
- color: Theme.of(context).backgroundColor,
202
- boxShadow: [
203
- BoxShadow(
204
- color: Palette.shadowGreyWithOpacity,
205
- blurRadius: 10,
206
- offset: Offset(0, 12))
207
- ]),
208
- child: Column(
209
- children: <Widget>[
210
- Observer(
211
- key: _syncingObserverKey,
212
- builder: (_) {
213
- final status = syncStore.status;
214
- final statusText = status.title();
215
- final progress = syncStore.status.progress();
216
- final isFialure = status is FailedSyncStatus;
217
-
218
- var descriptionText = '';
219
-
220
- if (status is SyncingSyncStatus) {
221
- descriptionText = S
222
- .of(context)
223
- .Blocks_remaining(
224
- syncStore.status.toString());
225
- }
226
-
227
- if (status is FailedSyncStatus) {
228
- descriptionText = S
229
- .of(context)
230
- .please_try_to_connect_to_another_node;
231
- }
232
-
233
- return Container(
234
- child: Column(
235
- children: [
236
- SizedBox(
237
- height: 3,
238
- child: LinearProgressIndicator(
239
- backgroundColor: Palette.separator,
240
- valueColor:
241
- AlwaysStoppedAnimation<Color>(
242
- Palette.cakeGreen),
243
- value: progress,
244
- ),
245
- ),
246
- SizedBox(height: 10),
247
- Text(statusText,
248
- style: TextStyle(
249
- fontSize: 14,
250
- fontWeight: FontWeight.bold,
251
- color: isFialure
252
- ? Palette.failure
253
- : Palette.cakeGreen)),
254
- Text(descriptionText,
255
- style: TextStyle(
256
- fontSize: 11,
257
- color: Palette.wildDarkBlue,
258
- height: 2.0))
259
- ],
260
- ),
261
- );
262
- }),
263
- GestureDetector(
264
- onTapUp: (_) => balanceStore.isReversing = false,
265
- onTapDown: (_) => balanceStore.isReversing = true,
266
- child: Container(
267
- padding: EdgeInsets.only(top: 40, bottom: 40),
268
- color: Colors.transparent,
269
- child: Column(
270
- children: <Widget>[
271
- Container(width: double.infinity),
272
- Observer(
273
- key: _balanceTitleObserverKey,
274
- builder: (_) {
275
- final savedDisplayMode =
276
- settingsStore.balanceDisplayMode;
277
- final displayMode = balanceStore
278
- .isReversing
279
- ? (savedDisplayMode ==
280
- BalanceDisplayMode
281
- .availableBalance
282
- ? BalanceDisplayMode.fullBalance
283
- : BalanceDisplayMode
284
- .availableBalance)
285
- : savedDisplayMode;
286
-
287
- return Text(displayMode.toString(),
288
- style: TextStyle(
289
- color: Palette.violet,
290
- fontSize: 16));
291
- }),
292
- Observer(
293
- key: _connectionStatusObserverKey,
294
- builder: (_) {
295
- final savedDisplayMode =
296
- settingsStore.balanceDisplayMode;
297
- var balance = '---';
298
- final displayMode = balanceStore
299
- .isReversing
300
- ? (savedDisplayMode ==
301
- BalanceDisplayMode
302
- .availableBalance
303
- ? BalanceDisplayMode.fullBalance
304
- : BalanceDisplayMode
305
- .availableBalance)
306
- : savedDisplayMode;
307
-
308
- if (displayMode ==
309
- BalanceDisplayMode.availableBalance) {
310
- balance =
311
- balanceStore.unlockedBalance ??
312
- '0.0';
313
- }
314
-
315
- if (displayMode ==
316
- BalanceDisplayMode.fullBalance) {
317
- balance =
318
- balanceStore.fullBalance ?? '0.0';
319
- }
320
-
321
- return Text(
322
- balance,
323
- style: TextStyle(
324
- color: Theme.of(context)
325
- .primaryTextTheme
326
- .caption
327
- .color,
328
- fontSize: 42),
329
- );
330
- }),
331
- Padding(
332
- padding: EdgeInsets.only(top: 7),
333
- child: Observer(
334
- key: _balanceObserverKey,
335
- builder: (_) {
336
- final savedDisplayMode =
337
- settingsStore.balanceDisplayMode;
338
- final displayMode =
339
- balanceStore.isReversing
340
- ? (savedDisplayMode ==
341
- BalanceDisplayMode
342
- .availableBalance
343
- ? BalanceDisplayMode
344
- .fullBalance
345
- : BalanceDisplayMode
346
- .availableBalance)
347
- : savedDisplayMode;
348
- final symbol = settingsStore
349
- .fiatCurrency
350
- .toString();
351
- var balance = '---';
352
-
353
- if (displayMode ==
354
- BalanceDisplayMode
355
- .availableBalance) {
356
- balance =
357
- '${balanceStore.fiatUnlockedBalance} $symbol';
358
- }
359
-
360
- if (displayMode ==
361
- BalanceDisplayMode.fullBalance) {
362
- balance =
363
- '${balanceStore.fiatFullBalance} $symbol';
364
- }
365
-
366
- return Text(balance,
367
- style: TextStyle(
368
- color: Palette.wildDarkBlue,
369
- fontSize: 16));
370
- }))
371
- ],
372
- ),
373
- ),
374
- ),
375
- Padding(
376
- padding: const EdgeInsets.only(
377
- left: 20, right: 20, bottom: 30),
378
- child: Container(
379
- child: Row(
380
- mainAxisAlignment:
381
- MainAxisAlignment.spaceBetween,
382
- children: <Widget>[
383
- Expanded(
384
- child: PrimaryImageButton(
385
- image: Image.asset(
386
- 'assets/images/send_icon.png',
387
- height: 25,
388
- width: 25),
389
- text: S.of(context).send,
390
- onPressed: () => Navigator.of(context,
391
- rootNavigator: true)
392
- .pushNamed(Routes.send),
393
- color: Theme.of(context)
394
- .primaryTextTheme
395
- .button
396
- .backgroundColor,
397
- borderColor: Theme.of(context)
398
- .primaryTextTheme
399
- .button
400
- .decorationColor,
401
- )),
402
- SizedBox(width: 10),
403
- Expanded(
404
- child: PrimaryImageButton(
405
- image: Image.asset(
406
- 'assets/images/receive_icon.png',
407
- height: 25,
408
- width: 25),
409
- text: S.of(context).receive,
410
- onPressed: () => Navigator.of(context,
411
- rootNavigator: true)
412
- .pushNamed(Routes.receive),
413
- color: Theme.of(context)
414
- .accentTextTheme
415
- .caption
416
- .backgroundColor,
417
- borderColor: Theme.of(context)
418
- .accentTextTheme
419
- .caption
420
- .decorationColor,
421
- ))
422
- ],
423
- ),
424
- )),
425
- ],
426
- ),
427
- );
428
- }
429
-
430
- if (index == 1 && actionListStore.totalCount > 0) {
431
- return Padding(
432
- padding: EdgeInsets.only(right: 20, top: 10, bottom: 20),
433
- child: Row(
434
- mainAxisAlignment: MainAxisAlignment.end,
435
- children: <Widget>[
436
- PopupMenuButton<int>(
437
- itemBuilder: (context) => [
438
- PopupMenuItem(
439
- enabled: false,
440
- value: -1,
441
- child: Text(S.of(context).transactions,
442
- style: TextStyle(
443
- fontWeight: FontWeight.bold,
444
- color: Theme.of(context).primaryTextTheme.caption.color))),
445
- PopupMenuItem(
446
- value: 0,
447
- child: Observer(
448
- builder: (_) => Row(
449
- mainAxisAlignment:
450
- MainAxisAlignment
451
- .spaceBetween,
452
- children: [
453
- Text(S.of(context).incoming),
454
- Checkbox(
455
- value: actionListStore
456
- .transactionFilterStore
457
- .displayIncoming,
458
- onChanged: (value) =>
459
- actionListStore
460
- .transactionFilterStore
461
- .toggleIncoming(),
462
- )
463
- ]))),
464
- PopupMenuItem(
465
- value: 1,
466
- child: Observer(
467
- builder: (_) => Row(
468
- mainAxisAlignment:
469
- MainAxisAlignment
470
- .spaceBetween,
471
- children: [
472
- Text(S.of(context).outgoing),
473
- Checkbox(
474
- value: actionListStore
475
- .transactionFilterStore
476
- .displayOutgoing,
477
- onChanged: (value) =>
478
- actionListStore
479
- .transactionFilterStore
480
- .toggleOutgoing(),
481
- )
482
- ]))),
483
- PopupMenuItem(
484
- value: 2,
485
- child:
486
- Text(S.of(context).transactions_by_date)),
487
- PopupMenuDivider(),
488
- PopupMenuItem(
489
- enabled: false,
490
- value: -1,
491
- child: Text(S.of(context).trades,
492
- style: TextStyle(
493
- fontWeight: FontWeight.bold,
494
- color: Theme.of(context).primaryTextTheme.caption.color))),
495
- PopupMenuItem(
496
- value: 3,
497
- child: Observer(
498
- builder: (_) => Row(
499
- mainAxisAlignment:
500
- MainAxisAlignment
501
- .spaceBetween,
502
- children: [
503
- Text('XMR.TO'),
504
- Checkbox(
505
- value: actionListStore
506
- .tradeFilterStore
507
- .displayXMRTO,
508
- onChanged: (value) =>
509
- actionListStore
510
- .tradeFilterStore
511
- .toggleDisplayExchange(
512
- ExchangeProviderDescription
513
- .xmrto),
514
- )
515
- ]))),
516
- PopupMenuItem(
517
- value: 4,
518
- child: Observer(
519
- builder: (_) => Row(
520
- mainAxisAlignment:
521
- MainAxisAlignment
522
- .spaceBetween,
523
- children: [
524
- Text('Change.NOW'),
525
- Checkbox(
526
- value: actionListStore
527
- .tradeFilterStore
528
- .displayChangeNow,
529
- onChanged: (value) =>
530
- actionListStore
531
- .tradeFilterStore
532
- .toggleDisplayExchange(
533
- ExchangeProviderDescription
534
- .changeNow),
535
- )
536
- ]))),
537
- PopupMenuItem(
538
- value: 5,
539
- child: Observer(
540
- builder: (_) => Row(
541
- mainAxisAlignment:
542
- MainAxisAlignment
543
- .spaceBetween,
544
- children: [
545
- Text('MorphToken'),
546
- Checkbox(
547
- value: actionListStore
548
- .tradeFilterStore
549
- .displayMorphToken,
550
- onChanged: (value) =>
551
- actionListStore
552
- .tradeFilterStore
553
- .toggleDisplayExchange(
554
- ExchangeProviderDescription
555
- .morphToken),
556
- )
557
- ])))
558
- ],
559
- child: Text(S.of(context).filters,
560
- style: TextStyle(
561
- fontSize: 16.0,
562
- color: Theme.of(context)
563
- .primaryTextTheme
564
- .subtitle
565
- .color)),
566
- onSelected: (item) async {
567
- if (item == 2) {
568
- final List<DateTime> picked =
569
- await date_rage_picker.showDatePicker(
570
- context: context,
571
- initialFirstDate: DateTime.now()
572
- .subtract(Duration(days: 1)),
573
- initialLastDate: (DateTime.now()),
574
- firstDate: DateTime(2015),
575
- lastDate: DateTime.now()
576
- .add(Duration(days: 1)));
577
-
578
- if (picked != null && picked.length == 2) {
579
- actionListStore.transactionFilterStore
580
- .changeStartDate(picked.first);
581
- actionListStore.transactionFilterStore
582
- .changeEndDate(picked.last);
583
- }
584
- }
585
- },
586
- )
587
- ]),
588
- );
589
- }
590
-
591
- index -= 2;
592
-
593
- if (index < 0 || index >= items.length) {
594
- return Container();
595
- }
596
-
597
- final item = items[index];
598
-
599
- if (item is DateSectionItem) {
600
- return DateSectionRaw(date: item.date);
601
- }
602
-
603
- if (item is TransactionListItem) {
604
- final transaction = item.transaction;
605
- final savedDisplayMode = settingsStore.balanceDisplayMode;
606
- final formattedAmount =
607
- savedDisplayMode == BalanceDisplayMode.hiddenBalance
608
- ? '---'
609
- : transaction.amountFormatted();
610
- final formattedFiatAmount =
611
- savedDisplayMode == BalanceDisplayMode.hiddenBalance
612
- ? '---'
613
- : transaction.fiatAmount();
614
-
615
- return TransactionRow(
616
- onTap: () => Navigator.of(context).pushNamed(
617
- Routes.transactionDetails,
618
- arguments: transaction),
619
- direction: transaction.direction,
620
- formattedDate:
621
- transactionDateFormat.format(transaction.date),
622
- formattedAmount: formattedAmount,
623
- formattedFiatAmount: formattedFiatAmount,
624
- isPending: transaction.isPending);
625
- }
626
-
627
- if (item is TradeListItem) {
628
- final trade = item.trade;
629
- final savedDisplayMode = settingsStore.balanceDisplayMode;
630
- final formattedAmount = trade.amount != null
631
- ? savedDisplayMode == BalanceDisplayMode.hiddenBalance
632
- ? '---'
633
- : trade.amountFormatted()
634
- : trade.amount;
635
-
636
- return TradeRow(
637
- onTap: () => Navigator.of(context)
638
- .pushNamed(Routes.tradeDetails, arguments: trade),
639
- provider: trade.provider,
640
- from: trade.from,
641
- to: trade.to,
642
- createdAtFormattedDate:
643
- transactionDateFormat.format(trade.createdAt),
644
- formattedAmount: formattedAmount);
645
- }
646
-
647
- return Container();
648
- });
649
- });*/
82
}
83
}
lib/src/screens/dashboard/widgets/buttons_widget.dart
deleted
-118
@@ -1,118 +0,0 @@
1
-import 'dart:async';
2
-import 'package:flutter/material.dart';
3
-import 'package:cake_wallet/palette.dart';
4
-import 'package:cake_wallet/generated/i18n.dart';
5
-import 'package:cake_wallet/routes.dart';
6
-
7
-class ButtonsWidget extends StatefulWidget {
8
- @override
9
- ButtonsWidgetState createState() => ButtonsWidgetState();
10
-}
11
-
12
-class ButtonsWidgetState extends State<ButtonsWidget> {
13
- final sendImage = Image.asset('assets/images/send.png');
14
- final exchangeImage = Image.asset('assets/images/exchange.png');
15
- final buyImage = Image.asset('assets/images/coins.png');
16
-
17
- double height;
18
- bool isDraw;
19
-
20
- @override
21
- void initState() {
22
- height = 0;
23
- isDraw = false;
24
- super.initState();
25
- WidgetsBinding.instance.addPostFrameCallback(afterLayout);
26
- }
27
-
28
- void afterLayout(dynamic _) {
29
- setState(() => height = 108);
30
- Timer(Duration(milliseconds: 250), () =>
31
- setState(() => isDraw = true)
32
- );
33
- }
34
-
35
- @override
36
- Widget build(BuildContext context) {
37
- return Container(
38
- height: 108,
39
- padding: EdgeInsets.only(left: 44, right: 44),
40
- alignment: Alignment.bottomCenter,
41
- child: AnimatedContainer(
42
- height: height,
43
- duration: Duration(milliseconds: 500),
44
- curve: Curves.fastOutSlowIn,
45
- child: isDraw
46
- ? Row(
47
- children: <Widget>[
48
- Flexible(
49
- child: actionButton(
50
- image: sendImage,
51
- title: S.of(context).send,
52
- route: Routes.send
53
- )
54
- ),
55
- Flexible(
56
- child: actionButton(
57
- image: exchangeImage,
58
- title: S.of(context).exchange,
59
- route: Routes.exchange
60
- )
61
- ),
62
- Flexible(
63
- child: actionButton(
64
- image: buyImage,
65
- title: 'Buy',
66
- route: ''
67
- )
68
- )
69
- ],
70
- )
71
- : Offstage(),
72
- ),
73
- );
74
- }
75
-
76
- Widget actionButton({
77
- @required Image image,
78
- @required String title,
79
- @required String route}) {
80
-
81
- return Container(
82
- width: double.infinity,
83
- child: Column(
84
- mainAxisAlignment: MainAxisAlignment.start,
85
- crossAxisAlignment: CrossAxisAlignment.center,
86
- children: <Widget>[
87
- GestureDetector(
88
- onTap: () {
89
- if (route.isNotEmpty) {
90
- Navigator.of(context, rootNavigator: true).pushNamed(route);
91
- }
92
- },
93
- child: Container(
94
- height: 48,
95
- width: 48,
96
- alignment: Alignment.center,
97
- decoration: BoxDecoration(
98
- color: Colors.white,
99
- shape: BoxShape.circle
100
- ),
101
- child: image,
102
- ),
103
- ),
104
- Padding(
105
- padding: EdgeInsets.only(top: 10),
106
- child: Text(
107
- title,
108
- style: TextStyle(
109
- fontSize: 16,
110
- color: PaletteDark.walletCardText
111
- ),
112
- ),
113
- )
114
- ],
115
- ),
116
- );
117
- }
118
-}
\ No newline at end of file
lib/src/screens/dashboard/widgets/date_section_raw.dart
+6
-5
@@ -35,11 +35,12 @@ class DateSectionRaw extends StatelessWidget {
35
title = dateSectionDateFormat.format(date);
36
}
37
38
- return Padding(
39
- padding: const EdgeInsets.only(top: 10, bottom: 10),
40
- child: Center(
41
- child: Text(title,
42
- style: TextStyle(fontSize: 12, color: PaletteDark.historyPanelText))),
38
+ return Container(
39
+ padding: EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 20),
40
+ alignment: Alignment.center,
41
+ color: PaletteDark.historyPanel,
42
+ child: Text(title,
43
+ style: TextStyle(fontSize: 12, color: PaletteDark.historyPanelText))
44
);
45
}
46
}
lib/src/screens/dashboard/widgets/trade_history_panel.dart
+379
-109
@@ -1,10 +1,11 @@
1
-import 'dart:async';
1
import 'package:cake_wallet/src/domain/common/balance_display_mode.dart';
2
+import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
3
import 'package:cake_wallet/src/stores/action_list/action_list_store.dart';
4
import 'package:cake_wallet/src/stores/action_list/date_section_item.dart';
5
import 'package:cake_wallet/src/stores/action_list/trade_list_item.dart';
6
import 'package:cake_wallet/src/stores/action_list/transaction_list_item.dart';
7
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
8
+import 'package:flutter/cupertino.dart';
9
import 'package:flutter/material.dart';
10
import 'package:cake_wallet/palette.dart';
11
import 'package:cake_wallet/generated/i18n.dart';
@@ -15,6 +16,7 @@ import 'package:cake_wallet/routes.dart';
16
import 'date_section_raw.dart';
17
import 'trade_row.dart';
18
import 'transaction_raw.dart';
19
+import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker;
20
21
class TradeHistoryPanel extends StatefulWidget {
22
@override
@@ -27,15 +29,11 @@ class TradeHistoryPanelState extends State<TradeHistoryPanel> {
29
30
double panelHeight;
31
double screenHeight;
30
- double opacity;
31
- bool isDraw;
32
33
@override
34
void initState() {
35
panelHeight = 0;
36
screenHeight = 0;
37
- opacity = 0;
38
- isDraw = false;
37
super.initState();
38
WidgetsBinding.instance.addPostFrameCallback(afterLayout);
39
}
@@ -44,11 +42,7 @@ class TradeHistoryPanelState extends State<TradeHistoryPanel> {
42
screenHeight = MediaQuery.of(context).size.height;
43
setState(() {
44
panelHeight = screenHeight;
47
- opacity = 1;
45
});
49
- Timer(Duration(milliseconds: 350), () =>
50
- setState(() => isDraw = true)
51
- );
46
}
47
48
@override
@@ -56,123 +50,399 @@ class TradeHistoryPanelState extends State<TradeHistoryPanel> {
50
final actionListStore = Provider.of<ActionListStore>(context);
51
final settingsStore = Provider.of<SettingsStore>(context);
52
final transactionDateFormat = DateFormat("HH:mm");
59
- final filterButton = Image.asset('assets/images/filter_button.png');
53
54
return Container(
62
- width: double.infinity,
55
+ height: MediaQuery.of(context).size.height,
56
+ width: MediaQuery.of(context).size.width,
57
alignment: Alignment.bottomCenter,
58
child: AnimatedContainer(
65
- width: double.infinity,
59
+ width: MediaQuery.of(context).size.width,
60
height: panelHeight,
67
- duration: Duration(milliseconds: 1000),
61
+ duration: Duration(milliseconds: 500),
62
curve: Curves.fastOutSlowIn,
69
- decoration: BoxDecoration(
70
- borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
71
- color: PaletteDark.historyPanel.withOpacity(opacity),
72
- ),
73
- child: isDraw
74
- ? Container(
75
- padding: EdgeInsets.only(top: 20, left: 20, right: 20),
76
- child: Column(
77
- children: <Widget>[
78
- Container(
79
- width: double.infinity,
80
- height: 36,
81
- margin: EdgeInsets.only(bottom: 10),
82
- child: Stack(
83
- alignment: Alignment.center,
84
- children: <Widget>[
85
- Text(
86
- S.of(context).trade_history_title,
87
- style: TextStyle(
88
- fontSize: 20
89
- ),
90
- ),
91
- Positioned(
92
- right: 0,
93
- child: GestureDetector(
94
- onTap: () {},
95
- child: filterButton,
96
- )
97
- )
98
- ],
99
- ),
100
- ),
101
- Observer(
63
+ child: CustomScrollView(
64
+ slivers: <Widget>[
65
+ SliverPersistentHeader(
66
+ delegate: ButtonHeader(),
67
+ pinned: true,
68
+ floating: false,
69
+ ),
70
+ Observer(
71
key: _listObserverKey,
72
builder: (_) {
73
final items = actionListStore.items == null
74
? <String>[]
75
: actionListStore.items;
107
- final itemsCount = items.length;
76
+ final itemsCount = items.length + 1;
77
final symbol = settingsStore.fiatCurrency.toString();
78
+ double freeSpaceHeight = MediaQuery.of(context).size.height - 496; // FIXME
79
110
- return Expanded(
111
- child: ListView.builder(
112
- key: _listKey,
113
- padding: EdgeInsets.only(bottom: 15),
114
- itemCount: itemsCount,
115
- itemBuilder: (context, index) {
116
-
117
- final item = items[index];
118
-
119
- if (item is DateSectionItem) {
120
- return DateSectionRaw(date: item.date);
121
- }
122
-
123
- if (item is TransactionListItem) {
124
- final transaction = item.transaction;
125
- final savedDisplayMode = settingsStore.balanceDisplayMode;
126
- final formattedAmount =
127
- savedDisplayMode == BalanceDisplayMode.hiddenBalance
128
- ? '---'
129
- : transaction.amountFormatted();
130
- final formattedFiatAmount =
131
- savedDisplayMode == BalanceDisplayMode.hiddenBalance
132
- ? '---'
133
- : transaction.fiatAmount(symbol);
134
-
135
- return TransactionRow(
136
- onTap: () => Navigator.of(context).pushNamed(
137
- Routes.transactionDetails,
138
- arguments: transaction),
139
- direction: transaction.direction,
140
- formattedDate:
141
- transactionDateFormat.format(transaction.date),
142
- formattedAmount: formattedAmount,
143
- formattedFiatAmount: formattedFiatAmount,
144
- isPending: transaction.isPending);
145
- }
146
-
147
- if (item is TradeListItem) {
148
- final trade = item.trade;
149
- final savedDisplayMode = settingsStore.balanceDisplayMode;
150
- final formattedAmount = trade.amount != null
151
- ? savedDisplayMode == BalanceDisplayMode.hiddenBalance
152
- ? '---'
153
- : trade.amountFormatted()
154
- : trade.amount;
155
-
156
- return TradeRow(
157
- onTap: () => Navigator.of(context)
158
- .pushNamed(Routes.tradeDetails, arguments: trade),
159
- provider: trade.provider,
160
- from: trade.from,
161
- to: trade.to,
162
- createdAtFormattedDate:
163
- transactionDateFormat.format(trade.createdAt),
164
- formattedAmount: formattedAmount);
165
- }
166
-
167
- return Container();
168
- }
169
- )
80
+ return SliverList(
81
+ key: _listKey,
82
+ delegate: SliverChildBuilderDelegate(
83
+ (context, index) {
84
+
85
+ if (index == itemsCount - 1) {
86
+ freeSpaceHeight = freeSpaceHeight >= 0 ? freeSpaceHeight : 0;
87
+
88
+ return Container(
89
+ height: freeSpaceHeight,
90
+ width: MediaQuery.of(context).size.width,
91
+ color: PaletteDark.historyPanel,
92
+ );
93
+ }
94
+
95
+ final item = items[index];
96
+
97
+ if (item is DateSectionItem) {
98
+ freeSpaceHeight -= 32; // FIXME
99
+ return DateSectionRaw(date: item.date);
100
+ }
101
+
102
+ if (item is TransactionListItem) {
103
+ freeSpaceHeight -= 45; // FIXME
104
+ final transaction = item.transaction;
105
+ final savedDisplayMode = settingsStore.balanceDisplayMode;
106
+ final formattedAmount =
107
+ savedDisplayMode == BalanceDisplayMode.hiddenBalance
108
+ ? '---'
109
+ : transaction.amountFormatted();
110
+ final formattedFiatAmount =
111
+ savedDisplayMode == BalanceDisplayMode.hiddenBalance
112
+ ? '---'
113
+ : transaction.fiatAmount(symbol);
114
+
115
+ return TransactionRow(
116
+ onTap: () => Navigator.of(context).pushNamed(
117
+ Routes.transactionDetails,
118
+ arguments: transaction),
119
+ direction: transaction.direction,
120
+ formattedDate:
121
+ transactionDateFormat.format(transaction.date),
122
+ formattedAmount: formattedAmount,
123
+ formattedFiatAmount: formattedFiatAmount,
124
+ isPending: transaction.isPending);
125
+ }
126
+
127
+ if (item is TradeListItem) {
128
+ freeSpaceHeight -= 45; // FIXME
129
+ final trade = item.trade;
130
+ final savedDisplayMode = settingsStore.balanceDisplayMode;
131
+ final formattedAmount = trade.amount != null
132
+ ? savedDisplayMode == BalanceDisplayMode.hiddenBalance
133
+ ? '---'
134
+ : trade.amountFormatted()
135
+ : trade.amount;
136
+
137
+ return TradeRow(
138
+ onTap: () => Navigator.of(context)
139
+ .pushNamed(Routes.tradeDetails, arguments: trade),
140
+ provider: trade.provider,
141
+ from: trade.from,
142
+ to: trade.to,
143
+ createdAtFormattedDate:
144
+ transactionDateFormat.format(trade.createdAt),
145
+ formattedAmount: formattedAmount);
146
+ }
147
+
148
+ return Container(
149
+ color: PaletteDark.historyPanel
150
+ );
151
+ },
152
+
153
+ childCount: itemsCount
154
+ )
155
);
156
})
172
- ],
157
+ ],
158
+ )
159
+ ),
160
+ );
161
+ }
162
+}
163
+
164
+class ButtonHeader extends SliverPersistentHeaderDelegate {
165
+ final sendImage = Image.asset('assets/images/send.png');
166
+ final exchangeImage = Image.asset('assets/images/exchange.png');
167
+ final buyImage = Image.asset('assets/images/coins.png');
168
+ final filterButton = Image.asset('assets/images/filter_button.png');
169
+
170
+ @override
171
+ Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
172
+ final actionListStore = Provider.of<ActionListStore>(context);
173
+ final historyPanelWidth = MediaQuery.of(context).size.width;
174
+
175
+ double buttonsOpacity = 1 - shrinkOffset / (maxExtent - minExtent);
176
+ double buttonsHeight = maxExtent - minExtent - shrinkOffset;
177
+
178
+ buttonsOpacity = buttonsOpacity >= 0 ? buttonsOpacity : 0;
179
+ buttonsHeight = buttonsHeight >= 0 ? buttonsHeight : 0;
180
+
181
+ return Stack(
182
+ fit: StackFit.expand,
183
+ overflow: Overflow.visible,
184
+ children: <Widget>[
185
+ Opacity(
186
+ opacity: buttonsOpacity,
187
+ child: Container(
188
+ height: buttonsHeight,
189
+ padding: EdgeInsets.only(left: 44, right: 44),
190
+ child: Row(
191
+ children: <Widget>[
192
+ Flexible(
193
+ child: actionButton(
194
+ context: context,
195
+ image: sendImage,
196
+ title: S.of(context).send,
197
+ route: Routes.send
198
+ )
199
+ ),
200
+ Flexible(
201
+ child: actionButton(
202
+ context: context,
203
+ image: exchangeImage,
204
+ title: S.of(context).exchange,
205
+ route: Routes.exchange
206
+ )
207
+ ),
208
+ Flexible(
209
+ child: actionButton(
210
+ context: context,
211
+ image: buyImage,
212
+ title: S.of(context).buy,
213
+ route: ''
214
+ )
215
+ )
216
+ ],
217
+ ),
218
),
219
+ ),
220
+ Positioned(
221
+ top: buttonsHeight,
222
+ left: 0,
223
+ child: Container(
224
+ width: historyPanelWidth,
225
+ height: 66,
226
+ padding: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 10),
227
+ decoration: BoxDecoration(
228
+ borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)),
229
+ color: PaletteDark.historyPanel,
230
+ ),
231
+ child: Stack(
232
+ alignment: Alignment.center,
233
+ children: <Widget>[
234
+ Text(
235
+ S.of(context).trade_history_title,
236
+ style: TextStyle(
237
+ fontSize: 20,
238
+ color: Colors.white
239
+ ),
240
+ ),
241
+ Positioned(
242
+ right: 0,
243
+ child: PopupMenuButton<int>(
244
+ itemBuilder: (context) => [
245
+ PopupMenuItem(
246
+ enabled: false,
247
+ value: -1,
248
+ child: Text(S.of(context).transactions,
249
+ style: TextStyle(
250
+ fontWeight: FontWeight.bold,
251
+ color: Theme.of(context).primaryTextTheme.caption.color))),
252
+ PopupMenuItem(
253
+ value: 0,
254
+ child: Observer(
255
+ builder: (_) => Row(
256
+ mainAxisAlignment:
257
+ MainAxisAlignment
258
+ .spaceBetween,
259
+ children: [
260
+ Text(S.of(context).incoming),
261
+ Checkbox(
262
+ value: actionListStore
263
+ .transactionFilterStore
264
+ .displayIncoming,
265
+ onChanged: (value) =>
266
+ actionListStore
267
+ .transactionFilterStore
268
+ .toggleIncoming(),
269
+ )
270
+ ]))),
271
+ PopupMenuItem(
272
+ value: 1,
273
+ child: Observer(
274
+ builder: (_) => Row(
275
+ mainAxisAlignment:
276
+ MainAxisAlignment
277
+ .spaceBetween,
278
+ children: [
279
+ Text(S.of(context).outgoing),
280
+ Checkbox(
281
+ value: actionListStore
282
+ .transactionFilterStore
283
+ .displayOutgoing,
284
+ onChanged: (value) =>
285
+ actionListStore
286
+ .transactionFilterStore
287
+ .toggleOutgoing(),
288
+ )
289
+ ]))),
290
+ PopupMenuItem(
291
+ value: 2,
292
+ child:
293
+ Text(S.of(context).transactions_by_date)),
294
+ PopupMenuDivider(),
295
+ PopupMenuItem(
296
+ enabled: false,
297
+ value: -1,
298
+ child: Text(S.of(context).trades,
299
+ style: TextStyle(
300
+ fontWeight: FontWeight.bold,
301
+ color: Theme.of(context).primaryTextTheme.caption.color))),
302
+ PopupMenuItem(
303
+ value: 3,
304
+ child: Observer(
305
+ builder: (_) => Row(
306
+ mainAxisAlignment:
307
+ MainAxisAlignment
308
+ .spaceBetween,
309
+ children: [
310
+ Text('XMR.TO'),
311
+ Checkbox(
312
+ value: actionListStore
313
+ .tradeFilterStore
314
+ .displayXMRTO,
315
+ onChanged: (value) =>
316
+ actionListStore
317
+ .tradeFilterStore
318
+ .toggleDisplayExchange(
319
+ ExchangeProviderDescription
320
+ .xmrto),
321
+ )
322
+ ]))),
323
+ PopupMenuItem(
324
+ value: 4,
325
+ child: Observer(
326
+ builder: (_) => Row(
327
+ mainAxisAlignment:
328
+ MainAxisAlignment
329
+ .spaceBetween,
330
+ children: [
331
+ Text('Change.NOW'),
332
+ Checkbox(
333
+ value: actionListStore
334
+ .tradeFilterStore
335
+ .displayChangeNow,
336
+ onChanged: (value) =>
337
+ actionListStore
338
+ .tradeFilterStore
339
+ .toggleDisplayExchange(
340
+ ExchangeProviderDescription
341
+ .changeNow),
342
+ )
343
+ ]))),
344
+ PopupMenuItem(
345
+ value: 5,
346
+ child: Observer(
347
+ builder: (_) => Row(
348
+ mainAxisAlignment:
349
+ MainAxisAlignment
350
+ .spaceBetween,
351
+ children: [
352
+ Text('MorphToken'),
353
+ Checkbox(
354
+ value: actionListStore
355
+ .tradeFilterStore
356
+ .displayMorphToken,
357
+ onChanged: (value) =>
358
+ actionListStore
359
+ .tradeFilterStore
360
+ .toggleDisplayExchange(
361
+ ExchangeProviderDescription
362
+ .morphToken),
363
+ )
364
+ ])))
365
+ ],
366
+ child: filterButton,
367
+ onSelected: (item) async {
368
+ if (item == 2) {
369
+ final List<DateTime> picked =
370
+ await date_rage_picker.showDatePicker(
371
+ context: context,
372
+ initialFirstDate: DateTime.now()
373
+ .subtract(Duration(days: 1)),
374
+ initialLastDate: (DateTime.now()),
375
+ firstDate: DateTime(2015),
376
+ lastDate: DateTime.now()
377
+ .add(Duration(days: 1)));
378
+
379
+ if (picked != null && picked.length == 2) {
380
+ actionListStore.transactionFilterStore
381
+ .changeStartDate(picked.first);
382
+ actionListStore.transactionFilterStore
383
+ .changeEndDate(picked.last);
384
+ }
385
+ }
386
+ },
387
+ ),
388
+ )
389
+ ],
390
+ ),
391
+ )
392
)
175
- : Offstage()
393
+ ],
394
+ );
395
+ }
396
+
397
+ @override
398
+ double get maxExtent => 174;
399
+
400
+ @override
401
+ double get minExtent => 66;
402
+
403
+ @override
404
+ bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) => true;
405
+
406
+ Widget actionButton({
407
+ BuildContext context,
408
+ @required Image image,
409
+ @required String title,
410
+ @required String route}) {
411
+
412
+ return Container(
413
+ width: MediaQuery.of(context).size.width,
414
+ child: Column(
415
+ mainAxisAlignment: MainAxisAlignment.start,
416
+ crossAxisAlignment: CrossAxisAlignment.center,
417
+ children: <Widget>[
418
+ GestureDetector(
419
+ onTap: () {
420
+ if (route.isNotEmpty) {
421
+ Navigator.of(context, rootNavigator: true).pushNamed(route);
422
+ }
423
+ },
424
+ child: Container(
425
+ height: 48,
426
+ width: 48,
427
+ alignment: Alignment.center,
428
+ decoration: BoxDecoration(
429
+ color: Colors.white,
430
+ shape: BoxShape.circle
431
+ ),
432
+ child: image,
433
+ ),
434
+ ),
435
+ Padding(
436
+ padding: EdgeInsets.only(top: 10),
437
+ child: Text(
438
+ title,
439
+ style: TextStyle(
440
+ fontSize: 16,
441
+ color: PaletteDark.walletCardText
442
+ ),
443
+ ),
444
+ )
445
+ ],
446
),
447
);
448
}
lib/src/screens/dashboard/widgets/trade_row.dart
+6
-2
@@ -26,7 +26,8 @@ class TradeRow extends StatelessWidget {
26
return InkWell(
27
onTap: onTap,
28
child: Container(
29
- padding: EdgeInsets.only(top: 5, bottom: 5),
29
+ color: PaletteDark.historyPanel,
30
+ padding: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20),
31
child: Row(children: <Widget>[
32
Container(
33
height: 36,
@@ -48,11 +49,14 @@ class TradeRow extends StatelessWidget {
49
Text('${from.toString()} → ${to.toString()}',
50
style: TextStyle(
51
fontSize: 16,
52
+ color: Colors.white
53
)),
54
formattedAmount != null
55
? Text(formattedAmount + ' ' + amountCrypto,
56
style: const TextStyle(
55
- fontSize: 16))
57
+ fontSize: 16,
58
+ color: Colors.white
59
+ ))
60
: Container()
61
]),
62
SizedBox(height: 5),
lib/src/screens/dashboard/widgets/transaction_raw.dart
+6
-2
@@ -24,7 +24,8 @@ class TransactionRow extends StatelessWidget {
24
return InkWell(
25
onTap: onTap,
26
child: Container(
27
- padding: EdgeInsets.only(top: 5, bottom: 5),
27
+ color: PaletteDark.historyPanel,
28
+ padding: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20),
29
child: Row(children: <Widget>[
30
Container(
31
height: 36,
@@ -54,12 +55,15 @@ class TransactionRow extends StatelessWidget {
55
(isPending ? S.of(context).pending : ''),
56
style: TextStyle(
57
fontSize: 16,
58
+ color: Colors.white
59
)),
60
Text(direction == TransactionDirection.incoming
61
? formattedAmount
62
: '- ' + formattedAmount,
63
style: const TextStyle(
62
- fontSize: 16))
64
+ fontSize: 16,
65
+ color: Colors.white
66
+ ))
67
]),
68
SizedBox(height: 5,),
69
Row(
lib/src/screens/dashboard/widgets/wallet_card.dart
+25
-11
@@ -159,7 +159,8 @@ class WalletCardState extends State<WalletCard> {
159
walletStore.name,
160
style: TextStyle(
161
fontSize: 20,
162
- fontWeight: FontWeight.bold
162
+ fontWeight: FontWeight.bold,
163
+ color: Colors.white
164
),
165
),
166
SizedBox(width: 10),
@@ -243,7 +244,8 @@ class WalletCardState extends State<WalletCard> {
244
Text(
245
balance,
246
style: TextStyle(
246
- fontSize: 28
247
+ fontSize: 28,
248
+ color: Colors.white
249
),
250
)
251
],
@@ -251,7 +253,8 @@ class WalletCardState extends State<WalletCard> {
253
Text(
254
fiatBalance,
255
style: TextStyle(
254
- fontSize: 14
256
+ fontSize: 14,
257
+ color: Colors.white
258
),
259
)
260
],
@@ -276,7 +279,8 @@ class WalletCardState extends State<WalletCard> {
279
Text(
280
descriptionText,
281
style: TextStyle(
279
- fontSize: 14
282
+ fontSize: 14,
283
+ color: Colors.white
284
),
285
)
286
],
@@ -299,6 +303,7 @@ class WalletCardState extends State<WalletCard> {
303
final walletStore = Provider.of<WalletStore>(context);
304
final rightArrow = Image.asset('assets/images/right_arrow.png');
305
double messageBoxHeight = 0;
306
+ double messageBoxWidth = cardWidth - 30;
307
308
return Observer(
309
key: _addressObserverKey,
@@ -308,6 +313,7 @@ class WalletCardState extends State<WalletCard> {
313
height: cardHeight,
314
alignment: Alignment.topCenter,
315
child: Stack(
316
+ alignment: Alignment.topRight,
317
children: <Widget>[
318
Container(
319
width: cardWidth,
@@ -328,7 +334,7 @@ class WalletCardState extends State<WalletCard> {
334
children: <Widget>[
335
Expanded(
336
child: Container(
331
- height: 72,
337
+ height: 84,
338
child: Column(
339
mainAxisAlignment: MainAxisAlignment.spaceBetween,
340
crossAxisAlignment: CrossAxisAlignment.start,
@@ -344,10 +350,16 @@ class WalletCardState extends State<WalletCard> {
350
onTap: () {
351
Clipboard.setData(ClipboardData(
352
text: walletStore.subaddress.address));
347
- _addressObserverKey.currentState.setState(() => messageBoxHeight = 20);
353
+ _addressObserverKey.currentState.setState(() {
354
+ messageBoxHeight = 20;
355
+ messageBoxWidth = cardWidth;
356
+ });
357
Timer(Duration(milliseconds: 1000), () {
358
try {
350
- _addressObserverKey.currentState.setState(() => messageBoxHeight = 0);
359
+ _addressObserverKey.currentState.setState(() {
360
+ messageBoxHeight = 0;
361
+ messageBoxWidth = cardWidth - 30;
362
+ });
363
} catch(e) {
364
print('${e.toString()}');
365
}
@@ -357,6 +369,7 @@ class WalletCardState extends State<WalletCard> {
369
walletStore.subaddress.address,
370
style: TextStyle(
371
fontSize: 14,
372
+ color: Colors.white
373
),
374
),
375
)
@@ -364,10 +377,10 @@ class WalletCardState extends State<WalletCard> {
377
),
378
)
379
),
367
- SizedBox(width: 20),
380
+ SizedBox(width: 10),
381
Container(
369
- width: 72,
370
- height: 72,
382
+ width: 84,
383
+ height: 84,
384
child: QrImage(
385
data: walletStore.subaddress.address,
386
backgroundColor: Colors.transparent,
@@ -393,6 +406,7 @@ class WalletCardState extends State<WalletCard> {
406
S.current.subaddresses,
407
style: TextStyle(
408
fontSize: 14,
409
+ color: Colors.white
410
),
411
),
412
rightArrow
@@ -404,7 +418,7 @@ class WalletCardState extends State<WalletCard> {
418
),
419
),
420
AnimatedContainer(
407
- width: cardWidth,
421
+ width: messageBoxWidth,
422
height: messageBoxHeight,
423
alignment: Alignment.center,
424
duration: Duration(milliseconds: 500),
res/values/strings_de.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR-Empfänger erkannt",
352
"openalias_alert_content" : "Sie senden Geld an\n${recipient_name}",
353
354
- "card_address" : "Adresse:"
354
+ "card_address" : "Adresse:",
355
+ "buy" : "Kaufen"
356
}
\ No newline at end of file
res/values/strings_en.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR Recipient Detected",
352
"openalias_alert_content" : "You will be sending funds to\n${recipient_name}",
353
354
- "card_address" : "Address:"
354
+ "card_address" : "Address:",
355
+ "buy" : "Buy"
356
}
\ No newline at end of file
res/values/strings_es.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "Destinatario XMR detectado",
352
"openalias_alert_content" : "Enviará fondos a\n${recipient_name}",
353
354
- "card_address" : "Dirección:"
354
+ "card_address" : "Dirección:",
355
+ "buy" : "Comprar"
356
}
\ No newline at end of file
res/values/strings_hi.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR प्राप्तकर्ता का पता लगाया",
352
"openalias_alert_content" : "आपको धनराशि भेजी जाएगी\n${recipient_name}",
353
354
- "card_address" : "पता:"
354
+ "card_address" : "पता:",
355
+ "buy" : "खरीदें"
356
}
\ No newline at end of file
res/values/strings_ja.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR受信者が検出されました",
352
"openalias_alert_content" : "に送金します\n${recipient_name}",
353
354
- "card_address" : "住所:"
354
+ "card_address" : "住所:",
355
+ "buy" : "購入"
356
}
\ No newline at end of file
res/values/strings_ko.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR 수신자 감지",
352
"openalias_alert_content" : "당신은에 자금을 보낼 것입니다\n${recipient_name}",
353
354
- "card_address" : "주소:"
354
+ "card_address" : "주소:",
355
+ "buy" : "구입"
356
}
\ No newline at end of file
res/values/strings_nl.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "XMR-ontvanger gedetecteerd",
352
"openalias_alert_content" : "U stuurt geld naar\n${recipient_name}",
353
354
- "card_address" : "Adres:"
354
+ "card_address" : "Adres:",
355
+ "buy" : "Kopen"
356
}
\ No newline at end of file
res/values/strings_pl.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "Wykryto odbiorcę XMR",
352
"openalias_alert_content" : "Będziesz wysyłać środki na\n${recipient_name}",
353
354
- "card_address" : "Adres:"
354
+ "card_address" : "Adres:",
355
+ "buy" : "Kup"
356
}
\ No newline at end of file
res/values/strings_pt.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "Destinatário XMR detectado",
352
"openalias_alert_content" : "Você enviará fundos para\n${recipient_name}",
353
354
- "card_address" : "Endereço:"
354
+ "card_address" : "Endereço:",
355
+ "buy" : "Comprar"
356
}
res/values/strings_ru.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "Получатель XMR обнаружен",
352
"openalias_alert_content" : "Вы будете отправлять средства\n${recipient_name}",
353
354
- "card_address" : "Адрес:"
354
+ "card_address" : "Адрес:",
355
+ "buy" : "Купить"
356
}
\ No newline at end of file
res/values/strings_uk.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "Отримувача XMR виявлено",
352
"openalias_alert_content" : "Ви будете відправляти кошти\n${recipient_name}",
353
354
- "card_address" : "Адреса:"
354
+ "card_address" : "Адреса:",
355
+ "buy" : "Купити"
356
}
\ No newline at end of file
res/values/strings_zh.arb
+2
-1
@@ -351,5 +351,6 @@
351
"openalias_alert_title" : "檢測到XMR收件人",
352
"openalias_alert_content" : "您將匯款至\n${recipient_name}",
353
354
- "card_address" : "地址:"
354
+ "card_address" : "地址:",
355
+ "buy" : "購買"
356
}
\ No newline at end of file