RedPacketMessage.from constructor

RedPacketMessage.from(
  1. Map data
)

Implementation

RedPacketMessage.from(Map data)
    : type = data['type'] ?? data['interface'] ?? '',
      count = data['count'] ?? 0,
      got = data['got'] ?? 0,
      money = data['money'] ?? 0,
      msg = data['msg'] ?? '',
      senderId = data['senderId'] ?? '',
      recivers = List.from(data['recivers'] is String
          ? json.decode(data['recivers'])
          : data['recivers']),
      who = List.from(data['who'] ?? [])
          .map((e) => RedPacketGot.from(e))
          .toList(),
      gesture = data['gesture'] != null
          ? GestureType.values[data['gesture']]
          : null;