toJson method
Creates a JSON string representation of Account object.
Implementation
Map<String, dynamic> toJson() {
List<String> list = [];
if (mechanismList != null) {
for (final element in mechanismList!) {
list.add(jsonEncode(element.toJson()));
}
}
Map<String, dynamic> jsonMap = {
'id': id,
'issuer': issuer,
'displayIssuer': displayIssuer,
'accountName': accountName,
'displayAccountName': displayAccountName,
'imageURL': imageURL,
'backgroundColor': backgroundColor,
'timeAdded': timeAdded,
'mechanismList': list
};
return jsonMap;
}