Merge pull request #31 from cake-tech/CWA-169-add-morph-exchange-to-the-app

Cwa 169 add morph exchange to the app
This commit is contained in:
M
2020-02-12 18:20:56 +02:00
39 changed files with 553 additions and 24 deletions
+23 -2
View File
@@ -480,7 +480,28 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
ExchangeProviderDescription
.changeNow),
)
])))
]))),
PopupMenuItem(
value: 5,
child: Observer(
builder: (_) => Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text('MorphToken'),
Checkbox(
value: actionListStore
.tradeFilterStore
.displayMorphToken,
onChanged: (value) =>
actionListStore
.tradeFilterStore
.toggleDisplayExchange(
ExchangeProviderDescription
.morphToken),
)
])))
],
child: Text(S.of(context).filters,
style: TextStyle(
@@ -556,7 +577,7 @@ class DashboardPageBodyState extends State<DashboardPageBody> {
final formattedAmount = trade.amount != null
? savedDisplayMode == BalanceDisplayMode.hiddenBalance
? '---'
: trade.amount
: trade.amountFormatted()
: trade.amount;
return TradeRow(
+3
View File
@@ -82,6 +82,9 @@ class TradeRow extends StatelessWidget {
case ExchangeProviderDescription.changeNow:
image = Image.asset('assets/images/change_now.png');
break;
case ExchangeProviderDescription.morphToken:
image = Image.asset('assets/images/morph_icon.png');
break;
default:
image = null;
}
@@ -36,6 +36,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
static const xmrtoUrl = 'https://xmr.to/app_static/html/tos.html';
static const changenowUrl = 'https://changenow.io/terms-of-use';
static const morphUrl = 'http://morphtoken.com/terms';
final bool _isAccepted;
bool _checked = false;
@@ -197,6 +198,27 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> {
))
],
),
SizedBox(
height: 16.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child: GestureDetector(
onTap: () => launchUrl(morphUrl),
child: Text(
morphUrl,
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.blue,
fontSize: 14.0,
fontWeight: FontWeight.normal,
decoration: TextDecoration.underline),
),
))
],
),
SizedBox(
height: 16.0,
)
@@ -278,6 +278,9 @@ class ExchangeFormState extends State<ExchangeForm> {
case ExchangeProviderDescription.changeNow:
imageSrc = 'assets/images/change_now.png';
break;
case ExchangeProviderDescription.morphToken:
imageSrc = 'assets/images/morph_icon.png';
break;
}
return Padding(
+8
View File
@@ -51,12 +51,14 @@ class SettingsFormState extends State<SettingsForm> {
final _twitterImage = Image.asset('assets/images/Twitter.png');
final _changeNowImage = Image.asset('assets/images/change_now.png');
final _xmrBtcImage = Image.asset('assets/images/xmr_btc.png');
final _morphImage = Image.asset('assets/images/morph_icon.png');
final _emailUrl = 'mailto:support@cakewallet.com';
final _telegramUrl = 'https:t.me/cakewallet_bot';
final _twitterUrl = 'https:twitter.com/CakewalletXMR';
final _changeNowUrl = 'mailto:support@changenow.io';
final _xmrToUrl = 'mailto:support@xmr.to';
final _morphUrl = 'mailto:support@morphtoken.com';
final _items = List<SettingsItem>();
@@ -267,6 +269,12 @@ class SettingsFormState extends State<SettingsForm> {
link: 'support@xmr.to',
image: _xmrBtcImage,
attribute: Attributes.link),
SettingsItem(
onTaped: () => _launchUrl(_morphUrl),
title: 'MorphToken',
link: 'support@morphtoken.com',
image: _morphImage,
attribute: Attributes.link),
SettingsItem(
onTaped: () {
Navigator.push(
@@ -8,6 +8,7 @@ import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart'
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart';
import 'package:cake_wallet/src/screens/transaction_details/standart_list_row.dart';
import 'package:intl/intl.dart';
class TradeDetailsPage extends BasePage {
@override
@@ -16,6 +17,8 @@ class TradeDetailsPage extends BasePage {
@override
bool get isModalBackButton => true;
final createdAtFormat = DateFormat('yyyy-MM-dd HH:mm:ss');
@override
Widget body(BuildContext context) {
final exchangeStore = Provider.of<ExchangeTradeStore>(context);
@@ -43,7 +46,7 @@ class TradeDetailsPage extends BasePage {
if (trade.createdAt != null) {
items.add(StandartListItem(
title: S.of(context).trade_details_created_at,
value: trade.createdAt.toString()));
value: createdAtFormat.format(trade.createdAt).toString()));
}
if (trade.from != null && trade.to != null) {