PaystackResponse.fromJson constructor

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

Creates a PaystackResponse instance from a JSON object.

This factory constructor maps the JSON keys to the status and data fields.

Example JSON structure:

{
  "status": true,
  "data": {
    // API-specific response data
  }
}
  • json: The JSON object representing the API response.

Implementation

factory PaystackResponse.fromJson(Map<String, dynamic> json) {
  return PaystackResponse(
    status: json['status'],
    data: json['data'],
  );
}