ConnectionState.fromJson constructor

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

Implementation

factory ConnectionState.fromJson(Map<String, dynamic> json)  {
  switch(json["@type"]) {
    case ConnectionStateWaitingForNetwork.CONSTRUCTOR:
      return ConnectionStateWaitingForNetwork.fromJson(json);
    case ConnectionStateConnectingToProxy.CONSTRUCTOR:
      return ConnectionStateConnectingToProxy.fromJson(json);
    case ConnectionStateConnecting.CONSTRUCTOR:
      return ConnectionStateConnecting.fromJson(json);
    case ConnectionStateUpdating.CONSTRUCTOR:
      return ConnectionStateUpdating.fromJson(json);
    case ConnectionStateReady.CONSTRUCTOR:
      return ConnectionStateReady.fromJson(json);
    default:
      return const ConnectionState();
  }
}