2021-04-13 18:40:44 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
|
|
|
|
2021-06-02 13:52:58 +00:00
|
|
|
Image getBuyProviderIcon(BuyProviderDescription providerDescription,
|
|
|
|
{bool isWhiteIconColor = false}) {
|
|
|
|
|
2021-04-13 18:40:44 +00:00
|
|
|
final _wyreIcon =
|
|
|
|
Image.asset('assets/images/wyre-icon.png', width: 36, height: 36);
|
2021-06-02 13:52:58 +00:00
|
|
|
final _moonPayWhiteIcon =
|
|
|
|
Image.asset('assets/images/moonpay-icon.png', color: Colors.white,
|
|
|
|
width: 36, height: 34);
|
|
|
|
final _moonPayBlackIcon =
|
|
|
|
Image.asset('assets/images/moonpay-icon.png', color: Colors.black,
|
|
|
|
width: 36, height: 34);
|
2021-04-13 18:40:44 +00:00
|
|
|
|
|
|
|
if (providerDescription != null) {
|
|
|
|
switch (providerDescription) {
|
|
|
|
case BuyProviderDescription.wyre:
|
|
|
|
return _wyreIcon;
|
|
|
|
case BuyProviderDescription.moonPay:
|
2021-06-02 13:52:58 +00:00
|
|
|
return isWhiteIconColor ? _moonPayWhiteIcon : _moonPayBlackIcon;
|
2021-04-13 18:40:44 +00:00
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|