| 1 | import 'package:cw_core/enumerable_item.dart'; |
| 2 | |
| 3 | class BuyProviderDescription extends EnumerableItem<int> with Serializable<int> { |
| 4 | const BuyProviderDescription({required String title, required int raw, required this.image}) |
| 5 | : super(title: title, raw: raw); |
| 6 | |
| 7 | final String image; |
| 8 | |
| 9 | static const wyre = BuyProviderDescription(title: 'Wyre', raw: 0, image: ''); |
| 10 | static const moonPay = BuyProviderDescription(title: 'MoonPay', raw: 1, image: ''); |
| 11 | |
| 12 | static BuyProviderDescription deserialize({required int raw}) { |
| 13 | switch (raw) { |
| 14 | case 0: |
| 15 | return wyre; |
| 16 | case 1: |
| 17 | return moonPay; |
| 18 | default: |
| 19 | throw Exception('Incorrect token $raw for BuyProviderDescription deserialize'); |
| 20 | } |
| 21 | } |
| 22 | } |