toOrderStatus function

OrderStatus toOrderStatus(
  1. int? index
)

Implementation

OrderStatus toOrderStatus(int? index) {
  switch (index) {
    case 0:
      return OrderStatus.ordered;
    case 1:
      return OrderStatus.paid;
    case 2:
      return OrderStatus.paymentFailed;
    case 3:
      return OrderStatus.shipped;
    case 4:
      return OrderStatus.delivered;
  }
  return OrderStatus.unknown;
}