CWA-212 | applied new design to exchange_confirm_page and exchange_trade_page; added provider icons to exchange_template_page; added new alert dialogs to exchange_page and exchange_trade_page
Oleksandr Sobol committed
May 15, 2020 at 20:38 UTC
5304931ad9016d4804863380d0754523871426a7
18 files changed
+417
-391
lib/generated/i18n.dart
+23
-23
@@ -237,6 +237,7 @@ class S implements WidgetsLocalizations {
237
String get trade_details_state => "State";
238
String get trade_details_title => "Trade Details";
239
String get trade_history_title => "Trade history";
240
+ String get trade_id => "Trade ID:";
241
String get trade_not_created => "Trade not created.";
242
String get trade_not_found => "Trade not found.";
243
String get trade_state_btc_sent => "Btc sent";
@@ -313,7 +314,6 @@ class S implements WidgetsLocalizations {
314
String time(String minutes, String seconds) => "${minutes}m ${seconds}s";
315
String trade_details_copied(String title) => "${title} copied to Clipboard";
316
String trade_for_not_created(String title) => "Trade for ${title} is not created.";
316
- String trade_id(String id) => "Trade ID:\n${id}";
317
String trade_id_not_found(String tradeId, String title) => "Trade ${tradeId} of ${title} not found.";
318
String trade_is_powered_by(String provider) => "This trade is powered by ${provider}";
319
String transaction_details_copied(String title) => "${title} copied to Clipboard";
@@ -357,6 +357,8 @@ class $de extends S {
357
@override
358
String get you_will_get => "Sie erhalten";
359
@override
360
+ String get trade_id => "Handel-ID:";
361
+ @override
362
String get restore_description_from_seed => "Stellen Sie Ihr Wallet aus den 25 Wörtern wieder her oder 13-Wort-Kombinationscode";
363
@override
364
String get trade_state_underpaid => "Unterbezahlt";
@@ -879,8 +881,6 @@ class $de extends S {
881
@override
882
String change_current_node(String node) => "Möchten Sie den aktuellen Knoten wirklich auf ändern? ${node}?";
883
@override
882
- String trade_id(String id) => "Handel-ID:\n${id}";
883
- @override
884
String wallet_list_loading_wallet(String wallet_name) => "Wird geladen ${wallet_name} Wallet";
885
@override
886
String version(String currentVersion) => "Ausführung ${currentVersion}";
@@ -967,6 +967,8 @@ class $hi extends S {
967
@override
968
String get you_will_get => "आपको मिल जायेगा";
969
@override
970
+ String get trade_id => "व्यापार ID:";
971
+ @override
972
String get restore_description_from_seed => "या तो 25 शब्द से अपने वॉलेट को पुनर्स्थापित करें या 13 शब्द संयोजन कोड";
973
@override
974
String get trade_state_underpaid => "के तहत भुगतान किया";
@@ -1489,8 +1491,6 @@ class $hi extends S {
1491
@override
1492
String change_current_node(String node) => "क्या आप वर्तमान नोड को बदलना सुनिश्चित करते हैं ${node}?";
1493
@override
1492
- String trade_id(String id) => "व्यापार ID:\n${id}";
1493
- @override
1494
String wallet_list_loading_wallet(String wallet_name) => "लोड हो रहा है ${wallet_name} बटुआ";
1495
@override
1496
String version(String currentVersion) => "संस्करण ${currentVersion}";
@@ -1577,6 +1577,8 @@ class $ru extends S {
1577
@override
1578
String get you_will_get => "Вы получите";
1579
@override
1580
+ String get trade_id => "ID сделки:";
1581
+ @override
1582
String get restore_description_from_seed => "Вы можете восстановить кошелёк используя 25-ти значную мнемоническую фразу";
1583
@override
1584
String get trade_state_underpaid => "Недоплаченная";
@@ -2099,8 +2101,6 @@ class $ru extends S {
2101
@override
2102
String change_current_node(String node) => "Вы уверены, что хотите изменить текущую ноду на ${node}?";
2103
@override
2102
- String trade_id(String id) => "ID сделки:\n${id}";
2103
- @override
2104
String wallet_list_loading_wallet(String wallet_name) => "Загрузка ${wallet_name} кошелька";
2105
@override
2106
String version(String currentVersion) => "Версия ${currentVersion}";
@@ -2187,6 +2187,8 @@ class $ko extends S {
2187
@override
2188
String get you_will_get => "당신은 얻을 것이다";
2189
@override
2190
+ String get trade_id => "무역 ID:";
2191
+ @override
2192
String get restore_description_from_seed => "25 단어 또는 13 단어 조합 코드에서 지갑을 복원하십시오.";
2193
@override
2194
String get trade_state_underpaid => "미지급";
@@ -2709,8 +2711,6 @@ class $ko extends S {
2711
@override
2712
String change_current_node(String node) => "현재 노드를 다음으로 변경 하시겠습니까 ${node}?";
2713
@override
2712
- String trade_id(String id) => "무역 ID:\n${id}";
2713
- @override
2714
String wallet_list_loading_wallet(String wallet_name) => "로딩 ${wallet_name} 지갑";
2715
@override
2716
String version(String currentVersion) => "버전 ${currentVersion}";
@@ -2797,6 +2797,8 @@ class $pt extends S {
2797
@override
2798
String get you_will_get => "Você receberá";
2799
@override
2800
+ String get trade_id => "ID da troca:";
2801
+ @override
2802
String get restore_description_from_seed => "Restaure sua carteira a partir de semente com 25 palavras ou 13 palavras";
2803
@override
2804
String get trade_state_underpaid => "Parcialmente paga";
@@ -3319,8 +3321,6 @@ class $pt extends S {
3321
@override
3322
String change_current_node(String node) => "Você realmente deseja alterar o nó atual para ${node}?";
3323
@override
3322
- String trade_id(String id) => "ID da troca:\n${id}";
3323
- @override
3324
String wallet_list_loading_wallet(String wallet_name) => "Abrindo a carteira ${wallet_name}";
3325
@override
3326
String version(String currentVersion) => "Versão ${currentVersion}";
@@ -3407,6 +3407,8 @@ class $uk extends S {
3407
@override
3408
String get you_will_get => "Ви отримаєте";
3409
@override
3410
+ String get trade_id => "ID операції:";
3411
+ @override
3412
String get restore_description_from_seed => "Ви можете відновити гаманець використовуючи 25-ти слівну мнемонічну фразу";
3413
@override
3414
String get trade_state_underpaid => "Недоплачена";
@@ -3929,8 +3931,6 @@ class $uk extends S {
3931
@override
3932
String change_current_node(String node) => "Ви впевнені, що хочете змінити поточний вузол на ${node}?";
3933
@override
3932
- String trade_id(String id) => "ID операції:\n${id}";
3933
- @override
3934
String wallet_list_loading_wallet(String wallet_name) => "Завантаження ${wallet_name} гаманця";
3935
@override
3936
String version(String currentVersion) => "Версія ${currentVersion}";
@@ -4017,6 +4017,8 @@ class $ja extends S {
4017
@override
4018
String get you_will_get => "あなたが取得します";
4019
@override
4020
+ String get trade_id => "取引ID:";
4021
+ @override
4022
String get restore_description_from_seed => "25ワードからウォレットを復元しますまたは13ワードの組み合わせコード";
4023
@override
4024
String get trade_state_underpaid => "支払不足";
@@ -4539,8 +4541,6 @@ class $ja extends S {
4541
@override
4542
String change_current_node(String node) => "現在のノードを変更してよろしいですか ${node}?";
4543
@override
4542
- String trade_id(String id) => "取引ID:\n${id}";
4543
- @override
4544
String wallet_list_loading_wallet(String wallet_name) => "読み込み中 ${wallet_name} 財布";
4545
@override
4546
String version(String currentVersion) => "バージョン ${currentVersion}";
@@ -4631,6 +4631,8 @@ class $pl extends S {
4631
@override
4632
String get you_will_get => "Dostaniesz";
4633
@override
4634
+ String get trade_id => "Identyfikator handlu:";
4635
+ @override
4636
String get restore_description_from_seed => "Przywróć swój portfel z 25 słów lub 13-słowny kod kombinacji";
4637
@override
4638
String get trade_state_underpaid => "Niedopłacone";
@@ -5153,8 +5155,6 @@ class $pl extends S {
5155
@override
5156
String change_current_node(String node) => "Czy na pewno chcesz przywrócić ustawienia domyślne? ${node}?";
5157
@override
5156
- String trade_id(String id) => "Identyfikator handlu:\n${id}";
5157
- @override
5158
String wallet_list_loading_wallet(String wallet_name) => "Ładuję ${wallet_name} portfel";
5159
@override
5160
String version(String currentVersion) => "Wersja ${currentVersion}";
@@ -5241,6 +5241,8 @@ class $es extends S {
5241
@override
5242
String get you_will_get => "Conseguirás";
5243
@override
5244
+ String get trade_id => "Comercial ID:";
5245
+ @override
5246
String get restore_description_from_seed => "Restaure su billetera desde el código de combinación de 25 palabras i de 13 palabras";
5247
@override
5248
String get trade_state_underpaid => "Poco pagado";
@@ -5763,8 +5765,6 @@ class $es extends S {
5765
@override
5766
String change_current_node(String node) => "¿Está seguro de cambiar el nodo actual a ${node}?";
5767
@override
5766
- String trade_id(String id) => "Comercial ID:\n${id}";
5767
- @override
5768
String wallet_list_loading_wallet(String wallet_name) => "Billetera ${wallet_name} de carga";
5769
@override
5770
String version(String currentVersion) => "Versión ${currentVersion}";
@@ -5851,6 +5851,8 @@ class $nl extends S {
5851
@override
5852
String get you_will_get => "Je zult krijgen";
5853
@override
5854
+ String get trade_id => "Trade ID:";
5855
+ @override
5856
String get restore_description_from_seed => "Herstel uw portemonnee van het 25 woord of 13 woord combinatiecode";
5857
@override
5858
String get trade_state_underpaid => "Slecht betaald";
@@ -6373,8 +6375,6 @@ class $nl extends S {
6375
@override
6376
String change_current_node(String node) => "Weet u zeker dat u het huidige knooppunt wilt wijzigen in ${node}?";
6377
@override
6376
- String trade_id(String id) => "Trade ID:\n${id}";
6377
- @override
6378
String wallet_list_loading_wallet(String wallet_name) => "Bezig met laden ${wallet_name} portemonnee";
6379
@override
6380
String version(String currentVersion) => "Versie ${currentVersion}";
@@ -6461,6 +6461,8 @@ class $zh extends S {
6461
@override
6462
String get you_will_get => "你会得到";
6463
@override
6464
+ String get trade_id => "贸易编号:";
6465
+ @override
6466
String get restore_description_from_seed => "从25个字中恢复您的钱包或13个字的组合码";
6467
@override
6468
String get trade_state_underpaid => "支付不足";
@@ -6983,8 +6985,6 @@ class $zh extends S {
6985
@override
6986
String change_current_node(String node) => "您确定将当前节点更改为 ${node}?";
6987
@override
6986
- String trade_id(String id) => "贸易编号:\n${id}";
6987
- @override
6988
String wallet_list_loading_wallet(String wallet_name) => "载入中 ${wallet_name} 钱包";
6989
@override
6990
String version(String currentVersion) => "版 ${currentVersion}";
lib/src/screens/exchange/exchange_page.dart
+6
-8
@@ -25,6 +25,7 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
25
import 'package:cake_wallet/src/widgets/top_panel.dart';
26
import 'package:cake_wallet/src/screens/exchange/widgets/provider_picker.dart';
27
import 'package:cake_wallet/src/stores/exchange_template/exchange_template_store.dart';
28
+import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
29
30
class ExchangePage extends BasePage {
31
@override
@@ -482,14 +483,11 @@ class ExchangeFormState extends State<ExchangeForm> {
483
showDialog<void>(
484
context: context,
485
builder: (BuildContext context) {
485
- return AlertDialog(
486
- title: Text(S.of(context).error),
487
- content: Text(state.error),
488
- actions: <Widget>[
489
- FlatButton(
490
- child: Text(S.of(context).ok),
491
- onPressed: () => Navigator.of(context).pop())
492
- ],
486
+ return AlertWithOneAction(
487
+ alertTitle: S.of(context).error,
488
+ alertContent: state.error,
489
+ buttonText: S.of(context).ok,
490
+ buttonAction: () => Navigator.of(context).pop()
491
);
492
});
493
});
lib/src/screens/exchange/exchange_template_page.dart
+17
@@ -1,4 +1,5 @@
1
import 'dart:ui';
2
+import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
3
import 'package:flutter/cupertino.dart';
4
import 'package:flutter/material.dart';
5
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -75,10 +76,26 @@ class ExchangeTemplatePage extends BasePage {
76
final exchangeStore = Provider.of<ExchangeStore>(context);
77
final items = exchangeStore.providersForCurrentPair();
78
final selectedItem = items.indexOf(exchangeStore.provider);
79
+ final images = List<Image>();
80
+
81
+ for (ExchangeProvider provider in items) {
82
+ switch (provider.description) {
83
+ case ExchangeProviderDescription.xmrto:
84
+ images.add(Image.asset('assets/images/xmr_btc.png'));
85
+ break;
86
+ case ExchangeProviderDescription.changeNow:
87
+ images.add(Image.asset('assets/images/change_now.png'));
88
+ break;
89
+ case ExchangeProviderDescription.morphToken:
90
+ images.add(Image.asset('assets/images/morph_icon.png'));
91
+ break;
92
+ }
93
+ }
94
95
showDialog<void>(
96
builder: (_) => ProviderPicker(
97
items: items,
98
+ images: images,
99
selectedAtIndex: selectedItem,
100
title: S.of(context).change_exchange_provider,
101
onItemSelected: (ExchangeProvider provider) =>
lib/src/screens/exchange_trade/exchange_confirm_page.dart
+77
-54
@@ -6,54 +6,56 @@ import 'package:cake_wallet/generated/i18n.dart';
6
import 'package:cake_wallet/src/widgets/primary_button.dart';
7
import 'package:cake_wallet/src/screens/base_page.dart';
8
import 'package:cake_wallet/src/domain/exchange/trade.dart';
9
+import 'package:cake_wallet/palette.dart';
10
11
class ExchangeConfirmPage extends BasePage {
12
ExchangeConfirmPage({@required this.trade});
13
14
final Trade trade;
15
+ final copyImage = Image.asset('assets/images/copy_content.png', color: Colors.white);
16
17
@override
18
String get title => S.current.copy_id;
19
20
+ @override
21
+ Color get backgroundColor => PaletteDark.historyPanel;
22
+
23
@override
24
Widget body(BuildContext context) {
20
- return Column(
21
- children: <Widget>[
22
- Expanded(
23
- child: Container(
24
- padding: EdgeInsets.only(left: 80.0, right: 80.0),
25
- child: Center(
26
- child: Column(
27
- mainAxisSize: MainAxisSize.min,
28
- children: <Widget>[
29
- Text(
30
- S.of(context).exchange_result_write_down_trade_id,
31
- textAlign: TextAlign.center,
32
- style: TextStyle(
33
- fontSize: 18.0,
34
- color: Theme.of(context)
35
- .primaryTextTheme
36
- .button
37
- .color),
38
- ),
39
- SizedBox(
40
- height: 70.0,
41
- ),
42
- Text(
43
- S.of(context).trade_id(trade.id),
25
+ return Container(
26
+ color: PaletteDark.historyPanel,
27
+ padding: EdgeInsets.all(24),
28
+ child: Column(
29
+ children: <Widget>[
30
+ Expanded(
31
+ child: Center(
32
+ child: Column(
33
+ mainAxisSize: MainAxisSize.min,
34
+ children: <Widget>[
35
+ Text(
36
+ S.of(context).exchange_result_write_down_trade_id,
37
+ textAlign: TextAlign.center,
38
+ style: TextStyle(
39
+ fontSize: 18.0,
40
+ fontWeight: FontWeight.w600,
41
+ color: Colors.white),
42
+ ),
43
+ Padding(
44
+ padding: EdgeInsets.only(top: 60),
45
+ child: Text(
46
+ S.of(context).trade_id,
47
textAlign: TextAlign.center,
48
style: TextStyle(
46
- fontSize: 18.0,
47
- color: Theme.of(context)
48
- .primaryTextTheme
49
- .button
50
- .color),
49
+ fontSize: 16.0,
50
+ fontWeight: FontWeight.w600,
51
+ color: Colors.white),
52
),
52
- SizedBox(
53
- height: 70.0,
54
- ),
55
- PrimaryButton(
56
- onPressed: () {
53
+ ),
54
+ Padding(
55
+ padding: EdgeInsets.only(top: 24),
56
+ child: Builder(
57
+ builder: (context) => GestureDetector(
58
+ onTap: () {
59
Clipboard.setData(ClipboardData(text: trade.id));
60
Scaffold.of(context).showSnackBar(SnackBar(
61
content: Text(
@@ -62,31 +64,52 @@ class ExchangeConfirmPage extends BasePage {
64
style: TextStyle(color: Colors.white),
65
),
66
backgroundColor: Colors.green,
67
+ duration: Duration(milliseconds: 1500),
68
));
69
},
67
- text: S.of(context).copy_id,
68
- color: Theme.of(context)
69
- .accentTextTheme
70
- .caption
71
- .backgroundColor,
72
- textColor: Theme.of(context)
73
- .primaryTextTheme
74
- .button
75
- .color)
76
- ],
77
- ),
78
- ))),
79
- Container(
80
- padding: EdgeInsets.only(left: 20.0, right: 20.0, bottom: 40.0),
81
- child: PrimaryButton(
70
+ child: Container(
71
+ height: 60,
72
+ padding: EdgeInsets.only(left: 24, right: 24),
73
+ decoration: BoxDecoration(
74
+ borderRadius: BorderRadius.all(Radius.circular(30)),
75
+ color: PaletteDark.menuList
76
+ ),
77
+ child: Row(
78
+ mainAxisSize: MainAxisSize.max,
79
+ children: <Widget>[
80
+ Expanded(
81
+ child: Text(
82
+ trade.id,
83
+ maxLines: 1,
84
+ overflow: TextOverflow.ellipsis,
85
+ style: TextStyle(
86
+ fontSize: 18,
87
+ fontWeight: FontWeight.w600,
88
+ color: Colors.white
89
+ ),
90
+ ),
91
+ ),
92
+ Padding(
93
+ padding: EdgeInsets.only(left: 12),
94
+ child: copyImage,
95
+ )
96
+ ],
97
+ ),
98
+ ),
99
+ )
100
+ ),
101
+ )
102
+ ],
103
+ ),
104
+ )),
105
+ PrimaryButton(
106
onPressed: () => Navigator.of(context)
107
.pushReplacementNamed(Routes.exchangeTrade, arguments: trade),
108
text: S.of(context).saved_the_trade_id,
85
- color: Theme.of(context).primaryTextTheme.button.backgroundColor,
86
- textColor:
87
- Theme.of(context).primaryTextTheme.button.color),
88
- )
89
- ],
109
+ color: Colors.green,
110
+ textColor: Colors.white)
111
+ ],
112
+ ),
113
);
114
}
115
}
lib/src/screens/exchange_trade/exchange_trade_page.dart
+281
-293
@@ -12,17 +12,21 @@ import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart'
12
import 'package:cake_wallet/src/stores/send/send_store.dart';
13
import 'package:cake_wallet/src/stores/send/sending_state.dart';
14
import 'package:cake_wallet/src/stores/wallet/wallet_store.dart';
15
-import 'package:cake_wallet/src/screens/exchange_trade/widgets/copy_button.dart';
15
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
16
import 'package:cake_wallet/src/screens/base_page.dart';
17
import 'package:cake_wallet/src/screens/exchange_trade/widgets/timer_widget.dart';
18
import 'package:cake_wallet/src/widgets/primary_button.dart';
19
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
20
+import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
21
+import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
22
23
class ExchangeTradePage extends BasePage {
24
@override
25
String get title => S.current.exchange;
26
27
+ @override
28
+ Color get backgroundColor => PaletteDark.historyPanel;
29
+
30
@override
31
Widget body(BuildContext context) => ExchangeTradeForm();
32
}
@@ -46,278 +50,273 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
50
51
_setEffects(context);
52
49
- return ScrollableWithBottomSection(
50
- contentPadding: EdgeInsets.only(left: 20, right: 20, top: 20),
51
- content: Observer(builder: (_) {
52
- final trade = tradeStore.trade;
53
- final walletName = walletStore.name;
53
+ return Container(
54
+ color: PaletteDark.historyPanel,
55
+ child: ScrollableWithBottomSection(
56
+ contentPadding: EdgeInsets.only(left: 24, right: 24, top: 24),
57
+ content: Observer(builder: (_) {
58
+ final trade = tradeStore.trade;
59
+ final walletName = walletStore.name;
60
55
- return Column(
56
- mainAxisAlignment: MainAxisAlignment.start,
57
- crossAxisAlignment: CrossAxisAlignment.start,
58
- children: <Widget>[
59
- Container(
60
- child: Row(
61
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
62
- crossAxisAlignment: CrossAxisAlignment.start,
63
- children: [
64
- Column(
65
- crossAxisAlignment: CrossAxisAlignment.start,
66
- children: <Widget>[
67
- Row(
68
- mainAxisAlignment: MainAxisAlignment.start,
69
- children: <Widget>[
70
- Text(
71
- S.of(context).id,
72
- style: TextStyle(
73
- height: 2,
74
- fontWeight: FontWeight.bold,
75
- fontSize: 14.0,
76
- color: Theme.of(context)
77
- .primaryTextTheme
78
- .button
79
- .color),
80
- ),
81
- Text(
82
- '${trade.id ?? fetchingLabel}',
83
- style: TextStyle(
84
- fontSize: 14.0,
85
- height: 2,
86
- color: Theme.of(context)
87
- .primaryTextTheme
88
- .subtitle
89
- .color),
90
- )
91
- ],
92
- ),
93
- Row(
94
- mainAxisAlignment: MainAxisAlignment.start,
95
- children: <Widget>[
96
- Text(
97
- S.of(context).amount,
98
- style: TextStyle(
99
- height: 2,
100
- fontWeight: FontWeight.bold,
101
- fontSize: 14.0,
102
- color: Theme.of(context)
103
- .primaryTextTheme
104
- .button
105
- .color),
106
- ),
107
- Text(
108
- '${trade.amount ?? fetchingLabel}',
109
- style: TextStyle(
110
- fontSize: 14.0,
111
- height: 2,
112
- color: Theme.of(context)
113
- .primaryTextTheme
114
- .subtitle
115
- .color),
116
- )
117
- ],
118
- ),
119
- trade.extraId != null
120
- ? Row(
121
- mainAxisAlignment: MainAxisAlignment.start,
122
- children: <Widget>[
123
- Text(
124
- S.of(context).payment_id,
125
- style: TextStyle(
126
- height: 2,
127
- fontWeight: FontWeight.bold,
128
- fontSize: 14.0,
129
- color: Theme.of(context)
130
- .primaryTextTheme
131
- .button
132
- .color),
133
- ),
134
- Text(
135
- '${trade.extraId ?? fetchingLabel}',
136
- style: TextStyle(
137
- fontSize: 14.0,
138
- height: 2,
139
- color: Theme.of(context)
140
- .primaryTextTheme
141
- .subtitle
142
- .color),
143
- )
144
- ],
61
+ return Column(
62
+ mainAxisAlignment: MainAxisAlignment.start,
63
+ crossAxisAlignment: CrossAxisAlignment.start,
64
+ children: <Widget>[
65
+ Container(
66
+ child: Row(
67
+ crossAxisAlignment: CrossAxisAlignment.start,
68
+ children: [
69
+ Column(
70
+ crossAxisAlignment: CrossAxisAlignment.start,
71
+ children: <Widget>[
72
+ Row(
73
+ mainAxisAlignment: MainAxisAlignment.start,
74
+ children: <Widget>[
75
+ Text(
76
+ S.of(context).id,
77
+ style: TextStyle(
78
+ height: 2,
79
+ fontWeight: FontWeight.bold,
80
+ fontSize: 14.0,
81
+ color: Colors.white),
82
+ ),
83
+ Text(
84
+ '${trade.id ?? fetchingLabel}',
85
+ style: TextStyle(
86
+ fontSize: 14.0,
87
+ height: 2,
88
+ color: PaletteDark.walletCardText),
89
)
146
- : Container(),
147
- Row(
148
- mainAxisAlignment: MainAxisAlignment.start,
149
- children: <Widget>[
150
- Text(
151
- S.of(context).status,
152
- style: TextStyle(
153
- fontSize: 14.0,
154
- fontWeight: FontWeight.bold,
155
- color: Theme.of(context)
156
- .primaryTextTheme
157
- .button
158
- .color,
159
- height: 2),
160
- ),
161
- Text(
162
- '${trade.state ?? fetchingLabel}',
163
- style: TextStyle(
164
- fontSize: 14.0,
165
- height: 2,
166
- color: Theme.of(context)
167
- .primaryTextTheme
168
- .subtitle
169
- .color),
170
- )
171
- ],
172
- ),
173
- trade.expiredAt != null
174
- ? Row(
175
- mainAxisAlignment: MainAxisAlignment.start,
176
- children: <Widget>[
177
- Text(
178
- S.of(context).offer_expires_in,
179
- style: TextStyle(
180
- fontSize: 14.0,
181
- color: Theme.of(context)
182
- .primaryTextTheme
183
- .button
184
- .color),
185
- ),
186
- TimerWidget(trade.expiredAt,
187
- color: Theme.of(context)
188
- .primaryTextTheme
189
- .subtitle
190
- .color)
191
- ],
90
+ ],
91
+ ),
92
+ Row(
93
+ mainAxisAlignment: MainAxisAlignment.start,
94
+ children: <Widget>[
95
+ Text(
96
+ S.of(context).amount,
97
+ style: TextStyle(
98
+ height: 2,
99
+ fontWeight: FontWeight.bold,
100
+ fontSize: 14.0,
101
+ color: Colors.white),
102
+ ),
103
+ Text(
104
+ '${trade.amount ?? fetchingLabel}',
105
+ style: TextStyle(
106
+ fontSize: 14.0,
107
+ height: 2,
108
+ color: PaletteDark.walletCardText),
109
)
193
- : Container(),
194
- ],
195
- ),
196
- SizedBox(width: 10),
197
- Container(
198
- padding: EdgeInsets.all(5),
199
- color: Colors.white,
200
- constraints: BoxConstraints(minWidth: 65, maxWidth: 105),
201
- child: QrImage(
202
- data: trade.inputAddress ?? fetchingLabel,
203
- backgroundColor: Colors.white))
204
- ],
110
+ ],
111
+ ),
112
+ trade.extraId != null
113
+ ? Row(
114
+ mainAxisAlignment: MainAxisAlignment.start,
115
+ children: <Widget>[
116
+ Text(
117
+ S.of(context).payment_id,
118
+ style: TextStyle(
119
+ height: 2,
120
+ fontWeight: FontWeight.bold,
121
+ fontSize: 14.0,
122
+ color: Colors.white),
123
+ ),
124
+ Text(
125
+ '${trade.extraId ?? fetchingLabel}',
126
+ style: TextStyle(
127
+ fontSize: 14.0,
128
+ height: 2,
129
+ color: PaletteDark.walletCardText),
130
+ )
131
+ ],
132
+ )
133
+ : Container(),
134
+ Row(
135
+ mainAxisAlignment: MainAxisAlignment.start,
136
+ children: <Widget>[
137
+ Text(
138
+ S.of(context).status,
139
+ style: TextStyle(
140
+ fontSize: 14.0,
141
+ fontWeight: FontWeight.bold,
142
+ color: Colors.white,
143
+ height: 2),
144
+ ),
145
+ Text(
146
+ '${trade.state ?? fetchingLabel}',
147
+ style: TextStyle(
148
+ fontSize: 14.0,
149
+ height: 2,
150
+ color: PaletteDark.walletCardText),
151
+ )
152
+ ],
153
+ ),
154
+ trade.expiredAt != null
155
+ ? Row(
156
+ mainAxisAlignment: MainAxisAlignment.start,
157
+ children: <Widget>[
158
+ Text(
159
+ S.of(context).offer_expires_in,
160
+ style: TextStyle(
161
+ fontSize: 14.0,
162
+ color: Colors.white),
163
+ ),
164
+ TimerWidget(trade.expiredAt,
165
+ color: PaletteDark.walletCardText)
166
+ ],
167
+ )
168
+ : Container(),
169
+ ],
170
+ ),
171
+ ],
172
+ ),
173
),
206
- ),
207
- SizedBox(
208
- height: 20.0,
209
- ),
210
- Center(
211
- child: Text(
212
- S.of(context).trade_is_powered_by(trade.provider != null
213
- ? trade.provider.title
214
- : fetchingLabel),
215
- textAlign: TextAlign.center,
216
- style: TextStyle(
217
- fontSize: 14.0,
218
- fontWeight: FontWeight.bold,
219
- color: Theme.of(context).primaryTextTheme.headline.color),
174
+ Padding(
175
+ padding: EdgeInsets.only(top: 20),
176
+ child: Row(
177
+ children: <Widget>[
178
+ Spacer(
179
+ flex: 1,
180
+ ),
181
+ Flexible(
182
+ flex: 1,
183
+ child: Center(
184
+ child: AspectRatio(
185
+ aspectRatio: 1.0,
186
+ child: QrImage(
187
+ data: trade.inputAddress ?? fetchingLabel,
188
+ backgroundColor: Colors.transparent,
189
+ foregroundColor: PaletteDark.walletCardText,
190
+ ),
191
+ ),
192
+ )),
193
+ Spacer(
194
+ flex: 1,
195
+ )
196
+ ],
197
+ ),
198
+ ),
199
+ SizedBox(
200
+ height: 20.0,
201
),
221
- ),
222
- Container(
223
- padding: EdgeInsets.only(top: 20, bottom: 20),
224
- child: Center(
202
+ Center(
203
child: Text(
226
- trade.inputAddress ?? fetchingLabel,
204
+ S.of(context).trade_is_powered_by(trade.provider != null
205
+ ? trade.provider.title
206
+ : fetchingLabel),
207
textAlign: TextAlign.center,
228
- style: TextStyle(fontSize: 14.0, color: Palette.lightViolet),
208
+ style: TextStyle(
209
+ fontSize: 14.0,
210
+ fontWeight: FontWeight.bold,
211
+ color: Colors.white),
212
),
213
),
231
- ),
232
- Container(
233
- padding: EdgeInsets.only(left: 50.0, right: 50.0),
234
- child: Row(
235
- children: <Widget>[
236
- Flexible(
237
- child: Container(
238
- padding: EdgeInsets.only(right: 5.0),
239
- child: CopyButton(
240
- onPressed: () => Clipboard.setData(
241
- ClipboardData(text: trade.inputAddress)),
242
- text: S.of(context).copy_address,
243
- color: Theme.of(context)
244
- .accentTextTheme
245
- .button
246
- .backgroundColor,
247
- borderColor: Theme.of(context)
248
- .accentTextTheme
249
- .button
250
- .decorationColor),
251
- )),
252
- Flexible(
253
- child: Container(
254
- padding: EdgeInsets.only(left: 5.0),
255
- child: CopyButton(
256
- onPressed: () =>
257
- Clipboard.setData(ClipboardData(text: trade.id)),
258
- text: S.of(context).copy_id,
259
- color: Theme.of(context)
260
- .accentTextTheme
261
- .button
262
- .backgroundColor,
263
- borderColor: Theme.of(context)
264
- .accentTextTheme
265
- .button
266
- .decorationColor),
267
- ))
268
- ],
214
+ Container(
215
+ padding: EdgeInsets.only(top: 20, bottom: 20),
216
+ child: Center(
217
+ child: Text(
218
+ trade.inputAddress ?? fetchingLabel,
219
+ textAlign: TextAlign.center,
220
+ style: TextStyle(fontSize: 14.0, color: PaletteDark.walletCardText),
221
+ ),
222
+ ),
223
+ ),
224
+ Container(
225
+ child: Row(
226
+ children: <Widget>[
227
+ Flexible(
228
+ child: Container(
229
+ padding: EdgeInsets.only(right: 5.0),
230
+ child: Builder(
231
+ builder: (context) => PrimaryButton(
232
+ onPressed: () {
233
+ Clipboard.setData(ClipboardData(text: trade.inputAddress));
234
+ Scaffold.of(context).showSnackBar(SnackBar(
235
+ content: Text(
236
+ S.of(context).copied_to_clipboard,
237
+ textAlign: TextAlign.center,
238
+ style: TextStyle(color: Colors.white),
239
+ ),
240
+ backgroundColor: Colors.green,
241
+ duration: Duration(milliseconds: 1500),
242
+ ));
243
+ },
244
+ text: S.of(context).copy_address,
245
+ color: PaletteDark.menuList,
246
+ textColor: Colors.white)
247
+ ),
248
+ )),
249
+ Flexible(
250
+ child: Container(
251
+ padding: EdgeInsets.only(left: 5.0),
252
+ child: Builder(
253
+ builder: (context) => PrimaryButton(
254
+ onPressed: () {
255
+ Clipboard.setData(ClipboardData(text: trade.id));
256
+ Scaffold.of(context).showSnackBar(SnackBar(
257
+ content: Text(
258
+ S.of(context).copied_to_clipboard,
259
+ textAlign: TextAlign.center,
260
+ style: TextStyle(color: Colors.white),
261
+ ),
262
+ backgroundColor: Colors.green,
263
+ duration: Duration(milliseconds: 1500),
264
+ ));
265
+ },
266
+ text: S.of(context).copy_id,
267
+ color: PaletteDark.menuList,
268
+ textColor: Colors.white)
269
+ ),
270
+ ))
271
+ ],
272
+ ),
273
),
270
- ),
271
- Container(
272
- padding: EdgeInsets.only(top: 20),
273
- child: Text(
274
- tradeStore.isSendable
275
- ? S.of(context).exchange_result_confirm(
276
- trade.amount ?? fetchingLabel,
277
- trade.from.toString(),
278
- walletName)
279
- : S.of(context).exchange_result_description(
280
- trade.amount ?? fetchingLabel, trade.from.toString()),
274
+ Container(
275
+ padding: EdgeInsets.only(top: 20),
276
+ child: Text(
277
+ tradeStore.isSendable
278
+ ? S.of(context).exchange_result_confirm(
279
+ trade.amount ?? fetchingLabel,
280
+ trade.from.toString(),
281
+ walletName)
282
+ : S.of(context).exchange_result_description(
283
+ trade.amount ?? fetchingLabel, trade.from.toString()),
284
+ textAlign: TextAlign.left,
285
+ style: TextStyle(
286
+ fontSize: 13.0,
287
+ color: Colors.white),
288
+ ),
289
+ ),
290
+ Text(
291
+ S.of(context).exchange_result_write_down_ID,
292
textAlign: TextAlign.left,
293
style: TextStyle(
294
fontSize: 13.0,
284
- color: Theme.of(context).primaryTextTheme.title.color),
285
- ),
286
- ),
287
- Text(
288
- S.of(context).exchange_result_write_down_ID,
289
- textAlign: TextAlign.left,
290
- style: TextStyle(
291
- fontSize: 13.0,
292
- color: Theme.of(context).accentTextTheme.title.color),
293
- )
294
- ],
295
- );
296
- }),
297
- bottomSection: Observer(
298
- builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
299
- !(sendStore.state is TransactionCommitted)
300
- ? Container(
301
- padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
302
- child: LoadingPrimaryButton(
303
- isDisabled: tradeStore.trade.inputAddress == null ||
304
- tradeStore.trade.inputAddress.isEmpty,
305
- isLoading: sendStore.state is CreatingTransaction ||
306
- sendStore.state is TransactionCommitted,
307
- onPressed: () => sendStore.createTransaction(
308
- address: tradeStore.trade.inputAddress,
309
- amount: tradeStore.trade.amount),
310
- text: tradeStore.trade.provider ==
311
- ExchangeProviderDescription.xmrto
312
- ? S.of(context).confirm
313
- : S.of(context).send_xmr,
314
- color: Theme.of(context)
315
- .primaryTextTheme
316
- .button
317
- .backgroundColor,
318
- textColor: Theme.of(context).primaryTextTheme.button.color),
319
- )
320
- : Offstage()),
295
+ color: Colors.white),
296
+ )
297
+ ],
298
+ );
299
+ }),
300
+ bottomSectionPadding: EdgeInsets.all(24),
301
+ bottomSection: Observer(
302
+ builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr &&
303
+ !(sendStore.state is TransactionCommitted)
304
+ ? LoadingPrimaryButton(
305
+ isDisabled: tradeStore.trade.inputAddress == null ||
306
+ tradeStore.trade.inputAddress.isEmpty,
307
+ isLoading: sendStore.state is CreatingTransaction ||
308
+ sendStore.state is TransactionCommitted,
309
+ onPressed: () => sendStore.createTransaction(
310
+ address: tradeStore.trade.inputAddress,
311
+ amount: tradeStore.trade.amount),
312
+ text: tradeStore.trade.provider ==
313
+ ExchangeProviderDescription.xmrto
314
+ ? S.of(context).confirm
315
+ : S.of(context).send_xmr,
316
+ color: Colors.blue,
317
+ textColor: Colors.white)
318
+ : Offstage()),
319
+ ),
320
);
321
}
322
@@ -334,14 +333,11 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
333
showDialog<void>(
334
context: context,
335
builder: (BuildContext context) {
337
- return AlertDialog(
338
- title: Text(S.of(context).error),
339
- content: Text(state.error),
340
- actions: <Widget>[
341
- FlatButton(
342
- child: Text(S.of(context).ok),
343
- onPressed: () => Navigator.of(context).pop())
344
- ],
336
+ return AlertWithOneAction(
337
+ alertTitle: S.of(context).error,
338
+ alertContent: state.error,
339
+ buttonText: S.of(context).ok,
340
+ buttonAction: () => Navigator.of(context).pop()
341
);
342
});
343
});
@@ -352,23 +348,18 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
348
showDialog<void>(
349
context: context,
350
builder: (BuildContext context) {
355
- return AlertDialog(
356
- title: Text(S.of(context).confirm_sending),
357
- content: Text(S.of(context).commit_transaction_amount_fee(
358
- sendStore.pendingTransaction.amount,
359
- sendStore.pendingTransaction.fee)),
360
- actions: <Widget>[
361
- FlatButton(
362
- child: Text(S.of(context).ok),
363
- onPressed: () {
364
- Navigator.of(context).pop();
365
- sendStore.commitTransaction();
366
- }),
367
- FlatButton(
368
- child: Text(S.of(context).cancel),
369
- onPressed: () => Navigator.of(context).pop(),
370
- )
371
- ],
351
+ return AlertWithTwoActions(
352
+ alertTitle: S.of(context).confirm_sending,
353
+ alertContent: S.of(context).commit_transaction_amount_fee(
354
+ sendStore.pendingTransaction.amount,
355
+ sendStore.pendingTransaction.fee),
356
+ leftButtonText: S.of(context).ok,
357
+ rightButtonText: S.of(context).cancel,
358
+ actionLeftButton: () {
359
+ Navigator.of(context).pop();
360
+ sendStore.commitTransaction();
361
+ },
362
+ actionRightButton: () => Navigator.of(context).pop()
363
);
364
});
365
});
@@ -379,14 +370,11 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
370
showDialog<void>(
371
context: context,
372
builder: (BuildContext context) {
382
- return AlertDialog(
383
- title: Text(S.of(context).sending),
384
- content: Text(S.of(context).transaction_sent),
385
- actions: <Widget>[
386
- FlatButton(
387
- child: Text(S.of(context).ok),
388
- onPressed: () => Navigator.of(context).pop())
389
- ],
373
+ return AlertWithOneAction(
374
+ alertTitle: S.of(context).sending,
375
+ alertContent: S.of(context).transaction_sent,
376
+ buttonText: S.of(context).ok,
377
+ buttonAction: () => Navigator.of(context).pop()
378
);
379
});
380
});
lib/src/screens/receive/receive_page.dart
+1
-1
@@ -170,7 +170,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
170
height: 48,
171
padding: EdgeInsets.only(left: 24, right: 24),
172
decoration: BoxDecoration(
173
- borderRadius: BorderRadius.all(Radius.circular(27)),
173
+ borderRadius: BorderRadius.all(Radius.circular(24)),
174
color: PaletteDark.walletCardSubAddressField
175
),
176
child: Row(
res/values/strings_de.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "ID kopieren",
76
"exchange_result_write_down_trade_id" : "Bitte kopieren oder notieren Sie die Handel-ID, um fortzufahren.",
77
- "trade_id" : "Handel-ID:\n${id}",
77
+ "trade_id" : "Handel-ID:",
78
"copied_to_clipboard" : "In die Zwischenablage kopiert",
79
"saved_the_trade_id" : "Ich habe die Geschäfts-ID gespeichert",
80
"fetching" : "holen",
res/values/strings_en.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "Copy ID",
76
"exchange_result_write_down_trade_id" : "Please copy or write down the trade ID to continue.",
77
- "trade_id" : "Trade ID:\n${id}",
77
+ "trade_id" : "Trade ID:",
78
"copied_to_clipboard" : "Copied to Clipboard",
79
"saved_the_trade_id" : "I've saved the trade ID",
80
"fetching" : "Fetching",
res/values/strings_es.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "Copiar ID",
76
"exchange_result_write_down_trade_id" : "Por favor, copia o escribe el ID.",
77
- "trade_id" : "Comercial ID:\n${id}",
77
+ "trade_id" : "Comercial ID:",
78
"copied_to_clipboard" : "Copiado al portapapeles",
79
"saved_the_trade_id" : "He salvado comercial ID",
80
"fetching" : "Cargando",
res/values/strings_hi.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "प्रतिलिपि ID",
76
"exchange_result_write_down_trade_id" : "जारी रखने के लिए कृपया ट्रेड ID की प्रतिलिपि बनाएँ या लिखें.",
77
- "trade_id" : "व्यापार ID:\n${id}",
77
+ "trade_id" : "व्यापार ID:",
78
"copied_to_clipboard" : "क्लिपबोर्ड पर नकल",
79
"saved_the_trade_id" : "मैंने व्यापार बचा लिया है ID",
80
"fetching" : "ला रहा है",
res/values/strings_ja.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "IDをコピー",
76
"exchange_result_write_down_trade_id" : "続行するには、取引IDをコピーまたは書き留めてください.",
77
- "trade_id" : "取引ID:\n${id}",
77
+ "trade_id" : "取引ID:",
78
"copied_to_clipboard" : "クリップボードにコピーしました",
79
"saved_the_trade_id" : "取引IDを保存しました",
80
"fetching" : "フェッチング",
res/values/strings_ko.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "부 ID",
76
"exchange_result_write_down_trade_id" : "계속하려면 거래 ID를 복사하거나 적어 두십시오..",
77
- "trade_id" : "무역 ID:\n${id}",
77
+ "trade_id" : "무역 ID:",
78
"copied_to_clipboard" : "클립 보드에 복사",
79
"saved_the_trade_id" : "거래 ID를 저장했습니다",
80
"fetching" : "가져 오는 중",
res/values/strings_nl.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "ID kopiëren",
76
"exchange_result_write_down_trade_id" : "Kopieer of noteer de handels-ID om door te gaan.",
77
- "trade_id" : "Trade ID:\n${id}",
77
+ "trade_id" : "Trade ID:",
78
"copied_to_clipboard" : "Gekopieerd naar het klembord",
79
"saved_the_trade_id" : "Ik heb de ruil-ID opgeslagen",
80
"fetching" : "Ophalen",
res/values/strings_pl.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "ID kopii",
76
"exchange_result_write_down_trade_id" : "Skopiuj lub zanotuj identyfikator transakcji, aby kontynuować.",
77
- "trade_id" : "Identyfikator handlu:\n${id}",
77
+ "trade_id" : "Identyfikator handlu:",
78
"copied_to_clipboard" : "Skopiowane do schowka",
79
"saved_the_trade_id" : "Zapisałem ID",
80
"fetching" : "Ujmujący",
res/values/strings_pt.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "Copiar ID",
76
"exchange_result_write_down_trade_id" : "Copie ou anote o ID da troca para continuar.",
77
- "trade_id" : "ID da troca:\n${id}",
77
+ "trade_id" : "ID da troca:",
78
"copied_to_clipboard" : "Copiado para a área de transferência",
79
"saved_the_trade_id" : "ID da troca salvo",
80
"fetching" : "Buscando",
res/values/strings_ru.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "Скопировать ID",
76
"exchange_result_write_down_trade_id" : "Пожалуйста, скопируйте или запишите ID сделки.",
77
- "trade_id" : "ID сделки:\n${id}",
77
+ "trade_id" : "ID сделки:",
78
"copied_to_clipboard" : "Скопировано в буфер обмена",
79
"saved_the_trade_id" : "Я сохранил ID сделки",
80
"fetching" : "Загрузка",
res/values/strings_uk.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "Скопіювати ID",
76
"exchange_result_write_down_trade_id" : "Будь ласка, скопіюйте або запишіть ID операції.",
77
- "trade_id" : "ID операції:\n${id}",
77
+ "trade_id" : "ID операції:",
78
"copied_to_clipboard" : "Скопійовано в буфер обміну",
79
"saved_the_trade_id" : "Я зберіг ID операції",
80
"fetching" : "Завантаження",
res/values/strings_zh.arb
+1
-1
@@ -74,7 +74,7 @@
74
75
"copy_id" : "复印ID",
76
"exchange_result_write_down_trade_id" : "请复制或写下交易编号以继续.",
77
- "trade_id" : "贸易编号:\n${id}",
77
+ "trade_id" : "贸易编号:",
78
"copied_to_clipboard" : "复制到剪贴板",
79
"saved_the_trade_id" : "我已经保存了交易ID",
80
"fetching" : "正在取得",