cake_wallet/lib/exchange/exchange_provider_description.dart

27 lines
759 B
Dart
Raw Normal View History

2020-09-21 11:50:26 +00:00
import 'package:cake_wallet/entities/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;
}
}
}