cake_wallet/lib/exchange/exchange_provider_description.dart

40 lines
1.3 KiB
Dart
Raw Normal View History

2021-12-24 12:37:24 +00:00
import 'package:cw_core/enumerable_item.dart';
2020-01-04 19:31:52 +00:00
class ExchangeProviderDescription extends EnumerableItem<int>
with Serializable<int> {
const ExchangeProviderDescription({String title, int raw, this.horizontalLogo = false, this.image})
2020-01-08 12:26:34 +00:00
: super(title: title, raw: raw);
final bool horizontalLogo;
final String image;
static const xmrto = ExchangeProviderDescription(title: 'XMR.TO', raw: 0, image: 'assets/images/xmrto.png');
2020-01-04 19:31:52 +00:00
static const changeNow =
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1, image: 'assets/images/changenow.png');
static const morphToken =
ExchangeProviderDescription(title: 'MorphToken', raw: 2, image: 'assets/images/morph.png');
2020-01-04 19:31:52 +00:00
static const sideShift =
ExchangeProviderDescription(title: 'SideShift', raw: 3, image: 'assets/images/sideshift.png');
static const simpleSwap =
ExchangeProviderDescription(title: 'SimpleSwap', raw: 4, image: 'assets/images/simpleSwap.png');
2020-01-04 19:31:52 +00:00
static ExchangeProviderDescription deserialize({int raw}) {
switch (raw) {
case 0:
return xmrto;
case 1:
return changeNow;
case 2:
return morphToken;
case 3:
return sideShift;
case 4:
return simpleSwap;
2020-01-04 19:31:52 +00:00
default:
return null;
}
}
}