@ -1,15 +1,16 @@
import ' package:flutter/material.dart ' ;
import ' package:cake_wallet/src/domain/common/crypto_currency.dart ' ;
import ' package:cake_wallet/src/domain/exchange/exchange_provider_description.dart ' ;
import ' package:cake_wallet/palette.dart ' ;
class TradeRow extends StatelessWidget {
TradeRow (
{ this . provider ,
this . from ,
this . to ,
this . createdAtFormattedDate ,
this . formattedAmount ,
@ required this . onTap } ) ;
TradeRow ( {
this . provider ,
this . from ,
this . to ,
this . createdAtFormattedDate ,
this . formattedAmount ,
@ required this . onTap } ) ;
final VoidCallback onTap ;
final ExchangeProviderDescription provider ;
@ -25,58 +26,53 @@ class TradeRow extends StatelessWidget {
return InkWell (
onTap: onTap ,
child: Container (
height: 60 ,
decoration: BoxDecoration (
color: Theme . of ( context ) . backgroundColor ,
border: Border . all (
width: 1 ,
color: Theme . of ( context ) . backgroundColor
) ,
) ,
padding: EdgeInsets . only ( top: 5 , bottom: 5 , left: 20 , right: 20 ) ,
child: Row ( children: < Widget > [
Container (
height: 36 ,
width: 36 ,
decoration: BoxDecoration (
shape: BoxShape . circle ,
color: Theme . of ( context ) . backgroundColor
) ,
child: _getPoweredImage ( provider ) ,
) ,
Expanded (
child: Padding (
padding: const EdgeInsets . only ( left: 10 ) ,
child: Column (
children: < Widget > [
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Text ( ' ${ from . toString ( ) } → ${ to . toString ( ) } ' ,
style: TextStyle (
fontSize: 16 ,
color: Theme . of ( context ) . primaryTextTheme . title . color
) ) ,
formattedAmount ! = null
? Text ( formattedAmount + ' ' + amountCrypto ,
style: TextStyle (
fontSize: 16 ,
color: Theme . of ( context ) . primaryTextTheme . title . color
) )
: Container ( )
] ) ,
SizedBox ( height: 5 ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Text ( createdAtFormattedDate ,
style: TextStyle (
fontSize: 14 , color: Theme . of ( context ) . primaryTextTheme . headline . color ) )
] ) ,
] ,
) ,
) )
] ) ,
height: 52 ,
color: Colors . transparent ,
padding: EdgeInsets . only ( left: 24 , right: 24 ) ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . center ,
children: < Widget > [
_getPoweredImage ( provider ) ,
Expanded (
child: Padding (
padding: const EdgeInsets . only ( left: 12 ) ,
child: Container (
height: 42 ,
child: Column (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
mainAxisSize: MainAxisSize . max ,
children: < Widget > [
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Text ( ' ${ from . toString ( ) } → ${ to . toString ( ) } ' ,
style: TextStyle (
fontSize: 16 ,
fontWeight: FontWeight . w500 ,
color: Colors . white
) ) ,
formattedAmount ! = null
? Text ( formattedAmount + ' ' + amountCrypto ,
style: TextStyle (
fontSize: 16 ,
fontWeight: FontWeight . w500 ,
color: Colors . white
) )
: Container ( )
] ) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Text ( createdAtFormattedDate ,
style: TextStyle (
fontSize: 14 ,
color: PaletteDark . darkCyanBlue ) )
] ) ,
] ,
) ,
) ,
) )
] ) ,
) ) ;
}
@ -84,17 +80,17 @@ class TradeRow extends StatelessWidget {
Image image ;
switch ( provider ) {
case ExchangeProviderDescription . xmrto:
image = Image . asset ( ' assets/images/xmr _btc.png' ) ;
image = Image . asset ( ' assets/images/xmr to.png' , height: 36 , width: 36 ) ;
break ;
case ExchangeProviderDescription . changeNow:
image = Image . asset ( ' assets/images/change _ now.png' ) ;
image = Image . asset ( ' assets/images/change now.png' , height: 36 , width: 36 ) ;
break ;
case ExchangeProviderDescription . morphToken:
image = Image . asset ( ' assets/images/morph _icon .png' ) ;
image = Image . asset ( ' assets/images/morph .png' , height: 36 , width: 36 ) ;
break ;
default :
image = null ;
}
return image ;
}
}
}