toMap method

Map<String, dynamic> toMap()

Converts the object to a map.

This method is typically used for serialization purposes, allowing the object to be represented as a key-value map. It's useful when you need to send data over the network or store it in a format that requires key-value pairs.

Returns a Map<String, dynamic> containing the object's properties.

Implementation

Map<String, dynamic> toMap() => {
      'status': status,
      'message': message,
      'data': data,
      'body': body,
      'request': request?.toMap(), // Assumes Request has a toMap() method
    };