Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/models/exchange/response_objects/estimate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Estimate {
final String? warningMessage;
final String? rateId;
final String exchangeProvider;
final String? exchangeProviderLogo;
final String? kycRating;

Estimate({
Expand All @@ -28,6 +29,7 @@ class Estimate {
this.warningMessage,
this.rateId,
required this.exchangeProvider,
this.exchangeProviderLogo,
this.kycRating,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,43 @@ class _ProviderOptionState extends ConsumerState<_ProviderOption> {
child: SizedBox(
width: isDesktop ? 32 : 24,
height: isDesktop ? 32 : 24,
child: SvgPicture.asset(
child: widget.estimate?.exchangeProviderLogo != null &&
widget
.estimate!
.exchangeProviderLogo!
.isNotEmpty
? ClipRRect(
borderRadius: BorderRadius.circular(5),
child: Image.network(
widget.estimate!.exchangeProviderLogo!,
loadingBuilder: (
context,
child,
loadingProgress,
) {
if (loadingProgress == null) {
return child;
} else {
return const Center(
child:
CircularProgressIndicator(),
);
}
},
errorBuilder: (context, error, stackTrace) {
return SvgPicture.asset(
Assets.exchange.getIconFor(
exchangeName: widget.exchange.name,
),
width: isDesktop ? 32 : 24,
height: isDesktop ? 32 : 24,
);
},
width: isDesktop ? 32 : 24,
height: isDesktop ? 32 : 24,
),
)
: SvgPicture.asset(
Assets.exchange.getIconFor(
exchangeName: widget.exchange.name,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:decimal/decimal.dart';

class TrocadorQuote {
final String provider;
final String? providerLogo;
final String kycRating;
final int insurance;
final bool fixed;
Expand All @@ -21,6 +22,7 @@ class TrocadorQuote {

TrocadorQuote({
required this.provider,
this.providerLogo,
required this.kycRating,
required this.insurance,
required this.fixed,
Expand All @@ -32,6 +34,7 @@ class TrocadorQuote {
factory TrocadorQuote.fromMap(Map<String, dynamic> map) {
return TrocadorQuote(
provider: map['provider'] as String,
providerLogo: map['provider_logo'] as String?,
kycRating: map['kycrating'] as String,
insurance: map['insurance'] as int,
// wtf trocador?
Expand Down
2 changes: 2 additions & 0 deletions lib/services/exchange/trocador/trocador_exchange.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class TrocadorExchange extends Exchange {
fixedRate: quote.fixed,
reversed: reversed,
exchangeProvider: quote.provider,
exchangeProviderLogo: quote.providerLogo,
rateId: response.value!.tradeId,
kycRating: quote.kycRating,
),
Expand All @@ -256,6 +257,7 @@ class TrocadorExchange extends Exchange {
fixedRate: quote.fixed,
reversed: reversed,
exchangeProvider: quote.provider,
exchangeProviderLogo: quote.providerLogo,
rateId: response.value!.tradeId,
kycRating: quote.kycRating,
),
Expand Down
Loading