-
Notifications
You must be signed in to change notification settings - Fork 0
/
other.dart
executable file
·58 lines (49 loc) · 1.3 KB
/
other.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'dart:core';
class OrderType {
final String value;
final String typeName;
const OrderType(this.typeName, this.value);
static const OrderType willPay = OrderType("payment", "10");
static const OrderType willSend = OrderType("delivered", "20");
static const OrderType willReceive = OrderType("received", "30");
static const OrderType willEvaluation = OrderType("comment", "40");
static const OrderType timeout = OrderType("expire", "40");
static const OrderType all = OrderType("all", "");
static const OrderType unknown = OrderType("unknown", "");
factory OrderType.fromLive(int index) {
switch (index) {
case 0:
return willPay;
case 1:
return willSend;
case 2:
return willReceive;
case 3:
return timeout;
default:
return unknown;
}
}
factory OrderType.fromIndex(int index) {
switch (index) {
case 0:
return all;
case 1:
return willPay;
case 2:
return willSend;
case 3:
return willReceive;
case 4:
return willEvaluation;
default:
return unknown;
}
}
}
class GoodsType {
final String value;
const GoodsType(this.value);
static const GoodsType self = GoodsType("1");
static const GoodsType live = GoodsType("2");
}