| 1 | import 'package:cw_core/enumerable_item.dart'; |
| 2 | |
| 3 | class OrderProviderDescription extends EnumerableItem<int> with Serializable<int> { |
| 4 | const OrderProviderDescription({ |
| 5 | required String title, |
| 6 | required int raw, |
| 7 | required this.image, |
| 8 | }) : super(title: title, raw: raw); |
| 9 | |
| 10 | final String image; |
| 11 | |
| 12 | static const cakePay = |
| 13 | OrderProviderDescription(title: 'Cake Pay', raw: 0, image: 'assets/images/cake_pay_icon.png'); |
| 14 | |
| 15 | static OrderProviderDescription deserialize({required int raw}) { |
| 16 | switch (raw) { |
| 17 | case 0: |
| 18 | return cakePay; |
| 19 | default: |
| 20 | throw Exception('Invalid OrderProviderDescription $raw'); |
| 21 | } |
| 22 | } |
| 23 | } |