profileDetailsToJson function
Converts a list of ProfileDetails objects into a JSON string.
This function takes a list of ProfileDetails objects, converts each object to a map
using the toJson
method, and then encodes the list of maps as a JSON string.
Parameters:
data
- A list of ProfileDetails objects.
Returns: A JSON string representing the list of profile details.
Implementation
String profileDetailsToJson(List<ProfileDetails> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));