cake_wallet/lib/exchange/exchange_provider_description.dart

27 lines
746 B
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> {
2020-01-08 12:26:34 +00:00
const ExchangeProviderDescription({String title, int raw})
: super(title: title, raw: raw);
2020-01-04 19:31:52 +00:00
static const xmrto = ExchangeProviderDescription(title: 'XMR.TO', raw: 0);
static const changeNow =
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1);
static const morphToken =
ExchangeProviderDescription(title: 'MorphToken', raw: 2);
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;
2020-01-04 19:31:52 +00:00
default:
return null;
}
}
}