toMap method

Map<String, dynamic> toMap()

Converts the Data instance to a Map.

This method is used for serializing the data to JSON or other map-based formats.

Returns:

  • Map containing URL and data content

Implementation

Map<String, dynamic> toMap() {
  return {
    'url': url.toString(),
    'obj': obj,
  };
}