mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
Cw 807 add extra fields for xrp and xlm exchanges (#1869)
* show extra id for xrp/xlm Stealth * extra id for xrp/xlm LetsExchange * extra id xrp/xml for Sideshift and Trocador * fix Exolix min amount issue * fix extra id ui
This commit is contained in:
@@ -8,7 +8,8 @@ class TradeDetailsListCardItem extends StandartListItem {
|
||||
{required this.id,
|
||||
required this.createdAt,
|
||||
required this.pair,
|
||||
required this.onTap})
|
||||
required this.onTap,
|
||||
this.extraId})
|
||||
: super(title: '', value: '');
|
||||
|
||||
factory TradeDetailsListCardItem.tradeDetails(
|
||||
@@ -16,9 +17,19 @@ class TradeDetailsListCardItem extends StandartListItem {
|
||||
required String createdAt,
|
||||
required CryptoCurrency from,
|
||||
required CryptoCurrency to,
|
||||
required void Function(BuildContext) onTap}) {
|
||||
required void Function(BuildContext) onTap,
|
||||
String? extraId}) {
|
||||
|
||||
|
||||
final extraIdTitle = from == CryptoCurrency.xrp
|
||||
? S.current.destination_tag
|
||||
: from == CryptoCurrency.xlm
|
||||
? S.current.memo
|
||||
: S.current.extra_id;
|
||||
|
||||
return TradeDetailsListCardItem(
|
||||
id: '${S.current.trade_details_id} ${formatAsText(id)}',
|
||||
extraId: extraId != null ? '$extraIdTitle $extraId' : null,
|
||||
createdAt: formatAsText(createdAt),
|
||||
pair: '${formatAsText(from)} → ${formatAsText(to)}',
|
||||
onTap: onTap);
|
||||
@@ -27,6 +38,7 @@ class TradeDetailsListCardItem extends StandartListItem {
|
||||
final String id;
|
||||
final String createdAt;
|
||||
final String pair;
|
||||
final String? extraId;
|
||||
final void Function(BuildContext) onTap;
|
||||
|
||||
static String formatAsText<T>(T value) => value?.toString() ?? '';
|
||||
|
||||
@@ -69,6 +69,7 @@ class TradeDetailsPageBodyState extends State<TradeDetailsPageBody> {
|
||||
if (item is TradeDetailsListCardItem)
|
||||
return TradeDetailsStandardListCard(
|
||||
id: item.id,
|
||||
extraId: item.extraId,
|
||||
create: item.createdAt,
|
||||
pair: item.pair,
|
||||
currentTheme: tradeDetailsViewModel.settingsStore.currentTheme.type,
|
||||
|
||||
@@ -6,12 +6,14 @@ import 'package:cake_wallet/themes/theme_base.dart';
|
||||
class TradeDetailsStandardListCard extends StatelessWidget {
|
||||
TradeDetailsStandardListCard(
|
||||
{required this.id,
|
||||
this.extraId,
|
||||
required this.create,
|
||||
required this.pair,
|
||||
required this.onTap,
|
||||
required this.currentTheme});
|
||||
|
||||
final String id;
|
||||
final String? extraId;
|
||||
final String create;
|
||||
final String pair;
|
||||
final ThemeType currentTheme;
|
||||
@@ -57,6 +59,16 @@ class TradeDetailsStandardListCard extends StatelessWidget {
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if (extraId != null && extraId!.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: Text(extraId!,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w400,
|
||||
color: textColor)),
|
||||
),
|
||||
Text(create,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
|
||||
Reference in New Issue
Block a user