|
|
|
@ -3,6 +3,7 @@ import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
|
|
|
|
|
import 'package:cw_core/crypto_currency.dart';
|
|
|
|
|
import 'package:cake_wallet/entities/fiat_currency.dart';
|
|
|
|
|
import 'package:cake_wallet/palette.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class BuyListItem extends StatelessWidget {
|
|
|
|
@ -13,6 +14,7 @@ class BuyListItem extends StatelessWidget {
|
|
|
|
|
@required this.sourceCurrency,
|
|
|
|
|
@required this.destAmount,
|
|
|
|
|
@required this.destCurrency,
|
|
|
|
|
@required this.achSourceAmount,
|
|
|
|
|
@required this.onTap
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -22,6 +24,7 @@ class BuyListItem extends StatelessWidget {
|
|
|
|
|
final FiatCurrency sourceCurrency;
|
|
|
|
|
final double destAmount;
|
|
|
|
|
final CryptoCurrency destCurrency;
|
|
|
|
|
final double achSourceAmount;
|
|
|
|
|
final void Function() onTap;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@ -47,70 +50,100 @@ class BuyListItem extends StatelessWidget {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: () => onTap?.call(),
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 102,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 20,
|
|
|
|
|
//top: 33,
|
|
|
|
|
top: 28,
|
|
|
|
|
bottom: 28,
|
|
|
|
|
right: 20
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(25)),
|
|
|
|
|
color: backgroundColor
|
|
|
|
|
),
|
|
|
|
|
child: Stack(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 33,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
if (providerIcon != null) Padding(
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
if (providerIcon != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(right: 10),
|
|
|
|
|
child: providerIcon
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
provider.description.title,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: secondaryTextColor,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold
|
|
|
|
|
child: providerIcon),
|
|
|
|
|
Text(
|
|
|
|
|
provider.description.title,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: secondaryTextColor,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
if(achSourceAmount != null)...[
|
|
|
|
|
Text(
|
|
|
|
|
'${destAmount?.toString()} ${destCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: secondaryTextColor,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.account_balance_outlined,
|
|
|
|
|
size: 12,
|
|
|
|
|
color: primaryTextColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 5),
|
|
|
|
|
Text(
|
|
|
|
|
'${achSourceAmount?.toString()} ${sourceCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: primaryTextColor,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'${destAmount?.toString()} ${destCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: secondaryTextColor,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold
|
|
|
|
|
Text(
|
|
|
|
|
'${destAmount?.toString()} ${destCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: secondaryTextColor,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 65,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: Text(
|
|
|
|
|
'${sourceAmount?.toString()} ${sourceCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: primaryTextColor,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
CupertinoIcons.creditcard,
|
|
|
|
|
size: 12,
|
|
|
|
|
color: primaryTextColor,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 5),
|
|
|
|
|
Text(
|
|
|
|
|
'${sourceAmount?.toString()} ${sourceCurrency.title}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: primaryTextColor,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|