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> {
|
2022-10-12 17:09:57 +00:00
|
|
|
const ExchangeProviderDescription({
|
|
|
|
required String title,
|
|
|
|
required int raw,
|
|
|
|
required this.image,
|
|
|
|
this.horizontalLogo = false})
|
2020-01-08 12:26:34 +00:00
|
|
|
: super(title: title, raw: raw);
|
|
|
|
|
2022-09-01 14:12:38 +00:00
|
|
|
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 =
|
2022-09-01 14:12:38 +00:00
|
|
|
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1, image: 'assets/images/changenow.png');
|
2020-01-30 18:23:36 +00:00
|
|
|
static const morphToken =
|
2022-09-01 14:12:38 +00:00
|
|
|
ExchangeProviderDescription(title: 'MorphToken', raw: 2, image: 'assets/images/morph.png');
|
2020-01-04 19:31:52 +00:00
|
|
|
|
2022-04-13 13:28:21 +00:00
|
|
|
static const sideShift =
|
2022-09-01 14:12:38 +00:00
|
|
|
ExchangeProviderDescription(title: 'SideShift', raw: 3, image: 'assets/images/sideshift.png');
|
|
|
|
|
|
|
|
static const simpleSwap =
|
|
|
|
ExchangeProviderDescription(title: 'SimpleSwap', raw: 4, image: 'assets/images/simpleSwap.png');
|
2022-04-13 13:28:21 +00:00
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
static ExchangeProviderDescription deserialize({required int raw}) {
|
2020-01-04 19:31:52 +00:00
|
|
|
switch (raw) {
|
|
|
|
case 0:
|
|
|
|
return xmrto;
|
|
|
|
case 1:
|
|
|
|
return changeNow;
|
2020-01-30 18:23:36 +00:00
|
|
|
case 2:
|
|
|
|
return morphToken;
|
2022-04-13 13:28:21 +00:00
|
|
|
case 3:
|
|
|
|
return sideShift;
|
2022-08-31 15:34:07 +00:00
|
|
|
case 4:
|
|
|
|
return simpleSwap;
|
2020-01-04 19:31:52 +00:00
|
|
|
default:
|
2022-10-12 17:09:57 +00:00
|
|
|
throw Exception('Unexpected token: $raw for ExchangeProviderDescription deserialize');
|
2020-01-04 19:31:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|