SyncRequest.fromJson constructor

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

Implementation

factory SyncRequest.fromJson(Map<String, dynamic> json) {
  return SyncRequest(
    id: json['id'] as String,
    method: json['method'] as String,
    url: json['url'] as String,
    headers: json['headers'] != null
        ? Map<String, String>.from(json['headers'] as Map)
        : null,
    body: json['body'],
    createdAt: DateTime.parse(json['createdAt'] as String),
    retryCount: json['retryCount'] as int? ?? 0,
  );
}