I need to send an XML using an API (Post Method) But don't have an idea of how to convert an OBJECT CLASS in Dart to this XML and then send it to API.
1 Answer
I've done something similar before. You can either learn how to write XML or use a shortcut - convert to JSON then convert to XML. So you convert your Dart class into JSON then convert JSON to XML using this XML library
This question shows how to create a JSON object in flutter - Flutter Post JSON
This question shows how to convert JSON to XML using Dart's XML library - Flutter JSON to XML