DeviceToken.fromJson constructor

DeviceToken.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DeviceToken.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case DeviceTokenFirebaseCloudMessaging.CONSTRUCTOR:
      return DeviceTokenFirebaseCloudMessaging.fromJson(json);
    case DeviceTokenApplePush.CONSTRUCTOR:
      return DeviceTokenApplePush.fromJson(json);
    case DeviceTokenApplePushVoIP.CONSTRUCTOR:
      return DeviceTokenApplePushVoIP.fromJson(json);
    case DeviceTokenWindowsPush.CONSTRUCTOR:
      return DeviceTokenWindowsPush.fromJson(json);
    case DeviceTokenMicrosoftPush.CONSTRUCTOR:
      return DeviceTokenMicrosoftPush.fromJson(json);
    case DeviceTokenMicrosoftPushVoIP.CONSTRUCTOR:
      return DeviceTokenMicrosoftPushVoIP.fromJson(json);
    case DeviceTokenWebPush.CONSTRUCTOR:
      return DeviceTokenWebPush.fromJson(json);
    case DeviceTokenSimplePush.CONSTRUCTOR:
      return DeviceTokenSimplePush.fromJson(json);
    case DeviceTokenUbuntuPush.CONSTRUCTOR:
      return DeviceTokenUbuntuPush.fromJson(json);
    case DeviceTokenBlackBerryPush.CONSTRUCTOR:
      return DeviceTokenBlackBerryPush.fromJson(json);
    case DeviceTokenTizenPush.CONSTRUCTOR:
      return DeviceTokenTizenPush.fromJson(json);
    case DeviceTokenHuaweiPush.CONSTRUCTOR:
      return DeviceTokenHuaweiPush.fromJson(json);
    default:
      return const DeviceToken();
  }
}