PatchInfo.fromJson constructor

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

Manual JSON serialization (replacing code generation)

Implementation

factory PatchInfo.fromJson(Map<String, dynamic> json) {
  return PatchInfo(
    patchId: json['patchId'] as String,
    version: json['version'] as String,
    createdAt: DateTime.parse(json['createdAt'] as String),
    size: json['size'] as int,
    downloadUrl: json['downloadUrl'] as String,
    signature: json['signature'] as String,
    platform: json['platform'] as String? ?? 'android',
    changelog: json['changelog'] as String?,
    mandatory: json['mandatory'] as bool? ?? false,
    rolloutPercentage: json['rolloutPercentage'] as int? ?? 100,
    minAppVersion: json['minAppVersion'] as String?,
    maxAppVersion: json['maxAppVersion'] as String?,
  );
}